/* ==========================================================================
   SOLVO IT — Modern client-portal override for osTicket 1.17 / 1.18
   Load AFTER /assets/default/css/theme.css (see INSTALL.md).
   Pure CSS override: no markup or JS changes. Safe to remove at any time.
   ========================================================================== */

:root {
  --sv-brand: #2bb673;
  --sv-brand-600: #239c61;
  --sv-brand-700: #1d8151;
  --sv-brand-50: #eaf8f1;
  --sv-ring: rgba(43, 182, 115, .28);
  --sv-ink: #1f2a37;
  --sv-ink-2: #4b5563;
  --sv-muted: #6b7280;
  --sv-line: #e3e8ee;
  --sv-line-2: #d0d7e0;
  --sv-bg: #f2f5f7;
  --sv-card: #ffffff;
  --sv-danger: #d93f3f;
  --sv-radius: 10px;
  --sv-radius-lg: 16px;
  --sv-shadow: 0 1px 2px rgba(16, 24, 40, .04), 0 8px 28px rgba(16, 24, 40, .07);
  --sv-font: "Inter", "Segoe UI", system-ui, -apple-system, Roboto, "Helvetica Neue", Arial, sans-serif;
}

/* ---------- Base ---------------------------------------------------------- */
html { -webkit-font-smoothing: antialiased; background: var(--sv-bg); }
body {
  background: var(--sv-bg) !important;
  background-image: linear-gradient(180deg, #e6f4ec 0, var(--sv-bg) 320px) !important;
  background-repeat: no-repeat !important;
  min-height: 100vh;
  padding: 32px 0 0;
  box-sizing: border-box;
  font-size: 15px;
  line-height: 1.55;
  color: var(--sv-ink);
}
body, input, select, textarea, button { font-family: var(--sv-font); color: var(--sv-ink); }

a, .link { color: var(--sv-brand-700); transition: color .15s; }
a:hover, .link:hover { color: var(--sv-brand); border-bottom: 0; margin-bottom: 1px; text-decoration: underline; text-underline-offset: 2px; }

h1 { color: var(--sv-ink); font-size: 26px; font-weight: 700; letter-spacing: -.01em; line-height: 1.25; margin: 0 0 6px; }
h2 { color: var(--sv-ink); font-weight: 650; }
h3 { color: var(--sv-ink); text-transform: none; font-size: 17px; font-weight: 650; }
hr { border-top: 1px solid var(--sv-line); }
#content > p, #content > h1 + p { color: var(--sv-ink-2); }

/* Keep required asterisks visible and on-brand */
.error, span.error, font.error { color: var(--sv-danger); }

/* ---------- Page shell ---------------------------------------------------- */
#container {
  width: auto;
  max-width: 920px;
  margin: 0 auto;
  background: var(--sv-card);
  border-radius: var(--sv-radius-lg);
  box-shadow: var(--sv-shadow);
  border: 1px solid rgba(16, 24, 40, .05);
  box-sizing: border-box;
}

/* Header */
#header {
  height: auto;
  min-height: 64px;
  padding: 18px 32px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px 16px;
}
#header #logo { order: 1; float: none; height: auto; display: inline-flex; align-items: center; border: 0; }
#header #logo:hover { border: 0; text-decoration: none; }
#header #logo .valign-helper { display: none; }
#header #logo img { max-height: 52px; max-width: 260px; }
#header > .pull-right { order: 2; float: none; }
#header p { width: auto; padding: 0; margin: 0; color: var(--sv-muted); font-size: 14px; }
#header p:empty { display: none; }
#header p a { font-weight: 600; }
#container > .clear { display: none; }

/* Navigation -> modern tabs */
#nav {
  height: auto;
  margin: 0;
  padding: 0 24px;
  background: none;
  border-top: 0;
  border-bottom: 1px solid var(--sv-line);
  box-shadow: none;
  display: flex;
  gap: 4px;
  overflow-x: auto;
  scrollbar-width: none;
}
#nav::-webkit-scrollbar { display: none; }
#nav li { display: block; flex: 0 0 auto; }
#nav li a,
.rtl #nav li a {
  height: auto;
  line-height: 1.2;
  margin: 0;
  padding: 14px 14px 13px;
  border-radius: 0;
  background-image: none !important;
  background-color: transparent;
  color: var(--sv-ink-2);
  font-weight: 550;
  font-size: 14.5px;
  border-bottom: 2px solid transparent;
  transition: color .15s, border-color .15s, background-color .15s;
}
#nav li a:before {
  font-family: FontAwesome;
  font-weight: normal;
  display: inline-block;
  margin-right: 8px;
  opacity: .8;
}
.rtl #nav li a:before { margin-right: 0; margin-left: 8px; }
#nav li a.home:before    { content: "\f015"; }
#nav li a.kb:before      { content: "\f02d"; }
#nav li a.new:before     { content: "\f055"; }
#nav li a.status:before  { content: "\f046"; }
#nav li a.tickets:before { content: "\f145"; }
#nav li a:hover {
  background-color: transparent;
  color: var(--sv-ink);
  border-bottom-color: var(--sv-line-2);
  text-decoration: none;
  margin-bottom: 0;
}
#nav li a.active,
#nav li a.active:hover {
  background-color: transparent;
  color: var(--sv-brand-700);
  border-bottom-color: var(--sv-brand);
}
#nav li a.active:before { opacity: 1; }

