/* ==========================================================================
   JB NE IT Support: customer portal theme for osTicket 1.18.x
   Loaded AFTER theme.css via one line in include/client/header.inc.php.
   Nothing here edits osTicket core CSS, so it can be removed by deleting
   that one line.
   ========================================================================== */

:root {
  --jb-navy-950: #070d1f;
  --jb-navy-900: #0a1228;
  --jb-navy-800: #0f1c3a;
  --jb-navy-700: #16264d;
  --jb-blue-600: #2563eb;
  --jb-blue-500: #3b82f6;
  --jb-blue-100: #dbeafe;
  --jb-blue-50:  #eff6ff;
  --jb-ink:      #0f172a;
  --jb-ink-2:    #334155;
  --jb-muted:    #64748b;
  --jb-line:     #e2e8f0;
  --jb-surface:  #ffffff;
  --jb-surface-2:#f8fafc;
  --jb-green:    #16a34a;
  --jb-red:      #dc2626;
  --jb-amber:    #d97706;
  --jb-radius:   10px;
  --jb-shadow:   0 1px 2px rgba(15,23,42,.06), 0 8px 24px rgba(15,23,42,.08);
  --jb-font: Inter, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

/* ---------- Base ---------- */
html { scroll-behavior: smooth; }
body,
body input, body select, body textarea, body button {
  font-family: var(--jb-font);
}
html {
  background: var(--jb-navy-900);
  background-image:
    radial-gradient(1200px 500px at 15% -10%, rgba(37,99,235,.28), transparent 60%),
    linear-gradient(180deg, var(--jb-navy-900) 0, var(--jb-navy-950) 100%);
  background-attachment: fixed;
}
body {
  font-size: 15px;
  line-height: 1.55;
  color: var(--jb-ink);
  background: none;
  min-height: 100vh;
}
a, .link { color: var(--jb-blue-600); border-bottom: 0 !important; margin-bottom: 0; }
a:hover, .link:hover { color: #1d4ed8; text-decoration: underline; }
h1, h2, h3, h4 { color: var(--jb-ink); font-weight: 650; letter-spacing: -.01em; }
h1 { font-size: 30px; line-height: 1.2; }
h2, .subject { font-size: 20px; color: var(--jb-ink); }
h3 { font-size: 17px; }
hr { border-top: 1px solid var(--jb-line); }
.faded { color: var(--jb-muted); }

/* ---------- Page shell ---------- */
#container {
  width: auto;
  max-width: 1080px;
  margin: 32px auto 0;
  background: var(--jb-surface);
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 20px 60px rgba(0,0,0,.45);
}
#header {
  height: auto;
  min-height: 84px;
  padding: 14px 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-direction: row-reverse;
  background: var(--jb-surface);
  border-bottom: 1px solid var(--jb-line);
}
#header + .clear { height: 0; overflow: hidden; }
#header #logo { height: auto; display: block; }
#header #logo img { max-height: 56px; max-width: 320px; mix-blend-mode: multiply; }
#header .valign-helper { display: none; }
#header .pull-right { float: none; }
#header p {
  width: auto;
  margin: 0;
  padding: 0;
  font-size: 14px;
  color: var(--jb-muted);
}
#header p a { font-weight: 600; }

/* Warning / error bars across the top */
.error_bar, .warning_bar, .notice_bar {
  margin: 0; padding: 10px 28px; font-size: 14px; font-weight: 500;
}
.error_bar   { background: #fef2f2; color: #991b1b; border-bottom: 1px solid #fecaca; }
.warning_bar { background: #fffbeb; color: #92400e; border-bottom: 1px solid #fde68a; }
.notice_bar  { background: #f0fdf4; color: #166534; border-bottom: 1px solid #bbf7d0; }

/* ---------- Navigation ---------- */
#nav {
  margin: 0;
  padding: 10px 20px;
  height: auto;
  background: var(--jb-navy-800);
  border: 0;
  box-shadow: none;
  white-space: normal;
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}
#nav li { display: block; }
#nav li a {
  height: auto;
  line-height: 1.2;
  margin: 0;
  padding: 10px 16px;
  border-radius: 8px;
  color: #cbd5e1;
  font-weight: 500;
  font-size: 14px;
  background-image: none !important;
  text-decoration: none;
  transition: background .15s, color .15s;
}
#nav li a:hover { background: rgba(255,255,255,.08); color: #fff; text-decoration: none; }
#nav li a.active { background: var(--jb-blue-600); color: #fff; }
#container > hr { display: none; }

/* ---------- Content ---------- */
#content {
  margin: 0;
  padding: 32px 28px 40px;
  min-height: 380px;
}
#content > h1, #content > h2 { margin-bottom: 8px; }
#content p { margin: 0 0 1em; }

