/* =====================================================================
   IEP osTicket theme — CLIENT PORTAL (osTicket 1.18)
   Loaded after assets/default/css/theme.css; overrides only.
   ===================================================================== */

/* ---------- Base ---------- */
html, body {
  background: var(--iep-bg) !important;
  color: var(--iep-text);
  font-family: var(--iep-font);
}
body, input, select, textarea, button, .button {
  font-family: var(--iep-font);
}
a { color: var(--iep-brand); }
a:hover { color: var(--iep-brand-dark); }

h1, h2, h3 { color: var(--iep-text); font-weight: 600; letter-spacing: -.01em; }
#content h1 { font-size: 26px; margin-top: 0; }
#content > h1, #content form h1, #content .main-content h1 { color: var(--iep-brand); }

/* ---------- Page frame ---------- */
#container {
  width: 960px;
  max-width: calc(100% - 32px);
  margin: 28px auto 0;
  background: var(--iep-surface);
  border-radius: var(--iep-radius);
  box-shadow: var(--iep-shadow);
  border: 1px solid var(--iep-border);
}

/* ---------- Header ---------- */
#header {
  height: 84px;
  padding: 0 28px;
  border-top: 4px solid var(--iep-brand);
  border-radius: var(--iep-radius) var(--iep-radius) 0 0;
  background: var(--iep-surface);
}
#header #logo img { max-height: 60px; }
#header p {
  padding-top: 18px;
  font-size: 14px;
  color: var(--iep-muted);
}
#header p a { font-weight: 600; }

/* ---------- Main navigation ---------- */
#nav {
  margin: 0;
  padding: 0 18px;
  height: auto;
  background: var(--iep-brand);
  border: 0;
  box-shadow: none;
  /* long menu labels (e.g. Greek) wrap onto a second line instead of leaving the page */
  display: flex;
  flex-wrap: wrap;
  white-space: normal;
}
#nav li { display: block; }
#nav li a,
.rtl #nav li a {
  height: 48px;
  line-height: 48px;
  margin: 0;
  padding: 0 14px;
  color: rgba(255,255,255,.86);
  font-size: 14.5px;
  white-space: nowrap;
  font-weight: 500;
  border-radius: 0;
  background-image: none !important;
  background-color: transparent;
  border-bottom: 3px solid transparent;
  box-sizing: border-box;
  transition: background-color .15s, color .15s;
}
#nav li a:before {
  font-family: FontAwesome;
  font-weight: normal;
  margin-right: 8px;
  opacity: .9;
}
.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: "\f002"; }
#nav li a.tickets:before { content: "\f0f6"; }

#nav li a:hover {
  background-color: rgba(255,255,255,.10);
  color: #fff;
  text-decoration: none;
}
#nav li a.active {
  background-color: rgba(255,255,255,.08);
  color: #fff;
  border-bottom-color: var(--iep-accent);
}
/* the <hr> shown instead of the nav on some pages */
#container > hr { border: 0; height: 4px; margin: 0; background: var(--iep-brand); }

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

/* ---------- Buttons ---------- */
.button, .button:visited,
input[type=submit], input[type=button], input[type=reset],
#content button {
  display: inline-block;
  font-size: 15px;
  font-weight: 600;
  line-height: 1.2;
  padding: 10px 20px;
  border: 1px solid transparent;
  border-radius: 6px;
  box-shadow: none;
  text-shadow: none;
  cursor: pointer;
  transition: background-color .15s, border-color .15s, box-shadow .15s;
}
input[type=submit], .button, .button:visited,
.blue.button, .blue.button:visited {
  background: var(--iep-brand);
  color: #fff;
}
input[type=submit]:hover, .button:hover,
.blue.button:hover {
  background: var(--iep-brand-dark);
  color: #fff;
  text-decoration: none;
}
.green.button, .green.button:visited {
  background: var(--iep-secondary);
  color: #fff;
}
.green.button:hover { background: var(--iep-secondary-dark); }
input[type=reset], input[type=button] {
  background: #fff;
  color: var(--iep-text);
  border-color: var(--iep-border);
}
input[type=reset]:hover, input[type=button]:hover {
  background: var(--iep-brand-light);
  border-color: var(--iep-brand);
}
.button:active, input[type=submit]:active { top: 1px; }
.button:focus-visible, input[type=submit]:focus-visible,
input[type=reset]:focus-visible, input[type=button]:focus-visible {
  outline: 3px solid rgba(29,79,145,.35);
  outline-offset: 2px;
}