/* Content */
#content { margin: 0; padding: 32px 40px 36px; min-height: 300px; }

/* Footer */
#footer { padding: 22px 16px 32px; color: var(--sv-muted); font-size: 13px; }
#footer a { color: var(--sv-muted); }
#footer p { margin: 0 0 8px; }
#footer #poweredBy { opacity: .55; border: 0; }
#footer #poweredBy:hover { opacity: .9; }

/* ---------- Buttons ------------------------------------------------------- */
#content input[type="submit"],
#content input[type="button"],
#content input[type="reset"],
#content button,
.button, .button:visited,
#clientLogin input[type="submit"],
#clientLogin .btn {
  -webkit-appearance: none;
  appearance: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 10px 20px;
  border-radius: 10px;
  border: 1px solid var(--sv-line-2);
  background: #fff;
  color: var(--sv-ink);
  font: 600 14.5px/1.2 var(--sv-font);
  text-shadow: none;
  box-shadow: 0 1px 2px rgba(16, 24, 40, .05);
  cursor: pointer;
  transition: background-color .15s, border-color .15s, box-shadow .15s, transform .05s;
  vertical-align: middle;
  max-width: none;
  top: auto;
}
#content input[type="button"]:hover,
#content input[type="reset"]:hover,
#content button:hover { background: #f6f8fa; border-color: #b9c2cd; }

/* Primary: submit buttons and the coloured stock buttons */
#content input[type="submit"],
#clientLogin input[type="submit"],
#clientLogin .btn,
.button, .button:visited,
.green.button, .green.button:visited,
.blue.button, .blue.button:visited {
  background: var(--sv-brand);
  border-color: var(--sv-brand);
  color: #fff;
}
#content input[type="submit"]:hover,
#clientLogin input[type="submit"]:hover,
.button:hover, .green.button:hover, .blue.button:hover {
  background: var(--sv-brand-600);
  border-color: var(--sv-brand-600);
  color: #fff;
  text-decoration: none;
  margin-bottom: 1px;
}
/* Secondary landing-page button is outlined */
.green.button, .green.button:visited {
  background: #fff;
  color: var(--sv-brand-700);
  border-color: var(--sv-brand);
}
.green.button:hover { background: var(--sv-brand-50); color: var(--sv-brand-700); }

#content input[type="submit"]:focus-visible,
#content input[type="button"]:focus-visible,
#content input[type="reset"]:focus-visible,
.button:focus-visible { outline: none; box-shadow: 0 0 0 4px var(--sv-ring); }
#content input[type="submit"]:active,
#content input[type="button"]:active,
#content input[type="reset"]:active,
.button:active { transform: translateY(1px); box-shadow: none; }

/* Do not restyle the rich-text editor's own controls */
#content .redactor-box button,
#content .redactor-toolbar a,
.redactor-dropdown a, .redactor-modal button {
  min-height: 0;
  box-shadow: none;
}

/* ---------- Form fields --------------------------------------------------- */
#content input[type="text"],
#content input[type="email"],
#content input[type="tel"],
#content input[type="password"],
#content input[type="number"],
#content input[type="url"],
#content input[type="search"],
#content input[type="date"],
#content input:not([type]),
#content select,
#content textarea:not(.redactor-source),
#clientLogin input[type="text"],
#clientLogin input[type="password"] {
  -webkit-appearance: none;
  appearance: none;
  box-sizing: border-box;
  display: block;
  width: 100%;
  max-width: 100%;
  min-height: 44px;
  margin: 0;
  padding: 10px 14px;
  font: 400 15px/1.4 var(--sv-font);
  color: var(--sv-ink);
  background-color: #fff;
  border: 1px solid var(--sv-line-2);
  border-radius: var(--sv-radius);
  box-shadow: 0 1px 2px rgba(16, 24, 40, .04);
  transition: border-color .15s, box-shadow .15s;
}
#content textarea:not(.redactor-source) { min-height: 120px; resize: vertical; }
#content input::placeholder,
#content textarea::placeholder { color: #9aa3af; }
#content input[type="text"]:hover,
#content input[type="email"]:hover,
#content input[type="tel"]:hover,
#content input[type="password"]:hover,
#content select:hover,
#content textarea:hover { border-color: #b9c2cd; }
#content input:focus,
#content select:focus,
#content textarea:focus,
#clientLogin input:focus {
  outline: none;
  border-color: var(--sv-brand) !important;
  box-shadow: 0 0 0 4px var(--sv-ring) !important;
}
/* Custom chevron for single selects */
#content select:not([multiple]) {
  padding-right: 40px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5l5 5 5-5' fill='none' stroke='%236b7280' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  cursor: pointer;
}
.rtl #content select:not([multiple]) { background-position: left 14px center; padding-right: 14px; padding-left: 40px; }
#content select[multiple] { min-height: 100px; padding: 6px; }
/* Checkboxes / radios keep native look, brand accent */
#content input[type="checkbox"], #content input[type="radio"] { accent-color: var(--sv-brand); width: 16px; height: 16px; vertical-align: -3px; }

