/*
Theme Name: TS Portal
Description: Clean, branded theme for the TS Helpdesk plugin. Logo, colors, header and footer come from Help Desk → Company settings.
Version: 1.1.1
Author: Your Name
Requires at least: 6.0
Requires PHP: 7.4
Text Domain: ts-portal
*/

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
	margin: 0;
	background: var(--tsh-bg, #F5F6F8);
	color: var(--tsh-text, #1E2430);
	font-family: var(--tsh-font, system-ui, -apple-system, "Segoe UI", sans-serif);
	font-size: 15px;
	line-height: 1.5;
	min-height: 100vh;
	display: flex;
	flex-direction: column;
}
img { max-width: 100%; height: auto; }
a { color: var(--tsh-brand, #1F4E8C); }

.tsp-skip { position: absolute; left: -9999px; top: 0; z-index: 100; background: #FFFFFF; color: #1E2430; padding: 10px 14px; }
.tsp-skip:focus { left: 12px; top: 12px; }

.tsp-container { width: 100%; max-width: 1240px; margin: 0 auto; padding: 0 24px; }

/* ---------- Header ---------- */
.tsh-site-header { background: var(--tsh-brand, #1F4E8C); color: #FFFFFF; }
.tsh-site-header.is-light { background: var(--tsh-card, #FFFFFF); color: var(--tsh-text, #1E2430); border-bottom: 1px solid var(--tsh-border, #E3E5E9); }
.tsp-header { display: flex; flex-wrap: wrap; align-items: center; gap: 16px 20px; padding-top: 12px; padding-bottom: 12px; }
.tsp-brand { display: flex; align-items: center; gap: 12px; flex: 1 1 220px; text-decoration: none; color: inherit !important; min-width: 0; }
.tsp-logo { width: 44px; height: 44px; border-radius: 10px; background: #FFFFFF; color: var(--tsh-brand, #1F4E8C); font-weight: 700; font-size: 16px; display: flex; align-items: center; justify-content: center; overflow: hidden; flex: 0 0 auto; }
.tsp-logo img { max-width: 100%; max-height: 100%; object-fit: contain; }
.tsp-logo.has-img { width: auto; min-width: 44px; max-width: 160px; padding: 4px 8px; }
.is-light .tsp-logo { background: var(--tsh-soft, #EEF0F3); }
.tsp-brand__name { font-weight: 700; font-size: 17px; line-height: 1.2; }
.tsp-brand__sub { font-size: 12px; opacity: 0.85; }

.tsp-nav { display: flex; flex-wrap: wrap; gap: 4px; }
.tsp-nav a { color: inherit !important; text-decoration: none; padding: 12px 14px; border-radius: 8px; font-size: 14px; font-weight: 500; min-height: 44px; display: inline-flex; align-items: center; }
.tsp-nav a:hover { background: rgba(255, 255, 255, 0.12); }
.tsp-nav a.is-active { background: rgba(255, 255, 255, 0.18); font-weight: 700; }
.is-light .tsp-nav a:hover { background: var(--tsh-soft, #EEF0F3); }
.is-light .tsp-nav a.is-active { background: var(--tsh-soft, #EEF0F3); color: var(--tsh-brand, #1F4E8C) !important; }

.tsp-tools { display: flex; align-items: center; gap: 8px; }
.tsp-icon-btn { position: relative; width: 44px; height: 44px; border-radius: 10px; border: 0; background: rgba(255, 255, 255, 0.16); color: inherit !important; display: inline-flex; align-items: center; justify-content: center; text-decoration: none; cursor: pointer; }
.is-light .tsp-icon-btn { background: var(--tsh-soft, #EEF0F3); }
.tsp-icon-btn svg { width: 20px; height: 20px; }
.tsp-dot { position: absolute; top: 4px; right: 4px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 999px; background: var(--tsh-accent, #F2A623); color: #1E2430; font-size: 11px; font-weight: 700; display: flex; align-items: center; justify-content: center; }
.tsp-user { position: relative; }
.tsp-user summary { list-style: none; cursor: pointer; }
.tsp-user summary::-webkit-details-marker { display: none; }
.tsp-avatar { width: 44px; height: 44px; border-radius: 50%; background: var(--tsh-accent, #F2A623); color: #1E2430; font-weight: 700; font-size: 14px; display: flex; align-items: center; justify-content: center; }
.tsp-menu { position: absolute; right: 0; top: 52px; z-index: 50; min-width: 220px; background: var(--tsh-card, #FFFFFF); color: var(--tsh-text, #1E2430); border: 1px solid var(--tsh-border, #E3E5E9); border-radius: 12px; padding: 8px; box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12); }
.tsp-menu__who { padding: 8px 10px 10px; border-bottom: 1px solid var(--tsh-soft, #EEF0F3); margin-bottom: 6px; font-size: 13px; }
.tsp-menu__who strong { display: block; font-size: 14px; }
.tsp-menu a { display: block; padding: 10px; border-radius: 8px; color: var(--tsh-text, #1E2430) !important; text-decoration: none; font-size: 14px; }
.tsp-menu a:hover { background: var(--tsh-soft, #EEF0F3); }
.tsp-signin { color: inherit !important; font-weight: 600; text-decoration: none; padding: 10px 16px; border: 1px solid currentColor; border-radius: var(--tsh-btn-radius, 8px); }
.tsp-accent-line { height: 4px; background: var(--tsh-accent, #F2A623); }

/* ---------- Main ---------- */
.tsp-main { flex: 1; padding-top: 32px; padding-bottom: 48px; }
.tsp-entry-title { font-size: 28px; margin: 0 0 16px; }
.tsp-entry { background: var(--tsh-card, #FFFFFF); border: 1px solid var(--tsh-border, #E3E5E9); border-radius: 12px; padding: 28px; }

/* ---------- Footer ---------- */
.tsh-site-footer { background: var(--tsh-footer, #1E2430); color: #C9CED6; font-size: 14px; }
.tsh-site-footer a { color: #C9CED6; }
.tsp-footer-cols { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 32px; padding-top: 36px; padding-bottom: 24px; }
.tsp-footer-cols h2 { color: #FFFFFF; font-size: 14px; font-weight: 700; margin: 0 0 10px; }
.tsp-footer-cols ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.tsp-footer-brand { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; color: #FFFFFF; font-weight: 700; }
.tsp-footer-brand .tsp-logo { width: 36px; height: 36px; background: var(--tsh-brand, #1F4E8C); color: #FFFFFF; font-size: 13px; }
.tsp-footer-brand .tsp-logo.has-img { background: transparent; width: auto; }
.tsp-footer-about { margin: 0; line-height: 1.6; white-space: pre-line; }
.tsp-footer-bottom { border-top: 1px solid rgba(255, 255, 255, 0.12); }
.tsp-footer-bottom .tsp-container { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px; padding-top: 14px; padding-bottom: 14px; font-size: 12px; color: #9AA1AD; }
.tsh-site-footer.is-light { background: var(--tsh-card, #FFFFFF); color: var(--tsh-muted, #5B6270); border-top: 1px solid var(--tsh-border, #E3E5E9); }
.tsh-site-footer.is-light .tsp-footer-bottom { border-top: 0; }
.tsh-site-footer.is-light .tsp-footer-bottom .tsp-container { color: var(--tsh-muted, #5B6270); font-size: 13px; }

@media (max-width: 800px) {
	.tsp-footer-cols { grid-template-columns: minmax(0, 1fr); gap: 20px; }
	.tsp-nav { order: 3; width: 100%; overflow-x: auto; flex-wrap: nowrap; }
	.tsp-container { padding: 0 16px; }
	.tsp-main { padding-top: 20px; }
}
@media print {
	.tsh-site-header, .tsh-site-footer, .tsp-accent-line { display: none !important; }
}