/* ---------- Landing page ---------- */
#landing_page { overflow: hidden; }
#landing_page h1 { font-size: 34px; margin-bottom: 12px; }
#landing_page h2, #landing_page h3 { margin-bottom: 8px; }
.main-content {
  width: auto;
  overflow: hidden;       /* sits beside the floated sidebar */
  padding-right: 8px;
}
.main-content .thread-body { color: var(--jb-ink-2); font-size: 16px; }

.search-form { padding: 0 0 18px; }
.search-form form { display: flex; gap: 8px; }
.searchbar .search,
.search-form .search {
  flex: 1;
  width: auto;
  padding: 12px 16px;
  border: 1px solid var(--jb-line);
  border-radius: var(--jb-radius);
  background: var(--jb-surface-2);
  box-shadow: none;
  font-size: 15px;
}
.search-form .search:focus { outline: 2px solid var(--jb-blue-500); background: #fff; }

.sidebar { width: 260px; margin: 0 0 20px 28px; }
.sidebar .front-page-button p { margin: 0 0 10px; }
.sidebar .content {
  padding: 18px;
  border: 1px solid var(--jb-line);
  border-radius: var(--jb-radius);
  background: var(--jb-surface-2);
  min-height: 0; margin: 0;
}
.sidebar section .header { font-weight: 650; color: var(--jb-ink); margin-bottom: 8px; }
.sidebar section div a { display: block; padding: 3px 0; font-size: 14px; }

/* Featured KB */
.featured-category {
  width: 49%;
  padding: 18px;
  margin: 8px 0;
  background: var(--jb-surface-2);
  border: 1px solid var(--jb-line);
  border-radius: var(--jb-radius);
}
.featured-category i { color: var(--jb-blue-500); text-shadow: none; }
.article-title a { font-weight: 600; }
.article-teaser { color: var(--jb-muted); height: auto; max-height: 3em; }

/* ---------- Buttons ---------- */
.button, .button:visited,
input[type=submit], input[type=reset], input[type=button], button[type=submit] {
  display: inline-block;
  max-width: none;
  padding: 11px 22px;
  font-family: var(--jb-font);
  font-size: 15px;
  font-weight: 600;
  line-height: 1.2;
  text-align: center;
  color: #fff;
  background: var(--jb-blue-600);
  border: 0;
  border-bottom: 0;
  border-radius: 8px;
  box-shadow: 0 1px 2px rgba(37,99,235,.35);
  text-shadow: none;
  text-decoration: none;
  -webkit-appearance: none;
  appearance: none;
  transition: background .15s, transform .05s, box-shadow .15s;
}
.button:hover, input[type=submit]:hover, button[type=submit]:hover {
  background: #1d4ed8; color: #fff; text-decoration: none;
  box-shadow: 0 4px 14px rgba(37,99,235,.35);
}
.button:active, input[type=submit]:active { top: 0; transform: translateY(1px); }
.blue.button, .blue.button:visited { background: var(--jb-blue-600); }
.blue.button:hover { background: #1d4ed8; }
.green.button, .green.button:visited {
  background: var(--jb-surface); color: var(--jb-ink);
  box-shadow: inset 0 0 0 1px var(--jb-line);
}
.green.button:hover { background: var(--jb-surface-2); color: var(--jb-ink); box-shadow: inset 0 0 0 1px #cbd5e1; }
input[type=reset], input[type=button] {
  background: var(--jb-surface); color: var(--jb-ink-2);
  box-shadow: inset 0 0 0 1px var(--jb-line);
}
input[type=reset]:hover, input[type=button]:hover {
  background: var(--jb-surface-2); color: var(--jb-ink); box-shadow: inset 0 0 0 1px #cbd5e1;
}
p.buttons { margin-top: 24px; }
p.buttons input { margin: 0 4px; }

.action-button {
  background: var(--jb-surface); background-image: none;
  border: 1px solid var(--jb-line); border-radius: 6px;
  color: var(--jb-ink-2) !important;
  line-height: 26px; padding: 0 10px; font-size: 13px;
}
.action-button:hover { background: var(--jb-surface-2); }

/* ---------- Forms ---------- */
#ticketForm, #clientLogin, #reply { font-size: 15px; }
#ticketForm > table, #ticketForm table { width: 100% !important; table-layout: auto; }
#ticketForm > table td { width: auto; }
#ticketForm > table td:first-child:not([colspan]) { width: 190px; }
#ticketForm table td { padding: 8px 6px; vertical-align: top; }
#ticketForm .form-header { margin-top: 18px; }
#ticketForm .form-header h3,
.form-header h3 {
  font-size: 17px; font-weight: 650; color: var(--jb-ink);
  padding-bottom: 8px; border-bottom: 1px solid var(--jb-line);
  margin-bottom: 4px;
}
.form-header em, #ticketForm td em { color: var(--jb-muted); font-size: 13px; }
label.required, span.required, td.required, th.required { font-weight: 600; color: var(--jb-ink); }

input[type=text], input[type=password], input[type=email], input[type=tel],
input[type=number], input[type=date], input[type=search], select, textarea,
#ticketForm div input, #ticketForm div textarea, #clientLogin div input {
  padding: 10px 12px;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  background: #fff;
  color: var(--jb-ink);
  font-size: 15px;
  max-width: 100%;
  box-sizing: border-box;
  transition: border-color .15s, box-shadow .15s;
}
select { padding: 9px 10px; }
input[type=text]:focus, input[type=password]:focus, input[type=email]:focus,
input[type=tel]:focus, select:focus, textarea:focus {
  outline: 0;
  border-color: var(--jb-blue-500);
  box-shadow: 0 0 0 3px rgba(59,130,246,.25);
}
#ticketForm input[type=text], #ticketForm select { min-width: 280px; }
#ticketForm td textarea, #clientLogin td textarea,
#ticketForm div textarea, #clientLogin div textarea,
#reply textarea { width: 100% !important; }
input[type=checkbox], input[type=radio] { accent-color: var(--jb-blue-600); }
.error, font.error { color: var(--jb-red); font-size: 13px; }
.error input, #ticketForm div.error input { border-color: var(--jb-red); }
#ticketForm td .captcha { background: transparent; width: auto; height: auto; }
.redactor-box, .redactor-layer, .redactor-editor {
  border-radius: 8px !important; max-width: 100%;
}
.redactor-box { border-color: #cbd5e1 !important; }

/* ---------- Sign-in card ---------- */
#clientLogin {
  display: flex; flex-wrap: wrap; gap: 24px;
  margin-top: 8px; padding: 28px;
  background: var(--jb-surface-2);
  border: 1px solid var(--jb-line);
  border-radius: 14px;
  box-shadow: none;
}
#clientLogin .login-box {
  flex: 1 1 280px; width: auto; display: block;
  box-shadow: none; padding: 0;
}
#clientLogin .instructions { flex: 1 1 240px; display: block; padding: 0; color: var(--jb-ink-2); }
#clientLogin input[type=text], #clientLogin input[type=password] {
  width: 100%; padding: 11px 12px; margin-bottom: 14px;
}
#clientLogin input[type=submit] { padding: 11px 22px; }
#clientLogin strong { color: var(--jb-ink); font-size: 14px; display: block; margin-bottom: 4px; }
.external-auth-box { border: 1px solid var(--jb-line); border-radius: 8px; background: #fff; }

/* ---------- Notices ---------- */
#msg_notice, #msg_warning, #msg_error, #msg_info,
.warning-banner, .error-banner, .notice-banner {
  height: auto; line-height: 1.5;
  padding: 12px 16px 12px 44px;
  margin-bottom: 20px;
  border: 1px solid; border-radius: var(--jb-radius);
  background-position: 14px 50%; background-repeat: no-repeat;
  font-weight: 500;
}
#msg_notice  { border-color: #bbf7d0; background-color: #f0fdf4; color: #166534; }
#msg_warning, .warning-banner { border-color: #fde68a; background-color: #fffbeb; color: #92400e; }
#msg_error   { border-color: #fecaca; background-color: #fef2f2; color: #991b1b; }
#msg_info    { padding-left: 16px; border-color: var(--jb-blue-100); background: var(--jb-blue-50); color: #1e40af; }

/* ---------- Ticket list and detail ---------- */
#ticketTable {
  width: 100%;
  border: 1px solid var(--jb-line);
  border-radius: var(--jb-radius);
  border-collapse: separate; border-spacing: 0;
  overflow: hidden;
}
#ticketTable caption {
  padding: 12px 16px; background: var(--jb-surface-2); color: var(--jb-ink);
  border: 1px solid var(--jb-line); border-bottom: 0;
  border-radius: var(--jb-radius) var(--jb-radius) 0 0; font-weight: 650;
}
#ticketTable th {
  height: auto; line-height: 1.3; padding: 10px 14px;
  background: var(--jb-surface-2); color: var(--jb-muted);
  font-size: 12px; font-weight: 650; text-transform: uppercase; letter-spacing: .04em;
  border: 0; border-bottom: 1px solid var(--jb-line);
}
#ticketTable th a { color: var(--jb-muted); }
#ticketTable td { padding: 12px 14px; border: 0; border-bottom: 1px solid var(--jb-line); }
#ticketTable tr.alt td { background: #fcfdff; }
#ticketTable tr:hover td { background: var(--jb-blue-50); }
#ticketTable tr:last-child td { border-bottom: 0; }