/* Field error state set by osTicket */
#content .error input, #content .error select, #content .error textarea,
#ticketForm div.error input { border-color: var(--sv-danger); }

/* ---------- New-ticket form layout --------------------------------------- */
#ticketForm > table,
#ticketForm table[width] {
  width: 100% !important;
  table-layout: fixed;
}
#ticketForm > table td,
#ticketForm > table td + td { width: auto; }
#ticketForm > table td { padding: 0; }
#ticketForm > table td[style*="padding-top"] { padding-top: 0 !important; padding-bottom: 18px; }
/* Section dividers: replace the bare <hr> with a styled heading */
#ticketForm > table td > hr { display: none; }
#ticketForm > hr { margin: 8px 0 24px; border-top-color: var(--sv-line); }
#ticketForm .form-header {
  margin: 22px 0 18px !important;
  padding: 0 0 12px;
  border-bottom: 1px solid var(--sv-line);
}
#ticketForm > table > tbody:first-child .form-header { margin-top: 18px !important; }
#ticketForm .form-header h3,
#ticketForm .form-header > b {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 17px;
  font-weight: 650;
  color: var(--sv-ink);
  text-transform: none;
  margin: 0;
}
#ticketForm .form-header h3:before,
#ticketForm .form-header > b:before {
  content: "";
  width: 4px;
  height: 18px;
  border-radius: 4px;
  background: var(--sv-brand);
  flex: 0 0 auto;
}
#ticketForm .form-header > div { color: var(--sv-muted); font-size: 14px; margin: 4px 0 0 14px; }
#ticketForm .form-header > div:empty { display: none; }

/* Labels above inputs */
#ticketForm label,
#clientLogin label {
  display: block;
  font-weight: 400;
  color: var(--sv-ink);
  cursor: default;
}
#ticketForm label > span:first-child,
#ticketForm label > span.required {
  display: inline-block;
  font-size: 14px;
  font-weight: 600;
  color: var(--sv-ink-2);
  margin-bottom: 6px;
}
#ticketForm label > br:first-of-type { display: none; }
#ticketForm label > span:first-child + br + * { margin-top: 0; }
#ticketForm label > span:first-child { display: block; }
#ticketForm label .error { margin-left: 2px; font-weight: 700; }

/* Phone + extension on one row */
#ticketForm input[type="tel"] { display: inline-block !important; width: calc(100% - 140px) !important; vertical-align: middle; }
#ticketForm input[name$="-ext"] { display: inline-block !important; width: 88px !important; vertical-align: middle; margin-left: 4px !important; }

/* Help topic select + its trailing "*" */
#ticketForm #topicId { display: inline-block; margin-bottom: 6px !important; width: calc(100% - 22px); vertical-align: middle; font-weight: 500; }
#ticketForm #topicId + font.error { margin-left: 4px; font-weight: 700; vertical-align: middle; }

/* Buttons row */
#ticketForm p.buttons,
#ticketForm .buttons {
  display: flex;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 10px;
  margin: 8px 0 0;
  text-align: right !important;
}
#ticketForm p.buttons input[type="submit"] { order: 3; min-width: 150px; }
#ticketForm p.buttons input[type="reset"] { order: 2; }
#ticketForm p.buttons input[name="cancel"] { order: 1; border-color: transparent; box-shadow: none; color: var(--sv-muted); background: transparent; }
#ticketForm p.buttons input[name="cancel"]:hover { color: var(--sv-ink); background: #f3f4f6; }

/* ---------- File drop zones ---------------------------------------------- */
#content .filedrop { padding-bottom: 4px; }
#content .filedrop .dropzone {
  position: relative;
  border: 1.5px dashed #b8c4cf;
  border-radius: var(--sv-radius);
  background: #f8fafb;
  color: var(--sv-muted);
  padding: 18px 16px;
  text-align: center;
  font-size: 14px;
  transition: border-color .15s, background-color .15s;
}
#content .filedrop .dropzone:hover {
  border-color: var(--sv-brand);
  background: var(--sv-brand-50);
}
#content .filedrop .dropzone i.icon-upload {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px; height: 30px;
  margin-right: 8px;
  border-radius: 50%;
  background: #fff;
  color: var(--sv-brand);
  box-shadow: 0 1px 2px rgba(16, 24, 40, .08);
  font-size: 14px;
  vertical-align: middle;
}
#content .filedrop .dropzone a,
#content .filedrop .dropzone a.manual { color: var(--sv-brand-700); font-weight: 600; }
#content .filedrop .files:not(:empty) {
  border: 1px solid var(--sv-line-2);
  border-radius: var(--sv-radius) var(--sv-radius) 0 0;
  background: #fff;
  padding: 6px;
}
#content .filedrop .files:not(:empty) + .dropzone {
  border-top: 0;
  border-radius: 0 0 var(--sv-radius) var(--sv-radius);
  padding: 12px 16px;
}
#content .filedrop .files .file { border-radius: 8px; }
#content .filedrop .files .file:hover { background: #f4f6f8; }
#content .filedrop .progress-bar { background-color: var(--sv-brand); }