/* osTicket's "#clientLogin div input {background:#fff}" would blank the buttons */
#clientLogin div input[type=submit], #ticketForm div input[type=submit] {
  background: var(--iep-brand); color: #fff; border-color: transparent; padding: 10px 20px;
}
#clientLogin div input[type=submit]:hover, #ticketForm div input[type=submit]:hover { background: var(--iep-brand-dark); }

/* ---------- 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=search],
#content select, #content textarea {
  font-size: 15px;
  padding: 8px 10px;
  border: 1px solid #c3ccd8;
  border-radius: 6px;
  background: #fff;
  color: var(--iep-text);
  box-sizing: border-box;
  max-width: 100%;
  transition: border-color .15s, box-shadow .15s;
}
#content select { padding: 7px 8px; }
#content input:focus, #content select:focus, #content textarea:focus {
  outline: none;
  border-color: var(--iep-brand);
  box-shadow: 0 0 0 3px rgba(29,79,145,.18);
}
#content label, #ticketForm label { font-weight: 600; }
#content .error, span.error, font.error { color: var(--iep-danger); }
#content .error input { border-color: var(--iep-danger); }
#content hr { border: 0; border-top: 1px solid var(--iep-border); margin: 22px 0; }

/* field rows on the ticket form */
#ticketForm td, .form-header + table td { padding-top: 4px; padding-bottom: 4px; }
#ticketForm .form-header h3,
#ticketForm td > div.form-header > h3,
.form-header h3 { color: var(--iep-brand); font-size: 18px; margin-bottom: 4px; }

/* rich-text editor & drop zone */
.redactor-box { border: 1px solid #c3ccd8 !important; border-radius: 6px; overflow: hidden; }
.redactor-toolbar { box-shadow: none !important; border-bottom: 1px solid var(--iep-border); }
.filedrop .dropzone {
  border: 2px dashed #c3ccd8 !important;
  border-radius: 6px;
  background: #fafbfd !important;
  color: var(--iep-muted);
}

/* ---------- Messages ---------- */
#msg_error, #msg_notice, #msg_warning,
.error_bar, .warning_bar, .notice_bar {
  border-radius: 6px;
  padding: 12px 14px 12px 42px;
  background-position: 14px 50%;
  font-size: 15px;
  margin-bottom: 20px;
}
#msg_error   { border: 1px solid #f1b5ae; background-color: #fdf0ee; color: #8a2318; }
#msg_notice  { border: 1px solid #a9d8cd; background-color: #ecf8f4; color: #1d5b4f; }
#msg_warning { border: 1px solid #f1d58d; background-color: var(--iep-warning-bg); color: #6b5200; }

/* ---------- Landing page ---------- */
#landing_page .main-content { width: 580px; }
#landing_page .main-content h1 { font-size: 28px; margin-bottom: 12px; }
#landing_page .main-content p { color: var(--iep-muted); font-size: 16px; }
#landing_page .sidebar {
  width: 280px;
  padding: 20px;
  background: var(--iep-brand-light);
  border-radius: var(--iep-radius);
  box-sizing: border-box;
}
.front-page-button p { margin: 0 0 12px; }
.front-page-button p:last-child { margin-bottom: 0; }
.front-page-button .button {
  max-width: none;
  padding: 13px 16px;
  font-size: 16px;
  line-height: 1.3;
  white-space: normal;          /* long labels (e.g. Greek) wrap instead of being cut */
  overflow-wrap: break-word;
  display: block !important;
  text-align: center;
  box-sizing: border-box;
}
.front-page-button .blue.button:before  { content: "\f055"; font-family: FontAwesome; font-weight: normal; margin-right: 8px; }
.front-page-button .green.button:before { content: "\f002"; font-family: FontAwesome; font-weight: normal; margin-right: 8px; }
#landing_page .sidebar .content { margin-top: 16px; }

/* featured KB / FAQ boxes */
.featured-category {
  border: 1px solid var(--iep-border);
  border-radius: var(--iep-radius);
  padding: 14px 16px;
  background: #fff;
  box-sizing: border-box;
}
.featured-category i { color: var(--iep-brand); }
#kb > li {
  border: 1px solid var(--iep-border);
  border-radius: var(--iep-radius);
  padding: 14px 16px;
  margin-bottom: 12px;
  background: #fff;
}
#kb > li > i { color: var(--iep-brand); }
.search-form input.search, #kb-search #query {
  border-radius: 6px;
}

