/* ==========================================================================
   Support Tickets — Frontend Styles
   ========================================================================== */

.shd-frontend {
	font-size: 15px;
	line-height: 1.6;
	color: #333;
}

/* Section titles ---------------------------------------------------------- */

.shd-section-title {
	font-size: 1.3em;
	margin-bottom: 1em;
}

/* Notices ----------------------------------------------------------------- */

.shd-notice {
	padding: 12px 16px;
	border-radius: 4px;
	margin-bottom: 16px;
	font-size: 14px;
}

.shd-notice-success {
	background: #edfaef;
	border: 1px solid #2ea44f;
	color: #1a6632;
}

.shd-notice-error {
	background: #fce8e8;
	border: 1px solid #d63638;
	color: #a0191b;
}

/* Ticket list ------------------------------------------------------------- */

.shd-tickets-table {
	width: 100%;
	border-collapse: collapse;
	border: 1px solid #e0e0e0;
}

.shd-tickets-table th,
.shd-tickets-table td {
	padding: 10px 14px;
	text-align: left;
	border-bottom: 1px solid #e0e0e0;
	font-size: 14px;
}

.shd-tickets-table th {
	background: #f5f5f5;
	font-weight: 600;
}

.shd-tickets-table tbody tr:hover {
	background: #fafafa;
}

.shd-tickets-table a {
	color: #2271b1;
	text-decoration: none;
}

.shd-tickets-table a:hover {
	text-decoration: underline;
}

/* Status badge */

.shd-status-badge {
	display: inline-block;
	padding: 2px 10px;
	border-radius: 12px;
	color: #fff;
	font-size: 12px;
	font-weight: 600;
	line-height: 1.6;
}

/* Empty state */

.shd-empty-state {
	text-align: center;
	padding: 40px 20px;
	border: 2px dashed #e0e0e0;
	border-radius: 6px;
	color: #666;
}

.shd-empty-state p {
	margin-bottom: 16px;
}

/* Pagination */

.shd-pagination {
	margin-top: 16px;
	text-align: center;
}

.shd-pagination .page-numbers {
	display: inline-block;
	padding: 6px 12px;
	border: 1px solid #ddd;
	margin: 0 2px;
	border-radius: 3px;
	text-decoration: none;
	color: #2271b1;
}

.shd-pagination .page-numbers.current {
	background: #2271b1;
	color: #fff;
	border-color: #2271b1;
}

/* Single ticket ----------------------------------------------------------- */

.shd-breadcrumb {
	margin-bottom: 16px;
}

.shd-breadcrumb a {
	color: #2271b1;
	text-decoration: none;
}

.shd-breadcrumb a:hover {
	text-decoration: underline;
}

.shd-ticket-header {
	display: flex;
	align-items: center;
	gap: 12px;
	margin-bottom: 20px;
	flex-wrap: wrap;
}

.shd-ticket-header h2 {
	margin: 0;
	font-size: 1.4em;
}

/* Thread */

.shd-frontend-thread {
	border: 1px solid #e0e0e0;
	border-radius: 6px;
	overflow: hidden;
	margin-bottom: 24px;
}

.shd-thread-entry {
	padding: 16px 20px;
	border-bottom: 1px solid #e8e8e8;
}

.shd-thread-entry:last-child {
	border-bottom: none;
}

.shd-mine {
	background: #f0f7ff;
}

.shd-staff-reply {
	background: #f9f9f9;
}

.shd-entry-header {
	display: flex;
	align-items: flex-start;
	gap: 12px;
	margin-bottom: 10px;
}

.shd-entry-header img {
	border-radius: 50%;
	flex-shrink: 0;
}

.shd-entry-meta {
	display: flex;
	flex-direction: column;
	gap: 2px;
}

.shd-entry-meta strong {
	font-size: 14px;
}

.shd-entry-meta time {
	font-size: 12px;
	color: #777;
}

.shd-entry-body {
	margin-left: 48px;
	font-size: 14px;
	line-height: 1.7;
}

.shd-entry-body p:last-child {
	margin-bottom: 0;
}

.shd-attachments {
	margin: 10px 0 0 48px;
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
}

.shd-attachment-image img {
	border-radius: 4px;
	border: 1px solid #e0e0e0;
}

.shd-attachment-link {
	display: inline-flex;
	align-items: center;
	gap: 4px;
	font-size: 13px;
	padding: 4px 10px;
	background: #f0f0f0;
	border-radius: 3px;
	text-decoration: none;
	color: #2271b1;
}