/* Attachment dropzone directly under the rich-text editor: join them */
#content .-redactor-container .filedrop .dropzone,
#content .-redactor-container + .filedrop .dropzone {
  border-top: 1px solid var(--sv-line);
  border-style: none solid solid;
  border-width: 0 1px 1px;
  border-color: var(--sv-line-2);
  border-radius: 0 0 var(--sv-radius) var(--sv-radius);
  background: #f8fafb;
  border-top: 1px dashed var(--sv-line-2);
  padding: 12px 16px;
}
#content .-redactor-container .filedrop .dropzone:hover { background: var(--sv-brand-50); border-color: var(--sv-brand); }
#content .-redactor-container .filedrop .files:not(:empty) { border-radius: 0; border-top: 0; }

/* ---------- Rich-text editor (Redactor) — frame only, toolbar untouched -- */
#content .redactor-box.redactor-styles-on {
  border: 1px solid var(--sv-line-2);
  border-radius: var(--sv-radius) var(--sv-radius) 0 0;
  box-shadow: 0 1px 2px rgba(16, 24, 40, .04);
}
#content .redactor-box .redactor-toolbar-wrapper,
#content .redactor-box .redactor-toolbar {
  background: #f8fafb;
  border-radius: var(--sv-radius) var(--sv-radius) 0 0;
}
#content .redactor-box .redactor-toolbar { border-bottom: 1px solid var(--sv-line); padding: 2px 4px; }
#content .redactor-box .redactor-toolbar a { color: var(--sv-ink-2); background: transparent; border-radius: 6px; }
#content .redactor-box .redactor-toolbar a:hover { background: #eaeef2; color: var(--sv-ink); text-decoration: none; }
#content .redactor-box .redactor-styles { padding: 14px 16px; font-family: var(--sv-font); font-size: 15px; color: var(--sv-ink); }
#content .redactor-focus.redactor-styles-on,
#content .redactor-box.redactor-focus {
  border-color: var(--sv-brand) !important;
  box-shadow: 0 0 0 4px var(--sv-ring);
}

/* ---------- Landing page -------------------------------------------------- */
#landing_page { display: grid; grid-template-columns: minmax(0, 1fr) 240px; column-gap: 32px; row-gap: 0; align-items: start; }
#landing_page > .sidebar { float: none; width: auto; margin: 0; grid-column: 2; grid-row: 1; }
#landing_page > .main-content { width: auto; grid-column: 1; grid-row: 1; min-width: 0; }
#landing_page > :not(.sidebar):not(.main-content) { grid-column: 1 / -1; }
#landing_page > .clear { display: none; }
#landing_page .main-content .thread-body { padding: 0; margin: 0; border: 0; background: none; font-family: var(--sv-font); }
#landing_page .main-content h1 { font: 700 28px/1.25 var(--sv-font); color: var(--sv-ink); letter-spacing: -.01em; margin: 0 0 12px; }
#landing_page .main-content p { color: var(--sv-ink-2); font-size: 15.5px; line-height: 1.7; margin: 0; }
#landing_page .front-page-button { text-align: left; background: #f8fafb; border: 1px solid var(--sv-line); border-radius: 14px; padding: 16px; }
#landing_page .front-page-button p { margin: 0; }
#landing_page .front-page-button p + p { margin-top: 10px; }
#landing_page .front-page-button .button { display: flex !important; width: 100%; box-sizing: border-box; padding: 12px 16px; font-size: 15px; }
#landing_page .front-page-button .button:before { font-family: FontAwesome; font-weight: normal; margin-right: 8px; }
#landing_page .front-page-button .blue.button:before { content: "\f055"; }
#landing_page .front-page-button .green.button:before { content: "\f046"; }
.sidebar .content { border: 1px solid var(--sv-line); background: #f8fafb; border-radius: 12px; padding: 14px; }
.thread-body { line-height: 1.65; }

/* ---------- Sign-in / Check status --------------------------------------- */
#clientLogin {
  margin-top: 24px;
  padding: 28px;
  background: #fff !important;
  border: 1px solid var(--sv-line);
  border-radius: 14px;
  box-shadow: 0 1px 2px rgba(16, 24, 40, .04);
}
#clientLogin > div[style*="table-row"] { display: flex !important; gap: 32px; align-items: stretch; flex-wrap: wrap; }
#clientLogin .login-box {
  display: block;
  flex: 1 1 300px;
  width: auto;
  max-width: 420px;
  padding: 0;
  box-shadow: none;
}
#clientLogin .login-box > div { margin-bottom: 14px; }
#clientLogin .login-box label { font-size: 14px; font-weight: 600; color: var(--sv-ink-2); }
#clientLogin .login-box label input { margin-top: 6px; font-weight: 400; }
#clientLogin input[type="text"],
#clientLogin input[type="password"] { margin-bottom: 0; }
#clientLogin .login-box p { margin: 6px 0 0; }
#clientLogin .login-box input[type="submit"] { width: 100%; }
#clientLogin strong { color: var(--sv-danger); font-size: 13px; }
#clientLogin strong:empty, #clientLogin .login-box > div:has(> strong:empty) { display: none; margin: 0; }
#clientLogin .instructions,
#clientLogin > div > div[style*="table-cell"] {
  display: block !important;
  flex: 1 1 220px;
  padding: 20px !important;
  border-radius: 12px;
  background: var(--sv-brand-50);
  color: var(--sv-ink-2);
  line-height: 1.6;
  align-self: flex-start;
}
#clientLogin .instructions a,
#clientLogin > div > div[style*="table-cell"] a { font-weight: 600; }
#clientLogin + br { display: none; }
#clientLogin ~ p { margin-top: 20px; color: var(--sv-muted); font-size: 14px; }

