/* School Help Desk – public forms + staff dashboard */
.shd {
	--shd-accent: #1f3a68;
	--shd-accent-soft: rgba(31, 58, 104, .08);
	--shd-text: #1d2327;
	--shd-muted: #646970;
	--shd-border: #dcdfe4;
	--shd-bg: #fff;
	--shd-surface: #f6f7f9;
	--shd-ok: #1a7f37; --shd-ok-soft: #e7f5ec;
	--shd-warn: #996800; --shd-warn-soft: #fcf3e0;
	--shd-bad: #b42318; --shd-bad-soft: #fdecea;
	--shd-info: #2271b1; --shd-info-soft: #e5effa;
	--shd-star: #e8a317;
	color: var(--shd-text); font-size: 16px; line-height: 1.5; box-sizing: border-box;
}
.shd *, .shd *::before, .shd *::after { box-sizing: border-box; }
.shd button { font: inherit; cursor: pointer; }
.shd :focus-visible { outline: 2px solid var(--shd-accent); outline-offset: 2px; }
.shd-muted { color: var(--shd-muted); }
.shd-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

/* Buttons */
.shd-btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 40px; padding: 8px 14px; border: 1px solid var(--shd-border); border-radius: 8px; background: var(--shd-bg); color: var(--shd-text); font-weight: 600; font-size: .9em; text-decoration: none; line-height: 1.2; }
.shd-btn:hover { border-color: var(--shd-accent); }
.shd-btn:disabled { opacity: .55; cursor: not-allowed; }
.shd-btn-primary { background: var(--shd-accent); border-color: var(--shd-accent); color: #fff; }
.shd-btn-success { background: var(--shd-ok); border-color: var(--shd-ok); color: #fff; }
.shd-btn-danger { border-color: var(--shd-bad); color: var(--shd-bad); }
.shd-btn-ghost { border-color: transparent; background: transparent; }
.shd-btn-link { border: 0; background: none; color: var(--shd-accent); text-decoration: underline; padding-inline: 4px; }
.shd-btn-sm { min-height: 30px; padding: 4px 10px; font-size: .8em; }
.shd-btn-block { width: 100%; min-height: 52px; font-size: 1.05em; }

/* ---------- Public forms ---------- */
.shd-public { max-width: 640px; margin: 0 auto; }
.shd-lang { text-align: end; margin-bottom: 8px; font-size: .9em; }
.shd-lang a { color: var(--shd-accent); }
.shd-card { background: var(--shd-bg); border: 1px solid var(--shd-border); border-radius: 14px; padding: 22px 20px; }
.shd-title { margin: 0 0 4px; font-size: 1.5em; line-height: 1.25; }
.shd-intro { margin: 0 0 18px; color: var(--shd-muted); }
.shd-grid { display: grid; grid-template-columns: 1fr; gap: 14px; }
.shd-field { display: flex; flex-direction: column; gap: 4px; border: 0; margin: 0; padding: 0; min-width: 0; }
.shd-field > label, .shd-field > legend { font-weight: 600; font-size: .95em; padding: 0; margin-bottom: 4px; }
.shd-req { color: var(--shd-bad); }
.shd-opt { font-weight: 400; color: var(--shd-muted); font-size: .9em; }
.shd-public input[type=text], .shd-public input[type=email], .shd-public input[type=tel], .shd-public input[type=number], .shd-public input[type=date], .shd-public select, .shd-public textarea {
	width: 100%; min-height: 48px; padding: 10px 12px; border: 1px solid var(--shd-border); border-radius: 10px; background: var(--shd-bg); color: var(--shd-text); font: inherit; font-size: 16px;
}
.shd-public textarea { min-height: 90px; }
.shd-help { color: var(--shd-muted); font-size: .85em; }
.shd-help:empty { display: none; }
.shd-error { color: var(--shd-bad); font-size: .85em; }
.shd-error:empty { display: none; }
.has-error input, .has-error select, .has-error textarea { border-color: var(--shd-bad) !important; }
.shd-hp { position: absolute !important; left: -9999px !important; width: 1px; height: 1px; overflow: hidden; }
.shd-message:empty { display: none; }
.shd-message { margin: 14px 0 0; padding: 10px 12px; border-radius: 8px; }
.shd-message.is-error { background: var(--shd-bad-soft); color: var(--shd-bad); }
.shd-public .shd-btn-block { margin-top: 18px; }
.shd-privacy { font-size: .8em; color: var(--shd-muted); margin: 12px 0 0; text-align: center; }
.shd-check { display: inline-flex; gap: 8px; align-items: center; font-weight: 400; }
.shd-success { text-align: center; outline: none; }
.shd-success-label { color: var(--shd-muted); text-transform: uppercase; letter-spacing: .08em; font-size: .85em; }
.shd-ticket { font-size: 3.2em; font-weight: 800; letter-spacing: .04em; color: var(--shd-accent); line-height: 1.1; margin: 4px 0 10px; direction: ltr; }
.shd-seat { font-size: 1.1em; font-weight: 600; }
.shd-success-icon { width: 56px; height: 56px; border-radius: 50%; background: var(--shd-ok-soft); color: var(--shd-ok); display: grid; place-items: center; font-size: 28px; margin: 0 auto 10px; }
.shd-success-title { font-size: 1.2em; font-weight: 600; margin: 0 0 4px; }
.shd-notice { text-align: center; }

/* Stars + pills */
.shd-star-row { display: flex; gap: 6px; direction: ltr; justify-content: flex-start; }
[dir=rtl] .shd-star-row { justify-content: flex-end; flex-direction: row-reverse; }
.shd-star { position: relative; cursor: pointer; }
.shd-star input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.shd-star span[aria-hidden] { font-size: 38px; line-height: 1; color: #d5d8dc; transition: color .1s; display: block; padding: 2px; }
.shd-star-row:has(input:checked) .shd-star span[aria-hidden] { color: var(--shd-star); }
.shd-star:has(input:checked) ~ .shd-star span[aria-hidden] { color: #d5d8dc; }
.shd-star input:focus-visible + span { outline: 2px solid var(--shd-accent); border-radius: 6px; }
.shd-choice-row { display: flex; flex-wrap: wrap; gap: 8px; }
.shd-pill { position: relative; }
.shd-pill input { position: absolute; opacity: 0; }
.shd-pill span { display: inline-block; min-width: 72px; text-align: center; padding: 10px 16px; border: 1px solid var(--shd-border); border-radius: 999px; font-weight: 600; cursor: pointer; }
.shd-pill input:checked + span { background: var(--shd-accent); border-color: var(--shd-accent); color: #fff; }
.shd-pill input:focus-visible + span { outline: 2px solid var(--shd-accent); outline-offset: 2px; }
.shd-feedback-form .shd-field { margin-bottom: 16px; }

/* ---------- Dashboard ---------- */
.shd-dash { max-width: 1280px; margin: 0 auto; font-size: 15px; position: relative; }
.shd-dash-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; flex-wrap: wrap; }
.shd-dash-title { margin: 0; font-size: 1.5em; }
.shd-dash-user { margin: 2px 0 10px; color: var(--shd-muted); font-size: .9em; }
.shd-dash-user a { color: var(--shd-accent); }
.shd-tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--shd-border); margin-bottom: 12px; overflow-x: auto; }
.shd-tabs button { border: 0; background: none; padding: 10px 14px; font-weight: 600; color: var(--shd-muted); border-bottom: 3px solid transparent; white-space: nowrap; }
.shd-tabs button.is-active { color: var(--shd-accent); border-bottom-color: var(--shd-accent); }
.shd-count:not(:empty) { display: inline-block; min-width: 22px; padding: 1px 7px; margin-inline-start: 6px; border-radius: 11px; background: var(--shd-bad); color: #fff; font-size: .78em; }
.shd-filters { display: flex; flex-wrap: wrap; gap: 8px; align-items: flex-end; background: var(--shd-bg); border: 1px solid var(--shd-border); border-radius: 10px; padding: 10px; margin-bottom: 10px; }
.shd-filters label { display: flex; flex-direction: column; gap: 2px; font-size: .78em; font-weight: 600; color: var(--shd-muted); }
.shd-filters .shd-grow { flex: 1 1 200px; }
.shd-filters input, .shd-filters select { min-height: 38px; padding: 6px 8px; border: 1px solid var(--shd-border); border-radius: 8px; font: inherit; font-size: 14px; color: var(--shd-text); background: #fff; }
.shd-bar { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; }
.shd-bar-info { margin-inline-end: auto; color: var(--shd-muted); }
.shd-list.is-loading { opacity: .6; }
.shd-table-wrap { overflow-x: auto; background: var(--shd-bg); border: 1px solid var(--shd-border); border-radius: 10px; }
.shd-table { width: 100%; border-collapse: collapse; margin: 0; }
.shd-table th, .shd-table td { text-align: start; padding: 10px 12px; border-bottom: 1px solid #eef0f2; vertical-align: top; }
.shd-table th { background: var(--shd-surface); font-size: .8em; color: var(--shd-muted); white-space: nowrap; }
.shd-table td small { display: block; color: var(--shd-muted); font-size: .85em; }
.shd-row { cursor: pointer; }
.shd-row:hover { background: var(--shd-accent-soft); }
.shd-row.is-selected { background: var(--shd-accent-soft); box-shadow: inset 3px 0 0 var(--shd-accent); }
.shd-row.is-late .shd-wait { color: var(--shd-bad); font-weight: 700; }
.shd-row.is-late { box-shadow: inset 3px 0 0 var(--shd-bad); }
.shd-row-new td:first-child strong { color: var(--shd-accent); }
.shd-row.is-low { background: var(--shd-bad-soft); }
.shd-ticket-cell { border-inline-start: 4px solid var(--shd-accent); padding-inline-start: 6px; direction: ltr; display: inline-block; }
.shd-badge { display: inline-block; padding: 2px 9px; border-radius: 10px; font-size: .78em; font-weight: 700; white-space: nowrap; }
.shd-st-new { background: var(--shd-info-soft); color: var(--shd-info); }
.shd-st-in_progress { background: var(--shd-warn-soft); color: var(--shd-warn); }
.shd-st-done { background: var(--shd-ok-soft); color: var(--shd-ok); }
.shd-st-cancelled { background: #f0f0f1; color: #787c82; }
.shd-stars-view { color: var(--shd-star); letter-spacing: 1px; white-space: nowrap; direction: ltr; display: inline-block; }
.shd-stars-off { color: #d5d8dc; }
.shd-empty { padding: 30px; text-align: center; color: var(--shd-muted); background: var(--shd-bg); border: 1px dashed var(--shd-border); border-radius: 10px; }
.shd-comment { max-width: 320px; white-space: pre-wrap; }

/* Side panel */
.shd-overlay { position: fixed; inset: 0; background: rgba(0, 0, 0, .25); z-index: 99998; }
.shd-panel { position: fixed; top: 0; bottom: 0; inset-inline-end: 0; width: min(480px, 100vw); background: var(--shd-bg); z-index: 99999; overflow-y: auto; padding: 18px 20px 40px; box-shadow: -8px 0 24px rgba(0, 0, 0, .12); }
.admin-bar .shd-panel { top: 32px; }
.shd-panel-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; }
.shd-panel-ticket { font-size: 1.6em; font-weight: 800; direction: ltr; }
.shd-panel-status { display: flex; gap: 10px; align-items: center; margin: 8px 0 12px; }
.shd-dl { display: grid; grid-template-columns: max-content 1fr; gap: 6px 14px; margin: 0 0 14px; }
.shd-dl dt { color: var(--shd-muted); font-size: .88em; }
.shd-dl dd { margin: 0; white-space: pre-wrap; word-break: break-word; }
.shd-dl-tight { gap: 3px 12px; }
.shd-actions { display: flex; flex-wrap: wrap; gap: 8px; margin: 6px 0; }
.shd-action-form:not(:empty) { background: var(--shd-surface); border-radius: 10px; padding: 12px; margin: 8px 0; }
.shd-label { display: flex; flex-direction: column; gap: 4px; font-weight: 600; font-size: .9em; margin-bottom: 8px; }
.shd-panel textarea, .shd-panel select { width: 100%; padding: 8px 10px; border: 1px solid var(--shd-border); border-radius: 8px; font: inherit; font-weight: 400; }
.shd-row-btns { display: flex; gap: 8px; flex-wrap: wrap; }
.shd-note { display: flex; gap: 8px; align-items: flex-start; margin: 14px 0; }
.shd-note textarea { flex: 1; }
.shd-panel h4 { margin: 18px 0 8px; font-size: .95em; }
.shd-timeline { list-style: none; margin: 0; padding: 0; border-inline-start: 2px solid var(--shd-border); }
.shd-timeline li { position: relative; padding: 0 0 12px 14px; }
[dir=rtl] .shd-timeline li { padding: 0 14px 12px 0; }
.shd-timeline li::before { content: ""; position: absolute; inset-inline-start: -6px; top: 6px; width: 10px; height: 10px; border-radius: 50%; background: var(--shd-border); }
.shd-timeline .shd-ev-status::before, .shd-timeline .shd-ev-created::before { background: var(--shd-accent); }
.shd-timeline .shd-ev-feedback::before { background: var(--shd-star); }
.shd-timeline .is-failed { color: var(--shd-bad); }
.shd-ev-head { font-size: .88em; }
.shd-ev-msg { white-space: pre-wrap; font-size: .9em; background: var(--shd-surface); border-radius: 6px; padding: 6px 8px; margin-top: 4px; }
.shd-fb-card { border: 1px solid var(--shd-border); border-radius: 10px; padding: 10px 12px; margin: 12px 0; }
.shd-fb-card.is-low { border-color: var(--shd-bad); background: var(--shd-bad-soft); }
.shd-fb-card h4 { margin: 0 0 6px; }

/* Feedback summary */
.shd-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 10px; margin-bottom: 12px; }
.shd-stat { background: var(--shd-bg); border: 1px solid var(--shd-border); border-radius: 10px; padding: 12px 14px; }
.shd-stat-num { font-size: 1.6em; font-weight: 800; }

/* Phones: the table becomes cards */
@media (max-width: 760px) {
	.shd-table thead { display: none; }
	.shd-table, .shd-table tbody, .shd-table tr, .shd-table td { display: block; width: 100%; }
	.shd-table tr { border-bottom: 1px solid var(--shd-border); padding: 8px 0; }
	.shd-table td { border: 0; padding: 3px 12px; }
	.shd-table td[data-label]::before { content: attr(data-label); display: block; font-size: .72em; font-weight: 700; color: var(--shd-muted); text-transform: uppercase; }
	.shd-filters label { flex: 1 1 45%; }
	.shd-card { padding: 18px 16px; }
}

@media print {
	.shd-filters, .shd-bar, .shd-tabs, .shd-panel, .shd-overlay, .shd-mute, .shd-dash-user { display: none !important; }
	.shd-table-wrap { border: 0; overflow: visible; }
	.shd-table th, .shd-table td { padding: 4px 6px; font-size: 11px; }
	.shd-row.is-selected, .shd-row:hover { background: none; box-shadow: none; }
}

/* Notification sound controls */
.shd-sound-ctrls { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.shd-sound-wrap { display: inline-flex; align-items: center; gap: 4px; }
.shd-sound-pick { min-height: 40px; padding: 6px 8px; border: 1px solid var(--shd-border); border-radius: 8px; font: inherit; font-size: 14px; background: #fff; color: var(--shd-text); max-width: 220px; }
@media print { .shd-sound-ctrls { display: none !important; } }