.infoTable, table.custom-data th { background: var(--jb-surface-2); }
.infoTable th { padding: 8px 12px; color: var(--jb-ink-2); }
#ticketInfo h1 { border-bottom: 1px solid var(--jb-line); padding-bottom: 12px; margin-bottom: 12px; font-size: 26px; }

.Icon { color: var(--jb-blue-600); }
.label { background: var(--jb-muted); border-radius: 999px; padding: 2px 8px; text-shadow: none; }
.label-bare { background: transparent; border: 1px solid var(--jb-line); color: var(--jb-muted); }

/* Conversation thread */
.thread-entry { margin-bottom: 18px; }
.thread-entry .header {
  padding: 10px 16px; border: 1px solid var(--jb-line);
  border-radius: var(--jb-radius) var(--jb-radius) 0 0;
}
.thread-entry.response .header { background: var(--jb-surface-2); }
.thread-entry.message .header  { background: var(--jb-blue-50); border-color: var(--jb-blue-100); }
.thread-entry .thread-body {
  border: 1px solid var(--jb-line); border-top: 0; border-bottom: 1px solid var(--jb-line);
  border-radius: 0 0 var(--jb-radius) var(--jb-radius); padding: 14px 16px;
}
.thread-entry.avatar .header:before, .thread-entry.avatar .header:after { display: none; }
.thread-entry > .avatar { border-radius: 50%; }
.thread-body .attachments { background: var(--jb-surface-2); border-radius: 0 0 8px 8px; }
#reply {
  padding: 20px; background: var(--jb-surface-2);
  border: 1px solid var(--jb-line); border-radius: var(--jb-radius);
}
#reply h2 { border-bottom: 1px solid var(--jb-line); }
#reply input[type=text], #reply #response_options textarea { border: 1px solid #cbd5e1; }