/* ---------- Alerts -------------------------------------------------------- */
#msg_notice, #msg_warning, #msg_error, #msg_info,
.notice_bar, .warning_bar, .error_bar, .info_bar {
  height: auto;
  line-height: 1.45;
  margin: 0 0 20px;
  padding: 12px 16px 12px 44px;
  border-radius: var(--sv-radius);
  border: 1px solid;
  background-image: none !important;
  position: relative;
  font-size: 14.5px;
}
#msg_notice:before, #msg_warning:before, #msg_error:before, #msg_info:before,
.notice_bar:before, .warning_bar:before, .error_bar:before, .info_bar:before {
  font-family: FontAwesome;
  position: absolute;
  left: 16px;
  top: 12px;
}
#msg_notice, .notice_bar { background-color: #ecfdf3; border-color: #a6e9c4; color: #146c43; }
#msg_notice:before, .notice_bar:before { content: "\f058"; }
#msg_warning, .warning_bar { background-color: #fffaeb; border-color: #fedf89; color: #8a5a00; }
#msg_warning:before, .warning_bar:before { content: "\f071"; }
#msg_error, .error_bar { background-color: #fef3f2; border-color: #fecdca; color: #b42318; }
#msg_error:before, .error_bar:before { content: "\f06a"; }
#msg_info, .info_bar { background-color: #eff8ff; border-color: #b2ddff; color: #175cd3; }
#msg_info:before, .info_bar:before { content: "\f05a"; }

/* ---------- My tickets list (tickets.php) -------------------------------- */
.search.well {
  margin: 0 0 16px;
  padding: 14px;
  background: #f8fafb;
  border: 1px solid var(--sv-line);
  border-radius: 12px;
}
.search.well input[type="text"], .search.well select { display: inline-block !important; width: auto !important; min-width: 180px; vertical-align: middle; }
#ticketTable {
  width: 100%;
  border: 1px solid var(--sv-line) !important;
  border-collapse: separate;
  border-spacing: 0;
  border-radius: 12px;
  overflow: hidden;
  font-size: 14.5px;
}
#ticketTable caption { background: none; border: 0; padding: 0 0 10px; font-size: 16px; font-weight: 650; color: var(--sv-ink); }
#ticketTable th {
  background: #f8fafb;
  border: 0;
  border-bottom: 1px solid var(--sv-line);
  color: var(--sv-muted);
  font-size: 12.5px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .03em;
  height: auto;
  line-height: 1.3;
  padding: 12px 14px;
}
#ticketTable th a { color: var(--sv-muted); }
#ticketTable td { border: 0; border-bottom: 1px solid var(--sv-line); padding: 12px 14px; vertical-align: top; }
#ticketTable tr:last-child td { border-bottom: 0; }
#ticketTable tr.alt td { background: #fcfdfd; }
#ticketTable tbody tr:hover td { background: var(--sv-brand-50); }
.Icon { color: var(--sv-brand-700); }