.shd-attachment-link:hover {
	background: #ddd;
}

/* Reply form */

.shd-reply-form-wrap {
	background: #fff;
	border: 1px solid #e0e0e0;
	border-radius: 6px;
	padding: 20px;
	margin-top: 24px;
}

.shd-reply-form-wrap h3 {
	margin-top: 0;
	font-size: 1.1em;
}

.shd-reply-textarea {
	width: 100%;
	padding: 10px 12px;
	border: 1px solid #ccc;
	border-radius: 4px;
	font-family: inherit;
	font-size: 14px;
	resize: vertical;
	box-sizing: border-box;
	margin-bottom: 12px;
}

.shd-reply-textarea:focus {
	outline: none;
	border-color: #2271b1;
	box-shadow: 0 0 0 2px rgba(34, 113, 177, 0.15);
}

.shd-reply-footer {
	display: flex;
	justify-content: space-between;
	align-items: center;
	gap: 12px;
	flex-wrap: wrap;
}

.shd-attach-label {
	font-size: 13px;
	color: #555;
}

/* Buttons */

.shd-button {
	display: inline-block;
	padding: 8px 16px;
	background: #2271b1;
	color: #fff;
	border: none;
	border-radius: 4px;
	cursor: pointer;
	font-size: 14px;
	text-decoration: none;
	transition: background 0.15s;
}

.shd-button:hover {
	background: #135e96;
	color: #fff;
}

.shd-button-primary {
	background: #2271b1;
}

.shd-button-primary:hover {
	background: #135e96;
}

/* Closed ticket notice */

.shd-closed-notice {
	background: #f5f5f5;
	border: 1px solid #ddd;
	border-radius: 6px;
	padding: 20px;
	text-align: center;
	color: #555;
	margin-top: 16px;
}

.shd-closed-notice a {
	color: #2271b1;
}

/* Responsive */

@media (max-width: 600px) {
	.shd-entry-body,
	.shd-attachments {
		margin-left: 0;
		margin-top: 10px;
	}

	.shd-reply-footer {
		flex-direction: column;
		align-items: flex-start;
	}

	.shd-tickets-table th,
	.shd-tickets-table td {
		padding: 8px;
	}
}

/* ==========================================================================
   Contact section — injected by plugin into dashboard + support-tickets endpoint
   Mirrors the design-token aliases defined in .sh-dashboard.
   ========================================================================== */