/* ---------- Tables (my tickets list, ticket info) ---------- */
#ticketTable, table.list, #content table#ticketTable {
  border-collapse: separate;
  border-spacing: 0;
  border: 1px solid var(--iep-border);
  border-radius: var(--iep-radius);
  overflow: hidden;
  width: 100%;
}
#ticketTable th, table.list th {
  background: #f4f7fb;
  color: var(--iep-muted);
  font-size: 13px;
  font-weight: 600;

  padding: 10px 12px;
  border-bottom: 1px solid var(--iep-border);
  text-align: left;
}
#ticketTable td, table.list td { padding: 10px 12px; border-bottom: 1px solid #eef1f5; }
#ticketTable tr:last-child td, table.list tr:last-child td { border-bottom: 0; }
#ticketTable tbody tr:hover td, table.list tbody tr:hover td { background: var(--iep-brand-light); }
#ticketTable th a { color: var(--iep-muted); }

table.infoTable, #ticketInfo table, table.ticket-info {
  background: #f8fafc;
  border: 1px solid var(--iep-border);
  border-radius: var(--iep-radius);
}

/* ---------- "My tickets" list (tickets.php) ---------- */
.search.well, #ticketSearchForm { overflow: hidden; }            /* contain the floats */
.search.well { padding: 12px; border-radius: var(--iep-radius); background: #f4f7fb; }
#content h1 { clear: both; }
#content h1 > a { white-space: nowrap; }
/* fixed layout: the table can never be wider than the page, whatever the language */
#ticketTable, #content table#ticketTable { table-layout: fixed; width: 100% !important; max-width: 100%; }
#ticketTable th:nth-child(1) { width: 14% !important; }   /* ticket #   */
#ticketTable th:nth-child(2) { width: 15% !important; }   /* created    */
#ticketTable th:nth-child(3) { width: 13% !important; }   /* status     */
#ticketTable th:nth-child(4) { width: 32% !important; }   /* subject    */
#ticketTable th:nth-child(5) { width: 26% !important; }   /* department */
#ticketTable td { overflow-wrap: anywhere; }
#ticketTable th { overflow-wrap: normal; word-break: normal; }
@media (max-width: 1000px) {
  #ticketTable th, #ticketTable td, #content table#ticketTable th { padding-left: 7px; padding-right: 7px; font-size: 13px; }
}
#content table#ticketTable caption {
  background: none; border: 0; padding: 0 0 8px; text-align: left;
  color: var(--iep-muted); font-weight: 600; font-size: 14px;
}
#ticketTable th, #content table#ticketTable th {
  height: auto; line-height: 1.3; white-space: normal; vertical-align: bottom;
  text-transform: none; letter-spacing: 0; font-size: 13.5px;
  border: 0; border-bottom: 1px solid var(--iep-border); padding: 10px 12px;
}
#ticketTable td { border: 0; border-bottom: 1px solid #eef1f5; vertical-align: middle; line-height: 1.45; }
/* osTicket limits the subject to 1.2em high: with a normal line height that cuts the text in half */
#ticketTable td .truncate { max-height: none !important; line-height: 1.45; vertical-align: middle; }
#ticketTable td div.link.truncate { max-width: 100% !important; }
/* long department names wrap instead of pushing the table out of the page */
#ticketTable td span.truncate { white-space: normal; overflow: visible; display: inline; }

/* osTicket paints a changed form's submit button text red (= "unsaved changes").
   Red on blue is unreadable, so show that state as an amber ring instead. */
#content input[type=submit][style*="255, 0, 0"], #content input[type=submit][style*="red"] {
  color: #fff !important;
  box-shadow: 0 0 0 3px rgba(242,169,0,.55);
}