/* ---------- Ticket view (tickets.php?id=…) ------------------------------- */
#ticketInfo { width: 100% !important; }
#ticketInfo h1 { border-bottom: 1px solid var(--sv-line); padding-bottom: 12px; margin-bottom: 14px; }
#ticketInfo h1 small { color: var(--sv-muted); font-size: 15px; }
.infoTable {
  background: #f8fafb;
  border: 1px solid var(--sv-line);
  border-radius: 12px;
  border-collapse: separate;
  padding: 8px 6px;
  margin-bottom: 14px;
}
.infoTable .headline { background: transparent; font-weight: 650; padding: 6px 10px 8px; border-bottom: 1px solid var(--sv-line); }
.infoTable th { color: var(--sv-muted); font-weight: 600; padding: 4px 10px; }
.infoTable td { padding: 4px 10px; }
#ticketThread { border-bottom: 0; }
#ticketThread::before { border-left: 2px solid var(--sv-line); }
.thread-entry .header {
  border: 1px solid var(--sv-line);
  border-radius: 12px 12px 0 0;
  padding: 10px 14px;
  font-size: 14px;
}
.thread-entry.message .header { background: var(--sv-brand-50); border-color: #c7ebd7; }
.thread-entry.response .header { background: #f3f5f8; }
.thread-entry.avatar.message .header:before { border-right-color: #c7ebd7; }
.thread-entry.avatar.message .header:after { border-right-color: var(--sv-brand-50); }
.thread-entry.avatar.response .header:before { border-left-color: var(--sv-line); }
.thread-entry.avatar.response .header:after { border-left-color: #f3f5f8; }
.thread-entry .thread-body {
  font-family: var(--sv-font);
  padding: 14px 16px;
  border: 1px solid var(--sv-line);
  border-top: 0;
  border-radius: 0 0 12px 12px;
  background: #fff;
  box-shadow: 0 1px 2px rgba(16, 24, 40, .04);
}
.thread-entry > .avatar, img.avatar { border-radius: 50%; }
.thread-body .attachments { background: #f8fafb; border-top: 1px solid var(--sv-line); border-radius: 0 0 12px 12px; }
.thread-event .type-icon { border-radius: 50%; background: #fff; border-color: var(--sv-line); }
.label { border-radius: 999px; padding: 2px 8px; text-shadow: none; }
#reply {
  margin-top: 16px;
  padding: 20px;
  background: #f8fafb;
  border: 1px solid var(--sv-line);
  border-radius: 14px;
}
#reply h2 { border-bottom: 1px solid var(--sv-line); font-size: 18px; }
#reply > table { width: 100%; }
#reply textarea { width: 100% !important; }
.action-button {
  background: #fff;
  background-image: none;
  border: 1px solid var(--sv-line-2);
  border-radius: 8px;
  color: var(--sv-ink-2) !important;
  font-size: 13px;
  line-height: 30px;
  padding: 0 10px;
}
.action-button:hover { background: #f6f8fa; text-decoration: none; }
.action-button span, .action-button a { color: var(--sv-ink-2) !important; }

/* ---------- Loading dialog ------------------------------------------------ */
#loading { border: 0; border-radius: 14px; box-shadow: var(--sv-shadow); }
#loading h4 { color: var(--sv-brand-700); }

/* ---------- Responsive ---------------------------------------------------- */
@media (max-width: 960px) {
  body { padding: 16px 16px 0; }
}
@media (max-width: 640px) {
  body { font-size: 15px; background-image: none !important; padding: 0; }
  #container { margin: 0; border-radius: 0; border: 0; box-shadow: none; }
  #header { padding: 14px 18px 10px; }
  #header #logo img { max-height: 40px; max-width: 180px; }
  #header p { font-size: 13px; }
  #nav { padding: 0 8px; }
  #nav { white-space: normal; gap: 0; }
  #nav li { flex: 1 1 0; min-width: 0; }
  #nav li a { display: flex; align-items: center; justify-content: center; text-align: center; height: 100%; box-sizing: border-box; padding: 11px 6px 10px; font-size: 13.5px; line-height: 1.25; }
  #nav li a:before { margin-right: 6px; }
  #content { padding: 22px 18px 28px; }
  h1 { font-size: 22px; }
  #ticketForm p.buttons { justify-content: stretch; }
  #ticketForm p.buttons input { flex: 1 1 auto; }
  #ticketForm p.buttons input[type="submit"] { flex-basis: 100%; order: -1; }
  #ticketForm p.buttons input[name="cancel"] { border-color: var(--sv-line-2); }
  #ticketForm input[type="tel"] { width: calc(100% - 120px) !important; }
  #ticketForm input[name$="-ext"] { width: 72px !important; }
  #landing_page { grid-template-columns: minmax(0, 1fr); row-gap: 20px; }
  #landing_page > .sidebar { grid-column: 1; grid-row: 2; }
  #clientLogin { padding: 18px; }
  #clientLogin > div[style*="table-row"] { gap: 18px; }
  #clientLogin .login-box { max-width: none; }
  #ticketTable { display: block; overflow-x: auto; }
  .thread-entry.avatar, .thread-entry.response.avatar { margin-left: 0; margin-right: 0; }
  .thread-entry > .avatar { display: none; }
  .thread-entry.avatar .header:before, .thread-entry.avatar .header:after { display: none; }
  #ticketInfo, #ticketInfo > tbody, #ticketInfo > tbody > tr, #ticketInfo > tbody > tr > td { display: block; width: 100% !important; box-sizing: border-box; }
  #ticketInfo .infoTable { width: 100% !important; margin-bottom: 10px; }
  #ticketInfo h1 .pull-right { float: none; margin-top: 8px; }
  .thread-event { margin-left: 0; }
  #ticketThread::before { display: none; }
  #reply { padding: 14px; }
  #footer { padding: 18px 12px 24px; }
}
@media (max-width: 420px) {
  #nav li a:before { display: none; }
}

/* ---- v2 fixes ---- */
/* Hide "powered by osTicket" logo */
#poweredBy { display: none !important; }

/* osTicket JS sets inline red text on submit buttons when a form changes; keep it white */
input[type=submit], button[type=submit], .button[type=submit] { color: #fff !important; }

/* Registration page polish */
#clientRegistration label, #clientRegistration td label,
form table td.required, form table td label { font-weight: 600; }
.select2-container { min-width: 260px; }
.select2-container .select2-selection--single { height: 42px; border-radius: 8px; border: 1px solid #d0d7de; }
.select2-container .select2-selection--single .select2-selection__rendered { line-height: 40px; padding-left: 12px; }
.select2-container .select2-selection--single .select2-selection__arrow { height: 40px; }
input[type=button], button.action-button { border-radius: 8px; }

/* ---- v3: modern Help Topic dropdown (select2) ---- */
#topicId + .select2-container .select2-selection--single {
  height: 46px; border: 1px solid #d0d7de; border-radius: 10px; background: #fff;
  box-shadow: 0 1px 2px rgba(16,24,40,.05); transition: border-color .15s, box-shadow .15s;
}
#topicId + .select2-container .select2-selection__rendered { line-height: 44px !important; padding-left: 14px !important; font-size: 15px; color: #1f2937; }
#topicId + .select2-container .select2-selection__arrow { height: 44px !important; right: 10px !important; }
#topicId + .select2-container--open .select2-selection--single,
#topicId + .select2-container--focus .select2-selection--single { border-color: #22b573; box-shadow: 0 0 0 4px rgba(34,181,115,.15); }
.solvo-topic-dd .select2-dropdown { border: 1px solid #e5e7eb !important; border-radius: 12px !important; box-shadow: 0 12px 32px rgba(16,24,40,.14); overflow: hidden; margin-top: 6px; }
.solvo-topic-dd .select2-results__options { max-height: 440px !important; padding: 6px; }
.solvo-topic-dd .select2-results__option { padding: 10px 12px; border-radius: 8px; font-size: 15px; color: #1f2937; }
.solvo-topic-dd .select2-results__option--highlighted[aria-selected] { background: #e8f8f0 !important; color: #127a4b !important; }
.solvo-topic-dd .select2-results__option[aria-selected=true] { background: #22b573; color: #fff; font-weight: 600; }
.solvo-topic-dd .select2-results__option:first-child[aria-disabled], .solvo-topic-dd .select2-results__option[id$="-"] { display: none; }
.solvo-topic-dd .select2-search__field { border: 1px solid #d0d7de !important; border-radius: 8px; padding: 8px 10px; }
/* Fallback styling for the native select if JS is off */
select#topicId { height: 46px; border-radius: 10px; padding: 0 14px; font-size: 15px; }
#topicId + .select2-container { display: inline-block !important; vertical-align: middle; margin-bottom: 6px; }
#topicId + .select2-container + font.error, #topicId ~ font.error { margin-left: 4px; vertical-align: middle; }

/* ---- v5: all select2 dropdowns (single + multi), PHI notice, topic asterisk ---- */
#ticketForm .select2-container, #clientRegistration .select2-container { width: 100% !important; max-width: 100%; }
#topicId + .select2-container { width: 100% !important; }
#topicId ~ font.error.sv-moved { display: block; margin: 6px 0 0 !important; font-size: 13px; }
.sv-req { color: var(--sv-danger); margin-left: 3px; font-weight: 700; }

/* Closed boxes */
.select2-container--default .select2-selection--single,
.select2-container--default .select2-selection--multiple {
  min-height: 46px; border: 1px solid var(--sv-line-2) !important; border-radius: var(--sv-radius) !important;
  background: #fff; box-shadow: 0 1px 2px rgba(16,24,40,.05); transition: border-color .15s, box-shadow .15s; cursor: pointer;
}
.select2-container--default .select2-selection--single { height: 46px !important; }
.select2-container--default .select2-selection--single .select2-selection__rendered { line-height: 44px !important; padding-left: 14px !important; color: var(--sv-ink); }
.select2-container--default .select2-selection--single .select2-selection__placeholder { color: var(--sv-muted); }
.select2-container--default .select2-selection--single .select2-selection__arrow { height: 44px !important; right: 10px !important; }
.select2-container--default.select2-container--focus .select2-selection--multiple,
.select2-container--default.select2-container--focus .select2-selection--single,
.select2-container--default.select2-container--open .select2-selection--multiple,
.select2-container--default.select2-container--open .select2-selection--single {
  border-color: var(--sv-brand) !important; box-shadow: 0 0 0 4px var(--sv-ring) !important; outline: 0;
}
/* Multi-select: one clean box, no nested input box */
.select2-container--default .select2-selection--multiple { padding: 4px 8px !important; }
.select2-container--default .select2-selection--multiple .select2-selection__rendered { display: flex !important; flex-wrap: wrap; align-items: center; gap: 6px; padding: 0 !important; margin: 0; }
.select2-container--default .select2-selection--multiple .select2-search--inline { flex: 1 1 160px; margin: 0; }
.select2-container .select2-selection--multiple .select2-search__field,
#content .select2-selection--multiple input.select2-search__field {
  border: 0 !important; box-shadow: none !important; outline: 0 !important; background: transparent !important;
  margin: 0 !important; padding: 0 6px !important; height: 36px !important; min-height: 0 !important; width: 100% !important;
  font-size: 15px; border-radius: 0 !important;
}
.select2-container .select2-selection--multiple .select2-search__field::placeholder { color: var(--sv-muted); }
.select2-container--default .select2-selection--multiple .select2-selection__choice {
  margin: 0 !important; padding: 4px 10px 4px 8px; border: 1px solid #bfe8d3 !important; background: var(--sv-brand-50) !important;
  color: var(--sv-brand-700); border-radius: 999px !important; font-size: 13.5px; font-weight: 600; line-height: 1.4;
}
.select2-container--default .select2-selection--multiple .select2-selection__choice__remove { color: var(--sv-brand-700) !important; margin-right: 6px; font-weight: 700; }
.select2-container--default .select2-selection--multiple .select2-selection__choice__remove:hover { color: var(--sv-danger) !important; }
.select2-container--default .select2-selection--multiple .select2-selection__clear { margin: 0 6px 0 auto; color: var(--sv-muted); }

/* Open lists (all select2 dropdowns) */
.select2-container--default .select2-dropdown {
  border: 1px solid var(--sv-line) !important; border-radius: 12px !important; overflow: hidden;
  box-shadow: 0 12px 32px rgba(16,24,40,.14); background: #fff;
}
.select2-container--default .select2-dropdown--below { margin-top: 6px; }
.select2-container--default .select2-dropdown--above { margin-top: -6px; }
.select2-container--default .select2-results > .select2-results__options { max-height: 320px; padding: 6px; }
.solvo-topic-dd .select2-results > .select2-results__options { max-height: 440px; }
.select2-container--default .select2-results__option { padding: 10px 12px; border-radius: 8px; font-size: 15px; color: var(--sv-ink); margin: 1px 0; }
.select2-container--default .select2-results__option--highlighted[aria-selected],
.select2-container--default .select2-results__option--highlighted.select2-results__option--selectable {
  background: var(--sv-brand-50) !important; color: var(--sv-brand-700) !important;
}
.select2-container--default .select2-results__option[aria-selected=true] { background: #f3f4f6; color: var(--sv-ink-2); font-weight: 600; }
.select2-container--default .select2-results__option[aria-selected=true]::after { content: "\2713"; float: right; color: var(--sv-brand); }
.select2-container--default .select2-search--dropdown { padding: 8px; }
.select2-container--default .select2-search--dropdown .select2-search__field { border: 1px solid var(--sv-line-2) !important; border-radius: 8px !important; padding: 8px 10px !important; height: auto !important; }
.select2-results__options::-webkit-scrollbar { width: 8px; }
.select2-results__options::-webkit-scrollbar-thumb { background: #d1d5db; border-radius: 8px; }

/* PHI disclaimer: tidy callout instead of red monospace */
#dynamic-form .thread-body.bleed {
  background: #fff8eb; border: 1px solid #f5d9a8; border-left: 4px solid #e8a33d; border-radius: var(--sv-radius);
  padding: 14px 16px !important; margin: 4px 0;
}
#dynamic-form .thread-body.bleed h3 { font-family: var(--sv-font) !important; font-size: 15px !important; font-weight: 700; color: #92400e; margin: 0 0 4px !important; }
#dynamic-form .thread-body.bleed h3::before { content: "\26A0\FE0E  "; }
#dynamic-form .thread-body.bleed p, #dynamic-form .thread-body.bleed p * {
  font-family: var(--sv-font) !important; font-size: 14px !important; color: #7c4a0b !important; font-weight: 500 !important; line-height: 1.5;
}
#dynamic-form .thread-body.bleed p { margin: 0; }
#ticketForm tr.sv-blank-section { display: none; }

/* ---- v6: plain dropdowns, editor-only boxes, stray tooltips ---- */
/* Editors without an attachment zone below (e.g. "Additional Details"): fully rounded */
#content .-redactor-container:not(:has(.filedrop)):not(:has(+ .filedrop)) .redactor-box.redactor-styles-on,
#content .-redactor-container:not(:has(.filedrop)):not(:has(+ .filedrop)) .redactor-box { border-radius: var(--sv-radius) !important; overflow: hidden; }
#content .redactor-box .redactor-styles, #content .redactor-box .redactor-in { min-height: 110px; }
#content .redactor-box .redactor-air { border-radius: 8px; }
/* Redactor button tooltips get stranded when the form reloads; hide them */
.re-button-tooltip { display: none !important; }
/* Single dropdowns converted by solvoit-topic.js */
#ticketForm .sv-s2 + .select2-container { width: 100% !important; }
