/* JR ATS — Help Center (Support Tickets + Knowledge Base)
   Brand: #5277ba */

.jrhc-wrap { max-width: 960px; margin: 0 auto; font-size: 15px; color: #2c3345; }
.jrhc-wrap * { box-sizing: border-box; }

/* ---- Buttons / notices ---- */
.jrhc-btn { display: inline-block; padding: 9px 18px; border-radius: 8px; border: 1px solid #5277ba; color: #5277ba; background: #fff; text-decoration: none; cursor: pointer; font-weight: 600; transition: all .15s ease; }
.jrhc-btn:hover { background: #eef2fa; }
.jrhc-btn--primary { background: #5277ba; color: #fff; }
.jrhc-btn--primary:hover { background: #41639c; color: #fff; }
.jrhc-notice { background: #f6f8fc; border: 1px solid #dde5f2; border-radius: 10px; padding: 16px 20px; margin: 12px 0; }
.jrhc-form-status { font-size: 13px; color: #5277ba; }
.jrhc-form-status.is-error { color: #c0392b; }
.jrhc-form-status.is-ok { color: #1e8e4e; }

/* ---- Create form ---- */
.jrhc-create { background: #fff; border: 1px solid #e3e8f2; border-radius: 12px; padding: 18px; margin: 10px 0; }
.jrhc-create--compact { border: none; padding: 0; margin: 0; }
.jrhc-field { margin-bottom: 12px; }
.jrhc-field label { display: block; font-weight: 600; font-size: 13px; margin-bottom: 5px; color: #3a4358; }
.jrhc-field input[type="text"], .jrhc-field select, .jrhc-field textarea { width: 100%; padding: 9px 12px; border: 1px solid #ccd6e8; border-radius: 8px; font-size: 14px; }
.jrhc-field input:focus, .jrhc-field select:focus, .jrhc-field textarea:focus { outline: none; border-color: #5277ba; box-shadow: 0 0 0 3px rgba(82, 119, 186, .15); }
.jrhc-row { display: flex; gap: 14px; }
.jrhc-row .jrhc-field { flex: 1; }
.jrhc-scope .jrhc-radio { display: block; font-weight: 400; margin: 4px 0; }
.jrhc-actions { display: flex; align-items: center; gap: 12px; margin-top: 6px; }

/* ---- Filters / list ---- */
.jrhc-list__head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.jrhc-list__head h3 { margin: 0; }
.jrhc-subhead { margin: 22px 0 8px; }
.jrhc-filters { display: flex; flex-wrap: wrap; gap: 6px; margin: 12px 0; }
.jrhc-filter { padding: 5px 12px; border-radius: 20px; background: #f0f3f9; color: #3a4358; text-decoration: none; font-size: 13px; }
.jrhc-filter.is-active { background: #5277ba; color: #fff; }
.jrhc-empty { padding: 26px; text-align: center; color: #7a869c; background: #f8fafd; border-radius: 10px; }

.jrhc-table { border: 1px solid #e3e8f2; border-radius: 12px; overflow: hidden; }
.jrhc-tr { display: grid; grid-template-columns: 130px 1fr 130px 150px 90px 110px; gap: 8px; align-items: center; padding: 12px 14px; text-decoration: none; color: inherit; border-bottom: 1px solid #eef1f7; background: #fff; transition: background .12s; }
.jrhc-tr:last-child { border-bottom: none; }
.jrhc-tr:hover { background: #f6f8fc; }
.jrhc-td--ref { font-family: monospace; font-size: 13px; color: #5277ba; }
.jrhc-td--title { font-weight: 600; }
.jrhc-td--date { font-size: 13px; color: #7a869c; text-align: right; }
.jrhc-unread { display: inline-block; min-width: 20px; padding: 1px 6px; margin-left: 6px; border-radius: 10px; background: #e74c3c; color: #fff; font-size: 12px; text-align: center; }

/* ---- Badges ---- */
.jrhc-badge, .jrhc-prio { display: inline-block; padding: 3px 10px; border-radius: 12px; font-size: 12px; font-weight: 600; white-space: nowrap; }
.jrhc-badge--open, .jrhc-badge--waiting_for_admin { background: #eaf0fb; color: #41639c; }
.jrhc-badge--waiting_for_customer { background: #fdf3e3; color: #a9700e; }
.jrhc-badge--resolved { background: #e6f6ec; color: #1e8e4e; }
.jrhc-badge--closed { background: #eceff3; color: #67718a; }
.jrhc-prio--low { background: #eceff3; color: #67718a; }
.jrhc-prio--medium { background: #eaf0fb; color: #41639c; }
.jrhc-prio--high { background: #fdf3e3; color: #a9700e; }
.jrhc-prio--critical { background: #fceaea; color: #c0392b; }

/* ---- Pagination ---- */
.jrhc-pagination { display: flex; gap: 6px; margin-top: 14px; }
.jrhc-page { padding: 5px 11px; border-radius: 6px; background: #f0f3f9; color: #3a4358; text-decoration: none; font-size: 13px; }
.jrhc-page.is-active { background: #5277ba; color: #fff; }

/* ---- Detail / conversation ---- */
.jrhc-back { display: inline-block; margin-bottom: 12px; color: #5277ba; text-decoration: none; font-weight: 600; }
.jrhc-detail__head h3 { margin: 0 0 6px; }
.jrhc-meta { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 14px; }
.jrhc-ref { font-family: monospace; color: #5277ba; }
.jrhc-date { font-size: 13px; color: #7a869c; }
.jrhc-conv { display: flex; flex-direction: column; gap: 10px; margin: 14px 0; }
.jrhc-msg { max-width: 85%; background: #f4f6fb; border: 1px solid #e3e8f2; border-radius: 12px; padding: 12px 14px; }
.jrhc-msg--mine { align-self: flex-end; background: #eaf0fb; border-color: #cfdcf2; }
.jrhc-msg--staff { border-left: 3px solid #5277ba; }
.jrhc-msg--system { align-self: center; max-width: 100%; background: transparent; border: none; color: #8a94a8; font-size: 12.5px; font-style: italic; padding: 2px; }
.jrhc-msg__head { display: flex; justify-content: space-between; gap: 12px; margin-bottom: 5px; font-size: 12.5px; }
.jrhc-msg__who { font-weight: 700; color: #3a4358; }
.jrhc-msg--staff .jrhc-msg__who { color: #5277ba; }
.jrhc-msg__time { color: #98a1b4; }
.jrhc-msg__body p { margin: 0 0 8px; }
.jrhc-msg__body p:last-child { margin-bottom: 0; }
.jrhc-attachments { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.jrhc-file { font-size: 12.5px; padding: 3px 10px; border-radius: 8px; background: #fff; border: 1px solid #ccd6e8; color: #41639c; text-decoration: none; }
.jrhc-reply textarea { width: 100%; padding: 10px 12px; border: 1px solid #ccd6e8; border-radius: 10px; }
.jrhc-reply textarea:focus { outline: none; border-color: #5277ba; box-shadow: 0 0 0 3px rgba(82, 119, 186, .15); }

/* ---- Help Center page ---- */
.jrhc-hero { text-align: center; padding: 28px 16px 20px; }
.jrhc-hero h2 { margin: 0 0 16px; }
.jrhc-search { position: relative; max-width: 560px; margin: 0 auto; }
.jrhc-search input { width: 100%; padding: 12px 18px; border: 2px solid #5277ba; border-radius: 26px; font-size: 15px; }
.jrhc-search input:focus { outline: none; box-shadow: 0 0 0 4px rgba(82, 119, 186, .18); }
.jrhc-search__results { position: absolute; top: calc(100% + 6px); left: 0; right: 0; background: #fff; border: 1px solid #dde5f2; border-radius: 12px; box-shadow: 0 8px 24px rgba(30, 42, 70, .12); z-index: 40; overflow: hidden; text-align: left; }
.jrhc-search__item { display: block; padding: 11px 15px; text-decoration: none; color: inherit; border-bottom: 1px solid #f0f3f9; }
.jrhc-search__item:last-child { border-bottom: none; }
.jrhc-search__item:hover { background: #f6f8fc; }
.jrhc-search__item strong { display: block; color: #41639c; margin-bottom: 2px; }
.jrhc-search__item span { font-size: 12.5px; color: #7a869c; }
.jrhc-search__none { padding: 12px 15px; color: #7a869c; font-size: 13.5px; }
.jrhc-cats { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 14px; margin: 18px 0; }
.jrhc-cat { background: #fff; border: 1px solid #e3e8f2; border-radius: 12px; padding: 16px 18px; }
.jrhc-cat h4 { margin: 0 0 8px; color: #41639c; }
.jrhc-cat ul { margin: 0; padding: 0 0 0 18px; }
.jrhc-cat li { margin: 4px 0; }
.jrhc-cat a { color: #3a4358; text-decoration: none; }
.jrhc-cat a:hover { color: #5277ba; }
.jrhc-open-ticket { margin-top: 26px; }
.jrhc-mytickets-link a { color: #5277ba; font-weight: 600; text-decoration: none; }
.jrhc-article { background: #fff; border: 1px solid #e3e8f2; border-radius: 12px; padding: 22px 26px; }
.jrhc-article__q { color: #67718a; font-style: italic; }
.jrhc-article__cta { text-align: center; margin-top: 20px; }

/* ---- AI assistant ---- */
.jrhc-ai { max-width: 560px; margin: 12px auto 0; text-align: center; }
.jrhc-ai__ask { border-style: dashed; }
.jrhc-ai__answer { margin-top: 12px; padding: 16px 18px; text-align: left; background: #f6f8fc; border: 1px solid #cfdcf2; border-left: 4px solid #5277ba; border-radius: 12px; }
.jrhc-ai__text { white-space: normal; line-height: 1.6; }
.jrhc-ai__refs { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; padding-top: 10px; border-top: 1px solid #dde5f2; }
.jrhc-ai__loading { color: #5277ba; font-weight: 600; }

/* ---- Floating button + popup ---- */
.jrhc-fab { position: fixed; right: 22px; bottom: 22px; z-index: 9990; font-size: 15px; }
.jrhc-fab__btn { display: flex; align-items: center; gap: 8px; padding: 11px 18px; border: none; border-radius: 26px; background: #5277ba; color: #fff; font-weight: 700; cursor: pointer; box-shadow: 0 6px 18px rgba(30, 42, 70, .25); transition: background .15s, transform .15s; }
.jrhc-fab__btn:hover { background: #41639c; transform: translateY(-1px); }
.jrhc-fab__icon { display: inline-flex; align-items: center; justify-content: center; width: 22px; height: 22px; border-radius: 50%; background: rgba(255, 255, 255, .22); font-size: 14px; }
.jrhc-popup[hidden] { display: none !important; }
.jrhc-popup { position: fixed; right: 22px; bottom: 84px; width: 360px; max-width: calc(100vw - 32px); max-height: min(560px, calc(100vh - 120px)); display: flex; flex-direction: column; background: #fff; border: 1px solid #dde5f2; border-radius: 16px; box-shadow: 0 14px 40px rgba(30, 42, 70, .22); overflow: hidden; }
.jrhc-popup__head { display: flex; justify-content: space-between; align-items: center; padding: 13px 16px; background: #5277ba; color: #fff; }
.jrhc-popup__close { border: none; background: transparent; color: #fff; font-size: 22px; line-height: 1; cursor: pointer; }
.jrhc-popup__body { padding: 14px 16px; overflow-y: auto; }
.jrhc-popup__label { font-weight: 600; font-size: 13px; margin: 12px 0 6px; color: #3a4358; }
.jrhc-popup__all { display: block; margin-top: 10px; text-align: center; color: #5277ba; font-weight: 600; text-decoration: none; }
.jrhc-search--popup input { border-width: 1px; border-radius: 10px; padding: 10px 14px; }

/* ---- Responsive ---- */
@media (max-width: 760px) {
    .jrhc-tr { grid-template-columns: 1fr 90px; }
    .jrhc-tr .jrhc-td:nth-child(1), .jrhc-tr .jrhc-td:nth-child(3), .jrhc-tr .jrhc-td:nth-child(5), .jrhc-tr .jrhc-td:nth-child(6) { display: none; }
    .jrhc-row { flex-direction: column; gap: 0; }
    .jrhc-msg { max-width: 100%; }
}