/* ---------- Rich-text toolbar ---------- */
.redactor-toolbar, .redactor-toolbar-wrapper { background: #f7f9fc !important; }
.redactor-toolbar a, .redactor-toolbar a.re-button { background: transparent !important; color: var(--iep-text) !important; border-radius: 4px; }
.redactor-toolbar a:hover, .redactor-toolbar a.redactor-button-active, .redactor-toolbar a.re-button-active {
  background: var(--iep-brand-light) !important; color: var(--iep-brand) !important;
}
.redactor-box { background: #fff; }

/* ---------- Thread (ticket view) ---------- */
.thread-entry .header {
  border-radius: var(--iep-radius) var(--iep-radius) 0 0;
}
.thread-entry.message .header { background: var(--iep-brand-light) !important; border-color: #c6d6ee !important; }
.thread-entry.response .header { background: #fff4d6 !important; border-color: #f0dc9e !important; }
.thread-entry .thread-body { border-radius: 0 0 var(--iep-radius) var(--iep-radius); }

/* ---------- Login / register boxes ---------- */
#clientLogin {
  border: 1px solid var(--iep-border) !important;
  border-radius: var(--iep-radius);
  background: #fafbfd !important;
  box-shadow: none !important;
}

/* ---------- Footer ---------- */
#footer {
  max-width: 960px;
  margin: 0 auto;
  padding: 18px 0 32px;
  color: var(--iep-muted);
  font-size: 12.5px;
}
#footer a { color: var(--iep-muted); }
#footer #poweredBy { opacity: .55; filter: grayscale(1); }
#footer #poweredBy:hover { opacity: .9; filter: none; }

/* ---------- Small screens (phones / small tablets) ---------- */
@media (max-width: 760px) {
  #container { margin-top: 0; width: auto; max-width: 100%; border-radius: 0; border-left: 0; border-right: 0; }
  #header { height: auto; min-height: 64px; padding: 8px 16px; border-radius: 0; }
  #header .pull-right { float: none; width: 100%; text-align: right; }
  #header p { width: auto; padding-top: 0; font-size: 13px; }
  #header #logo { display: block; float: none; height: 56px; }
  #header #logo img { max-height: 48px; max-width: 100%; }

  /* nav: items wrap onto extra lines, nothing hidden off-screen */
  #nav {
    display: flex; flex-wrap: wrap; gap: 4px;
    height: auto; padding: 6px; overflow: visible; white-space: normal;
  }
  #nav li { display: block; flex: 1 1 auto; }
  #nav li a, .rtl #nav li a {
    display: flex; align-items: center; justify-content: center;
    height: auto; min-height: 40px; line-height: 1.25;
    margin: 0; padding: 8px 10px;
    white-space: normal; text-align: center; font-size: 13.5px;
    border-radius: 8px; border-bottom: 0;
  }
  #nav li a:before { flex: 0 0 auto; }
  #nav li a.active { background: rgba(255,255,255,.18); box-shadow: inset 0 -3px 0 var(--iep-accent); }

  #content { padding: 20px 16px 28px; min-height: 0; overflow-x: clip; }

  /* "my tickets" search bar */
  #content #ticketSearchForm input[type=text] { width: calc(100% - 110px) !important; display: inline-block; }
  #ticketSearchForm input[type=submit] { width: 100px; padding: 9px 0; }
  #ticketSearchForm .pull-right { float: none !important; display: block; margin-top: 10px; }
  #ticketSearchForm .pull-right select { margin-top: 4px; }
  #content h1 .pull-right.states { float: none !important; display: block; font-size: 15px; margin-top: 6px; }

  /* ticket thread: no avatars, full width bubbles */
  .thread-entry.avatar { margin-left: 0 !important; margin-right: 0 !important; }
  .thread-entry .avatar { display: none !important; }
  .thread-entry .header:before, .thread-entry .header:after { display: none !important; }
  #content h1 { font-size: 22px; }

  /* fixed-width osTicket tables & forms -> fluid */
  #content table[width], #content table,
  #ticketForm > table, #ticketInfo { width: 100% !important; max-width: 100%; }
  #content td[width], #content th[width] { width: auto !important; }
  #content input[type=text], #content input[type=email], #content input[type=password],
  #content input[type=tel], #content input[type=number], #content input[type=search],
  #content select, #content textarea { width: 100% !important; max-width: 100%; font-size: 16px; /* 16px stops iOS zoom-on-focus */ }
  #content input[name$="-ext"] { width: 90px !important; }
  .redactor-box, .redactor-editor, .redactor-in { max-width: 100%; box-sizing: border-box; }
  #content img { max-width: 100%; height: auto; }

  /* ticket info: stack the two halves */
  #ticketInfo > tbody > tr > td { display: block; width: 100% !important; padding: 0 0 10px; }
  #ticketInfo h1 { font-size: 20px; }

  /* "my tickets" list: one card per ticket (labels from tables.js) */
  #ticketTable { display: block; overflow-x: auto; -webkit-overflow-scrolling: touch; }
  #content table#ticketTable.iep-cards { overflow: visible; border: 0; border-radius: 0; box-shadow: none; }
  #ticketTable.iep-cards thead { display: none; }
  #ticketTable.iep-cards caption {
    display: block; width: auto; text-align: left; background: none; border: 0;
    padding: 0 0 10px; font-weight: 600; color: var(--iep-muted);
  }
  #ticketTable.iep-cards tbody td[data-empty] { display: none; }
  #ticketTable.iep-cards tbody { display: block; }
  #ticketTable.iep-cards tbody tr {
    display: block; background: #fff; border: 1px solid var(--iep-border); border-radius: 8px;
    margin: 0 0 10px; padding: 6px 14px; box-shadow: 0 1px 2px rgba(16,24,40,.05);
  }
  #ticketTable.iep-cards tbody td, #ticketTable.iep-cards tbody tr:hover td {
    display: flex; justify-content: space-between; align-items: baseline; gap: 12px;
    width: auto !important; padding: 7px 0; border: 0; border-bottom: 1px solid #eef1f5;
    background: transparent; text-align: right; overflow-wrap: anywhere;
  }
  #ticketTable.iep-cards tbody td:last-child { border-bottom: 0; }
  #ticketTable.iep-cards tbody td::before {
    content: attr(data-label); flex: 0 0 auto; text-align: left;
    font-size: 13px; font-weight: 600; color: var(--iep-muted);
  }
  #ticketTable.iep-cards tbody td[data-label=""]::before, #ticketTable.iep-cards tbody td[colspan]::before { content: none; }
  #ticketTable.iep-cards tbody td[colspan] { display: block; text-align: left; }
  #ticketTable.iep-cards td a { font-weight: 600; }
  #ticketTable.iep-cards td .truncate { max-width: none !important; white-space: normal !important; }

  /* other data tables (ticket info, custom fields): label above value */
  table.infoTable, table.infoTable tbody, table.infoTable tr,
  table.custom-data, table.custom-data tbody, table.custom-data tr { display: block; width: 100% !important; }
  table.infoTable th, table.infoTable td, table.custom-data th, table.custom-data td {
    display: block; width: auto !important; text-align: left; padding: 2px 8px;
  }
  table.infoTable th, table.custom-data th { padding-top: 8px; color: var(--iep-muted); font-size: 13px; }
  #ticketSearchForm, #ticketSearchForm * { max-width: 100%; }

  /* sign-in / check status box: stack instead of two columns */
  #clientLogin { background-image: none !important; padding: 16px; }
  #clientLogin .login-box, #clientLogin .instructions, .login-box {
    display: block; width: auto !important; float: none; padding: 0; box-shadow: none;
  }
  #clientLogin .instructions { margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--iep-border); }
  #clientLogin > div, #clientLogin form > div { width: auto !important; max-width: 100%; }

  /* buttons: full width, easy to tap */
  #content p.buttons input, #ticketForm p.buttons input,
  #content form > p > input[type=submit], #content form > p > input[type=reset], #content form > p > input[type=button] {
    width: 100%; margin: 0 0 10px; display: block;
  }

  /* landing page */
  #landing_page .main-content, #landing_page .sidebar { width: 100%; float: none; }
  #landing_page .sidebar { width: auto; margin: 0 0 20px; }
  #landing_page .main-content h1 { font-size: 24px; }

  /* knowledge base */
  .featured-category { width: 100% !important; float: none !important; margin: 0 0 12px !important; }
  #kb-search #query, #kb-search #cid, #kb-search #topic-id { width: 100% !important; margin: 0 0 8px; }

  #footer { padding: 16px; }
}

/* ---------- Phones: menu as a simple list, one item per line ---------- */
@media (max-width: 480px) {
  #nav li, #nav li:only-child { flex: 1 1 100%; }
  #nav li a, .rtl #nav li a { justify-content: flex-start; text-align: left; min-height: 38px; padding: 8px 14px; }
  .rtl #nav li a { text-align: right; }
}