/* Pagination */
#pagination li a { padding: 6px 10px; border-radius: 6px; font-size: 13px; }
#pagination li a:hover { background: var(--jb-blue-50); color: var(--jb-blue-600); }
#pagination .active { padding: 6px 10px; border-radius: 6px; background: var(--jb-blue-600); color: #fff; }

/* Knowledge base */
#kb > li { background: none; border: 1px solid var(--jb-line); border-radius: var(--jb-radius); margin-bottom: 10px; }
#faq ol { border-top: 0; }
#faq ol li a { border-bottom: 1px solid var(--jb-line); background-image: none; padding-left: 8px; }
#faq ol li a:hover { background: var(--jb-blue-50); text-decoration: none; }
#kb-search #query, #kb-search #topic-id { width: auto; min-width: 220px; }

/* ---------- Footer ---------- */
#footer { padding: 24px 16px 40px; color: #94a3b8; font-size: 13px; }
#footer a { color: #94a3b8; }
#footer p { margin: 0 0 8px; }
#footer #poweredBy { opacity: .45; filter: invert(1) grayscale(1); margin-top: 6px; }
#footer #poweredBy:hover { opacity: .8; }

/* ---------- Loading overlay ---------- */
#loading { border-radius: 14px; }

/* ---------- Small screens ---------- */
@media (max-width: 820px) {
  #container { margin: 0; border-radius: 0; }
  #header { padding: 12px 16px; flex-direction: column-reverse; align-items: flex-start; gap: 8px; }
  #nav { padding: 8px 12px; }
  #content { padding: 24px 16px 32px; }
  .sidebar { float: none; width: auto; margin: 24px 0 0; }
  .main-content { padding-right: 0; }
  .featured-category { width: 100%; }
  #landing_page h1 { font-size: 28px; }
  #ticketForm table td { display: block; width: auto !important; padding: 4px 0; }
  #ticketForm input[type=text], #ticketForm select { min-width: 0; width: 100%; }
  #ticketTable { display: block; overflow-x: auto; }
}

@media print {
  body { background: #fff; }
  #container { box-shadow: none; max-width: none; margin: 0; }
}