.shd-contact-section {
	--sh-ink:        var(--spiderhouse-ink,       #13354E);
	--sh-secondary:  var(--spiderhouse-secondary, #f37432);
	--sh-paper:      var(--spiderhouse-paper,     #ffffff);
	--sh-accent:     #ECECEC;
	--sh-accent-2:   #4F4F4F;
	--sh-radius-xl:  22px;
	--sh-radius-lg:  16px;
	--sh-radius-md:  10px;
	--sh-radius-sm:  6px;
	--sh-dur:        140ms;
	--sh-ease:       cubic-bezier(0.25, 0.1, 0.25, 1);

	border-radius: var(--sh-radius-lg);
	background: var(--sh-paper);
	box-shadow: 0 0 0 1px var(--sh-accent) inset;
	overflow: hidden;
	scroll-margin-top: 120px;
	margin-top: 32px;
}

/* Tab strip ---------------------------------------------------------------- */

.shd-contact-section .shd-contact-tabs {
	display: flex;
	background: #f8f7f4;
	border-bottom: 1px solid var(--sh-accent);
}

.shd-contact-section .shd-contact-tab {
	display: flex;
	flex: 1;
	align-items: center;
	gap: 10px;
	padding: 16px 24px;
	font-family: inherit;
	font-size: 15px;
	font-weight: 600;
	color: var(--sh-accent-2);
	background: none;
	border: none;
	border-bottom: 2px solid transparent;
	margin-bottom: -1px;
	cursor: pointer;
	transition:
		color var(--sh-dur) var(--sh-ease),
		border-color var(--sh-dur) var(--sh-ease);
}

.shd-contact-section #shd-tab-btn-support {
	border-radius: 16px 0 0;
}

.shd-contact-section .shd-tab-text {
	display: flex;
	flex-direction: column;
	gap: 2px;
	min-width: 0;
	text-align: left;
}

.shd-contact-section .shd-tab-title {
	font-size: 15px;
	font-weight: 700;
	line-height: 1.2;
	color: inherit;
}

.shd-contact-section .shd-tab-sub {
	font-size: 12px;
	color: var(--sh-accent-2);
	line-height: 1.3;
}

.shd-contact-section .shd-contact-tab:hover {
	color: var(--sh-ink);
}

.shd-contact-section .shd-contact-tab.is-active {
	color: var(--sh-ink);
	border-bottom-color: var(--sh-secondary);
	background: white;
	border-top: 1px solid var(--sh-accent);
	border-left: 1px solid var(--sh-accent);
}

.shd-contact-section .shd-contact-tab-icon {
	width: 30px;
	height: 30px;
	border-radius: var(--sh-radius-sm);
	background: var(--sh-accent);
	display: flex;
	align-items: center;
	justify-content: center;
	color: var(--sh-accent-2);
	flex-shrink: 0;
	transition:
		background var(--sh-dur) var(--sh-ease),
		color var(--sh-dur) var(--sh-ease);
}

.shd-contact-section .shd-contact-tab-icon svg {
	width: 16px;
	height: 16px;
}

.shd-contact-section .shd-contact-tab.is-active .shd-contact-tab-icon {
	background: rgba(243, 116, 50, 0.12);
	color: var(--sh-secondary);
}

/* Panels ------------------------------------------------------------------- */

.shd-contact-section .shd-contact-panel {
	padding: 28px;
	display: none;
}

.shd-contact-section .shd-contact-panel.is-active {
	display: block;
}

/* Panel header */

.shd-contact-section .shd-contact-panel-header {
	margin-bottom: 24px;
}

.shd-contact-section .shd-contact-panel-title {
	font-size: 18px;
	font-weight: 700;
	color: var(--sh-ink);
	margin: 0 0 6px;
	line-height: 1.25;
}

.shd-contact-section .shd-contact-panel-sub {
	font-size: 14px;
	color: var(--sh-accent-2);
	margin: 0;
	line-height: 1.5;
}

.shd-contact-section .shd-contact-panel-sub strong {
	color: var(--sh-ink);
	font-weight: 600;
}

/* CF7 wrapper */

.shd-contact-section .shd-contact-panel .wpcf7 {
	width: 100%;
}
.shd-contact-section .wpcf7-form > * {
  width: 100%;
}

.shd-contact-section .shd-contact-panel .wpcf7-form br {
	display: none !important;
}

/* Form layout — two-column flex */

.shd-contact-section .wpcf7-form {
	display: flex;
	flex-wrap: wrap;
	gap: 16px 20px;
}

.shd-contact-section .wpcf7-form > p {
	flex: 1 1 200px;
	margin: 0;
	display: flex;
	flex-direction: column;
	gap: 6px;
}

.shd-contact-section .wpcf7-form > p:has(.wpcf7-textarea) {
	flex: 1 1 100%;
}

.shd-contact-section .wpcf7-form > p:last-of-type {
	flex: 1 1 100%;
	flex-direction: row;
	justify-content: flex-end;
	align-items: center;
	gap: 10px;
}

.shd-contact-section .wpcf7-form > .wpcf7-response-output {
	flex: 1 1 100%;
	margin: 0;
}

/* Labels */

.shd-contact-section .wpcf7-form label {
	font-size: 13px;
	font-weight: 600;
	color: var(--sh-ink);
	line-height: 1.3;
}

.shd-contact-section .wpcf7-form-control-wrap {
	display: block;
}

/* Form fields -------------------------------------------------------------- */

.shd-contact-section .wpcf7-text,
.shd-contact-section .wpcf7-select,
.shd-contact-section .wpcf7-textarea {
	font-family: inherit;
	font-size: 16px;
	color: var(--sh-ink);
	background: var(--sh-paper);
	border: 1.5px solid var(--sh-accent);
	border-radius: var(--sh-radius-md);
	padding: 12px 14px;
	width: 100%;
	box-sizing: border-box;
	outline: none;
	transition:
		border-color var(--sh-dur) var(--sh-ease),
		box-shadow  var(--sh-dur) var(--sh-ease);
	-webkit-appearance: none;
	appearance: none;
}

.shd-contact-section .wpcf7-select {
	background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'><path d='M1 1l5 5 5-5' fill='none' stroke='%2313354E' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/></svg>");
	background-repeat: no-repeat;
	background-position: right 14px center;
	padding-right: 38px;
}

.shd-contact-section .wpcf7-textarea {
	min-height: 120px;
	resize: vertical;
	line-height: 1.5;
}

.shd-contact-section .wpcf7-text::placeholder,
.shd-contact-section .wpcf7-textarea::placeholder {
	color: rgba(19, 53, 78, 0.42);
}

.shd-contact-section .wpcf7-text:focus,
.shd-contact-section .wpcf7-select:focus,
.shd-contact-section .wpcf7-textarea:focus {
	border-color: var(--sh-ink);
	box-shadow: 0 0 0 3px rgba(19, 53, 78, 0.08);
}

.shd-contact-section .wpcf7-text:-webkit-autofill,
.shd-contact-section .wpcf7-textarea:-webkit-autofill {
	-webkit-text-fill-color: var(--sh-ink);
	transition: background-color 9999s ease-out 0s;
	box-shadow: 0 0 0 1000px var(--sh-paper) inset, 0 0 0 3px rgba(19, 53, 78, 0.08);
}

.shd-contact-section .wpcf7-not-valid {
	border-color: #dc2626;
	box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.12);
}

.shd-contact-section .wpcf7-not-valid-tip {
	display: block;
	margin-top: 4px;
	font-size: 12px;
	font-weight: 600;
	color: #dc2626;
}

/* Buttons ------------------------------------------------------------------ */

.shd-contact-section .wpcf7-reset {
	display: inline-flex;
	align-items: center;
	padding: 12px 22px;
	border-radius: 99px;
	font-family: inherit;
	font-size: 15px;
	font-weight: 600;
	line-height: 1;
	cursor: pointer;
	border: 1.5px solid #d0d0d0;
	background: var(--sh-paper);
	color: var(--sh-accent-2);
	-webkit-appearance: none;
	appearance: none;
	transition:
		border-color var(--sh-dur) var(--sh-ease),
		color        var(--sh-dur) var(--sh-ease);
}

.shd-contact-section .wpcf7-reset:hover {
	border-color: #bbb;
	color: var(--sh-ink);
}

.shd-contact-section .wpcf7-submit,.shd-contact-section .sh-btn.sh-btn--ghost{
	display: inline-flex;
	align-items: center;
	gap: 6px;
	border-radius: 99px;
	font-family: inherit;
	font-weight: 600;
	line-height: 1;
	cursor: pointer;
	border: none;
	text-decoration: none;
	box-shadow: 0 6px 18px rgba(243, 116, 50, 0.28);
	-webkit-appearance: none;
	appearance: none;
	transition:
		background var(--sh-dur) var(--sh-ease),
		box-shadow  var(--sh-dur) var(--sh-ease),
		transform   var(--sh-dur) var(--sh-ease);
}

.shd-contact-section .wpcf7-submit{
	color: var(--sh-paper);
	font-size: 15px;
	background: var(--sh-secondary);
	padding: 12px 22px;
}

.shd-contact-section .sh-btn.sh-btn--ghost{
    background: transparent;
    color: var(--sh-ink);
    box-shadow: 0 0 0 1px var(--sh-accent) inset;
}
 .sh-btn.sh-btn--ghost.is-sm {
    padding: 12px 18px;
    font-size: 14px;
}


.shd-contact-section .wpcf7-submit:hover {
	background: #e06620;
	transform: translateY(-1px);
	box-shadow: 0 10px 24px rgba(243, 116, 50, 0.36);
	color: #ffffff;
}

/* CF7 response messages ---------------------------------------------------- */

.shd-contact-section .wpcf7-response-output {
	margin: 14px 0 0;
	padding: 12px 16px;
	border-radius: var(--sh-radius-md);
	font-size: 14px;
	font-weight: 600;
	border: none;
}

.shd-contact-section .wpcf7-mail-sent-ok {
	background: #ecfdf5;
	color: #065f46;
	border-left: 3px solid #10b981;
}

.shd-contact-section .wpcf7-mail-sent-ng,
.shd-contact-section .wpcf7-validation-errors,
.shd-contact-section .wpcf7-spam-blocked {
	background: #fef2f2;
	color: #991b1b;
	border-left: 3px solid #dc2626;
}

.shd-contact-section .wpcf7-spinner {
	margin-left: 6px;
}

/* Responsive --------------------------------------------------------------- */

@media (max-width: 700px) {
	.shd-contact-section .shd-contact-tab {
		padding: 14px 16px;
		font-size: 14px;
	}

	.shd-contact-section .shd-contact-panel {
		padding: 20px;
	}

	.shd-contact-section .wpcf7-form > p {
		flex: 1 1 100%;
	}

	.shd-contact-section .wpcf7-form > p:last-of-type {
		flex-direction: column;
		align-items: stretch;
	}

	.shd-contact-section .wpcf7-reset,
	.shd-contact-section .wpcf7-submit {
		width: 100%;
		justify-content: center;
	}
}

/* ==========================================================================
   Open Tickets card — plugin-owned default styles
   The .shd-tickets-card class is on the <article> element.
   On themes that already style .stat (like SpiderHouse), those rules win
   on the container (higher specificity) and these serve as portable fallbacks.
   ========================================================================== */

.shd-tickets-card {
	--sh-ink:       var(--spiderhouse-ink,       #13354E);
	--sh-secondary: var(--spiderhouse-secondary, #f37432);
	--sh-paper:     var(--spiderhouse-paper,     #ffffff);
	--sh-accent:    #ECECEC;
	--sh-accent-2:  #4F4F4F;
	--sh-radius-lg: 16px;
	--sh-dur:       140ms;
	--sh-ease:      cubic-bezier(0.25, 0.1, 0.25, 1);

	border-radius: var(--sh-radius-lg);
	background: var(--sh-paper);
	box-shadow: 0 0 0 1px var(--sh-accent) inset;
	padding: 24px;
	display: flex;
	flex-direction: column;
	gap: 16px;
	min-height: 200px;
}

.shd-tickets-card .stat-head {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
}

.shd-tickets-card .stat-label {
	font-size: 12px;
	font-weight: 700;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	color: var(--sh-accent-2);
}

.shd-tickets-card .stat-body {
	display: flex;
	align-items: center;
	gap: 20px;
	flex: 1;
}

.shd-tickets-card .stat-text {
	display: flex;
	flex-direction: column;
	gap: 8px;
	min-width: 0;
	flex: 1;
}

.shd-tickets-card .stat-headline {
	font-size: 17px;
	font-weight: 600;
	color: var(--sh-ink);
	line-height: 1.35;
	margin: 0;
}

.shd-tickets-card .stat-sub {
	font-size: 14px;
	color: var(--sh-accent-2);
	line-height: 1.5;
	margin: 0;
}

.shd-tickets-card .stat-foot {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	padding-top: 14px;
	border-top: 1px solid var(--sh-accent);
	margin-top: auto;
}

/* ── Count bubble ─────────────────────────────────────────────────────────── */

.shd-tickets-card .count-bubble {
	width: 96px;
	height: 96px;
	flex: 0 0 96px;
	border-radius: var(--sh-radius-lg);
	background: rgba(20, 127, 206, 0.08);
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: 2px;
}

.shd-tickets-card .count-bubble .num {
	font-size: 38px;
	font-weight: 700;
	color: #0F5D96;
	line-height: 1;
	font-feature-settings: "tnum";
}

.shd-tickets-card .count-bubble .lbl {
	font-size: 10px;
	font-weight: 600;
	letter-spacing: 0.06em;
	text-transform: uppercase;
	color: #0F5D96;
}

.shd-tickets-card .count-bubble--ok {
	background: rgba(174, 212, 115, 0.18);
}

.shd-tickets-card .count-bubble--ok .num {
	font-size: 32px;
	color: #4F7A1F;
}

.shd-tickets-card .count-bubble--alert {
	background: rgba(243, 116, 50, 0.10);
}

.shd-tickets-card .count-bubble--alert .num {
	color: var(--sh-secondary);
}

.shd-tickets-card .count-bubble--alert .lbl {
	color: var(--sh-secondary);
}

/* ── Ghost link ───────────────────────────────────────────────────────────── */

.shd-tickets-card .ghost-link {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	font-size: 14px;
	font-weight: 600;
	color: var(--sh-ink);
	text-decoration: none;
	transition: color var(--sh-dur) var(--sh-ease), gap var(--sh-dur) var(--sh-ease);
}

.shd-tickets-card .ghost-link:hover {
	color: var(--sh-secondary);
	gap: 10px;
	text-decoration: none;
}

.shd-tickets-card .ghost-link svg {
	width: 14px;
	height: 14px;
	flex-shrink: 0;
	transition: transform var(--sh-dur) var(--sh-ease);
}

.shd-tickets-card .ghost-link:hover svg {
	transform: translateX(2px);
}

/* Responsive --------------------------------------------------------------- */

@media (max-width: 700px) {
	.shd-tickets-card {
		min-height: 0;
	}
}