/* ═══════════════════════════════════════════════════════════
   PESARES DARK THEME for osTicket
   Matches pesares.com design language
   Colors: #0a0e1a (bg), #00c8a0 (accent), #f5a623 (warm)
   ═══════════════════════════════════════════════════════════ */

@import url('https://fonts.googleapis.com/css2?family=DM+Sans:wght@300;400;500;600;700&family=Syne:wght@600;700;800&display=swap');

:root {
  --bg-deep: #0a0e1a;
  --bg-surface: #111827;
  --bg-card: #1a2235;
  --bg-card-hover: #1f2a40;
  --bg-input: #1e2d47;
  --accent: #00c8a0;
  --accent-bright: #0ff2c8;
  --accent-warm: #f5a623;
  --text-main: #e8edf5;
  --text-muted: #8b95a8;
  --text-dim: #5a6478;
  --border: rgba(0,200,160,0.22);
  --border-hover: rgba(0,200,160,0.25);
  --msg-header: rgba(0,200,160,0.08);
  --resp-header: rgba(30,40,60,0.9);
}

/* ─── BASE ─── */
html {
  font-size: 100%;
  overflow-y: scroll;
  -webkit-text-size-adjust: 100%;
  -ms-text-size-adjust: 100%;
  scroll-behavior: smooth;
}
body {
  margin: 0;
  font-size: 14px;
  line-height: 1.6;
  padding: 0;
  background: var(--bg-deep) !important;
  color: var(--text-main);
  font-family: 'DM Sans', 'Helvetica Neue', sans-serif;
  -webkit-font-smoothing: antialiased;
}
body, input, select, textarea {
  font-family: 'DM Sans', 'Helvetica Neue', sans-serif;
  color: var(--text-main);
}
b, strong { font-weight: 600; }
blockquote { margin: 1em 40px; }
hr {
  display: block;
  height: 1px;
  border: 0;
  border-top: 1px solid var(--border);
  margin: 1em 0;
  padding: 0;
}
small { font-size: 85%; }
ul, ol { margin: 1em 0; padding: 0 0 0 30px; }
img { border: 0; vertical-align: middle; }
form { margin: 0; }
fieldset { border: 0; margin: 0; padding: 0; }
label { cursor: pointer; color: var(--text-muted); }
input, select, textarea {
  font-size: 100%;
  margin: 0;
  vertical-align: baseline;
}
input { line-height: normal; }
table input { *overflow: auto; }
input[type="button"], input[type="reset"], input[type="submit"] {
  cursor: pointer;
  -webkit-appearance: button;
}

/* ─── LINKS ─── */
a { color: var(--accent); text-decoration: none; transition: color 0.2s ease; }
a:hover { color: var(--accent-bright); }
a:visited { color: var(--accent); }
a:focus { outline: thin dotted var(--accent); }
a:hover, a:active { outline: 0; }
.faded, .faded a { color: var(--text-muted) !important; }
.faded a:hover { color: var(--accent) !important; }

/* ─── MESSAGES ─── */
#msg_notice {
  background: rgba(0,200,160,0.1) !important;
  border: 1px solid rgba(0,200,160,0.3);
  color: var(--accent) !important;
  padding: 10px 15px;
  border-radius: 8px;
  margin-bottom: 10px;
}
#msg_warning {
  background: rgba(245,166,35,0.1) !important;
  border: 1px solid rgba(245,166,35,0.3);
  color: var(--accent-warm) !important;
  padding: 10px 15px;
  border-radius: 8px;
  margin-bottom: 10px;
}
#msg_error {
  background: rgba(220,50,50,0.1) !important;
  border: 1px solid rgba(220,50,50,0.3);
  color: #ff6b6b !important;
  padding: 10px 15px;
  border-radius: 8px;
  margin-bottom: 10px;
}
#msg_info {
  margin: 0; padding: 10px 15px; margin-bottom: 10px;
  color: var(--accent) !important;
  border: 1px solid rgba(0,200,160,0.2);
  background: rgba(0,200,160,0.06) !important;
  border-radius: 8px;
}
.required-text { color: #ff6b6b; }
.error { color: #ff6b6b !important; }

/* ─── BUTTONS ─── */
.button, .button:visited {
  background: var(--accent);
  border: none;
  border-radius: 6px;
  padding: 8px 20px;
  color: var(--bg-deep) !important;
  font-family: 'DM Sans', sans-serif;
  font-weight: 600;
  font-size: 13px;
  letter-spacing: 0.2px;
  transition: all 0.3s ease;
  text-decoration: none;
  box-shadow: 0 0 16px rgba(0,200,160,0.15);
}
.button:hover {
  background: var(--accent-bright) !important;
  color: var(--bg-deep) !important;
  box-shadow: 0 0 24px rgba(0,200,160,0.3);
  transform: translateY(-1px);
}
.button:active { transform: translateY(0); }
.green.button, .green.button:visited {
  background-color: var(--accent) !important;
}
.green.button:hover {
  background-color: var(--accent-bright) !important;
}
.blue.button, .blue.button:visited {
  background-color: var(--accent) !important;
}
.blue.button:hover {
  background-color: var(--accent-bright) !important;
}
input[type="submit"] {
  background: var(--accent) !important;
  color: var(--bg-deep) !important;
  border: none;
  border-radius: 6px;
  padding: 8px 24px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
}
input[type="submit"]:hover {
  background: var(--accent-bright) !important;
  box-shadow: 0 0 20px rgba(0,200,160,0.25);
}
input[type="reset"], input[type="button"] {
  background: var(--bg-card) !important;
  color: var(--text-muted) !important;
  border: 1px solid var(--border) !important;
  border-radius: 6px;
  padding: 8px 20px;
  transition: all 0.3s ease;
}
input[type="reset"]:hover, input[type="button"]:hover {
  border-color: var(--accent) !important;
  color: var(--text-main) !important;
}

/* ─── CONTAINER & LAYOUT ─── */
#container {
  background: var(--bg-surface);
  width: 900px;
  margin: 30px auto;
  box-shadow: 0 8px 40px rgba(0,0,0,0.4);
  border-radius: 12px;
  border: 1px solid var(--border);
  overflow: hidden;
}

/* ─── HEADER ─── */
#header {
  position: relative;
  height: 71px;
  padding: 0 24px;
  background: linear-gradient(135deg, var(--bg-deep) 0%, var(--bg-surface) 100%);
  border-bottom: 1px solid var(--border);
}
#logo { height: 100%; }
#header #logo img {
  max-height: 60px;
  max-width: 380px;
  width: auto;
  height: auto;
  vertical-align: middle;
  filter: brightness(1.1);
}
.valign-helper {
  height: 100%;
  display: inline-block;
  vertical-align: middle;
}
#header p {
  width: 400px;
  margin: 0;
  padding: 10px 0 0;
  color: var(--text-muted);
}
#header a { color: var(--text-main); }
#header .pull-right a {
  color: var(--accent);
  font-size: 12px;
}

/* ─── NAVIGATION ─── */
#nav {
  margin: 0;
  padding: 6px 24px;
  height: auto;
  background: rgba(0,200,160,0.04);
  border-top: none;
  border-bottom: 1px solid var(--border);
  box-shadow: none;
  white-space: nowrap;
}
#nav li {
  margin: 0;
  padding: 0;
  list-style: none;
  display: inline;
}
#nav li a {
  display: inline-block;
  width: auto;
  height: 28px;
  line-height: 28px;
  text-align: center;
  padding: 0 14px 0 34px;
  margin-left: 4px;
  color: var(--text-muted);
  border-radius: 6px;
  background-position: 10px 50%;
  background-repeat: no-repeat;
  font-size: 13px;
  font-weight: 500;
  transition: all 0.2s ease;
  text-decoration: none;
}
.rtl #nav li a {
  background-position: right center;
  background-position: calc(100% - 10px) center;
  padding-left: 10px;
  padding-right: 32px;
  margin-right: 10px;
  margin-left: 0;
}
#nav li a.active, #nav li a:hover {
  background-color: rgba(0,200,160,0.12);
  color: var(--accent);
}
#nav li a:hover {
  background-color: rgba(0,200,160,0.08);
  color: var(--accent-bright);
}
#nav li a.home { background-image: url('../images/icons/home.png'); }
#nav li a.kb { background-image: url('../images/icons/kb.png'); }
#nav li a.new { background-image: url('../images/icons/new.png'); }
#nav li a.status { background-image: url('../images/icons/status.png'); }
#nav li a.tickets { background-image: url('../images/icons/tix.png'); }

/* ─── CONTENT ─── */
#content {
  padding: 28px 24px;
  margin: 0;
  min-height: 350px;
  color: var(--text-main);
}
#content h1, #content h2, #content h3 {
  font-family: 'Syne', 'DM Sans', sans-serif;
  color: var(--text-main);
  letter-spacing: -0.3px;
}

/* ─── FOOTER ─── */
#footer {
  text-align: center;
  font-size: 11px;
  color: var(--text-dim);
  padding: 16px 20px;
  border-top: 1px solid var(--border);
  background: rgba(0,0,0,0.2);
}
#footer a { color: var(--text-dim); }
#footer a:hover { color: var(--accent); }
#footer p { margin: 6px 0 0 0; }
#footer #poweredBy {
  display: block;
  width: 126px;
  height: 23px;
  outline: none;
  text-indent: -9999px;
  margin: 8px auto 0;
  background: url('../images/poweredby.png') top left no-repeat;
  background-size: auto 20px;
  opacity: 0.4;
}

/* ─── LANDING PAGE ─── */
.front-page-button {}
.main-content { width: 100%; }
#landing_page #new_ticket {
  margin-top: 30px;
  background: url('../images/new_ticket_icon.png') top left no-repeat;
}
#landing_page #new_ticket,
#landing_page #check_status {
  width: 45%;
  padding-left: 75px;
  display: inline-block;
  vertical-align: top;
}
#landing_page #check_status {
  margin-top: 30px;
  background: url('../images/check_status_icon.png') top left no-repeat;
}
#landing_page h1, #landing_page h2, #landing_page h3 {
  margin-bottom: 10px;
  color: var(--text-main);
}
#landing_page p { color: var(--text-muted); }

/* ─── FAQ ─── */
#faq { clear: both; margin: 0; padding: 5px; }
#faq ol { font-size: 15px; margin-left: 0; padding-left: 0; border-top: 1px solid var(--border); }
#faq ol li { list-style: none; margin: 0; padding: 0; color: var(--text-muted); }
#faq ol li a {
  display: block; padding: 10px 0; height: auto !important;
  overflow: hidden; margin: 0; border-bottom: 1px solid var(--border);
  line-height: 16px; padding-left: 24px;
  background: url('../images/icons/page.png') 0 50% no-repeat;
  color: var(--accent);
}
#faq ol li a:hover { background-color: rgba(0,200,160,0.05); }
#faq .article-meta { padding: 8px; background: var(--bg-card); border-radius: 6px; }

#kb { margin: 2px 0; padding: 5px; overflow: hidden; }
#kb > li {
  padding: 12px; height: auto !important; overflow: hidden; margin: 0;
  background: none; border-bottom: 1px solid var(--border); display: block;
}
#kb > li h4 span { color: var(--text-muted); }
#kb > li h4 a { font-size: 14px; color: var(--accent); }
#kb > li > i {
  display: block; width: 32px; height: 32px; float: left; margin-right: 6px;
  background: url(../images/kb_large_folder.png) top left no-repeat;
}
.featured-category {
  margin-top: 10px; width: 49.7%; display: inline-block;
  box-sizing: border-box; vertical-align: top;
}
.category-name { display: inline-block; font-weight: 500; font-size: 120%; color: var(--text-main); }
.featured-category i { color: var(--accent); display: inline-block; vertical-align: middle; }
.article-headline { margin-left: 34px; }
.rtl .article-headline { margin-left: 0; margin-right: 34px; }
.article-teaser { font-size: 90%; line-height: 1.5em; height: 3em; overflow: hidden; color: var(--text-muted); }
.article-title { font-weight: 500; color: var(--text-main); }
.faq-content .article-title { font-size: 17pt; margin-top: 15px; }

#kb-search { padding: 10px 0; overflow: hidden; }
#kb-search div { clear: both; overflow: hidden; padding-top: 5px; }
#kb-search #query {
  margin: 0; display: inline-block; float: left; width: 200px; margin-right: 5px;
  background: var(--bg-input); border: 1px solid var(--border); color: var(--text-main);
  border-radius: 6px; padding: 6px 10px;
}
#kb-search #cid, #kb-search #topic-id {
  margin: 0; display: inline-block; float: left; margin-right: 5px;
}
#kb-search #breadcrumbs { color: var(--text-muted); margin-bottom: 15px; }
#kb-search #breadcrumbs a { color: var(--accent); }

/* ─── FORMS ─── */
#ticketForm div.clear, #clientLogin div.clear { clear: both; padding: 3px 0; overflow: hidden; }
#ticketForm div label, #clientLogin div label { display: block; color: var(--text-muted); }
label.required, span.required { font-weight: 600; color: var(--text-main) !important; }
#ticketForm div label.required, #clientLogin div label.required { text-align: left; }
#ticketForm div input, #clientLogin div input,
#ticketForm div textarea, #clientLogin div textarea {
  width: auto;
  border: 1px solid var(--border);
  background: var(--bg-input);
  color: var(--text-main);
  display: block;
  border-radius: 6px;
  padding: 8px 12px;
  transition: border-color 0.3s ease;
}
#ticketForm div input:focus, #clientLogin div input:focus,
#ticketForm div textarea:focus, #clientLogin div textarea:focus {
  border-color: var(--accent);
  outline: none;
  box-shadow: 0 0 0 3px rgba(0,200,160,0.1);
}
#ticketForm div input[type=file], #clientLogin div input[type=file] { border: 0; }
#ticketForm div select, #clientLogin div select {
  display: block; float: left;
  background: var(--bg-input); color: var(--text-main);
  border: 1px solid var(--border); border-radius: 6px;
  padding: 6px 10px;
}
#ticketForm > table { table-layout: fixed; }
#ticketForm > table td { width: 160px; color: var(--text-muted); }
#ticketForm > table td + td { width: auto; }
#ticketForm td textarea, #clientLogin td textarea,
#ticketForm div textarea, #clientLogin div textarea {
  width: 100%; max-width: 600px; box-sizing: border-box;
}
#ticketForm td em, #clientLogin td em,
#ticketForm div em, #clientLogin div em { color: var(--text-dim); }
#ticketForm div.error input, #clientLogin div.error input {
  border: 1px solid #ff6b6b;
}
#ticketForm div.error label, #clientLogin div.error label { color: #ff6b6b; }

/* Select elements */
select {
  background: var(--bg-input) !important;
  color: var(--text-main) !important;
  border: 1px solid var(--border) !important;
  border-radius: 6px;
  padding: 6px 10px;
}
input[type="text"], input[type="password"], input[type="email"],
input[type="search"], input[type="url"], textarea {
  background: var(--bg-input) !important;
  color: var(--text-main) !important;
  border: 1px solid var(--border) !important;
  border-radius: 6px;
  padding: 8px 12px;
}
input[type="text"]:focus, input[type="password"]:focus,
input[type="email"]:focus, textarea:focus {
  border-color: var(--accent) !important;
  outline: none;
  box-shadow: 0 0 0 3px rgba(0,200,160,0.1);
}

/* ─── CLIENT LOGIN ─── */
#clientLogin {
  display: block; margin-top: 20px; padding: 24px;
  border: 1px solid var(--border); border-radius: 10px;
  box-shadow: 0 4px 20px rgba(0,0,0,0.3);
  background: var(--bg-card) !important;
}
.rtl #clientLogin { background-position: 5% 50%; }
#clientLogin .instructions { display: table-cell; padding-left: 2em; padding-right: 20px; color: var(--text-muted); }
.rtl #clientLogin .instructions { padding-left: 0; padding-right: 0; padding-right: 2em; padding-left: 20px; }
#clientLogin p { clear: both; color: var(--text-muted); }
#clientLogin strong { font-size: 11px; color: #ff6b6b; display: block; }
#clientLogin input[type=text], #clientLogin input[type=password] {
  padding: 8px 12px; border-radius: 6px; margin-bottom: 15px;
}
#clientLogin input[type=submit] { padding: 8px 24px; border-radius: 6px; }

.login-box {
  width: 40%; display: table-cell;
  box-shadow: none;
  padding: 15px;
  border-right: 1px solid var(--border);
}
.rtl .login-box { border-right: none; border-left: 1px solid var(--border); }

/* ─── TICKET TABLE ─── */
#ticketTable {
  border: 1px solid var(--border);
  border-left: none; border-bottom: none;
  border-radius: 8px;
  overflow: hidden;
}
#ticketTable caption {
  padding: 8px 12px; text-align: left; color: var(--text-main);
  background: var(--bg-card); border: 1px solid var(--border);
  border-bottom: none; font-weight: 600;
}
#ticketTable th {
  height: 28px; line-height: 28px;
  background: rgba(0,200,160,0.06);
  border: 1px solid var(--border); border-right: none; border-top: none;
  padding: 0 8px; color: var(--text-muted); font-weight: 500;
}
#ticketTable th a { color: var(--accent); }
#ticketTable td {
  padding: 6px 8px; border: 1px solid var(--border);
  border-right: none; border-top: none; color: var(--text-main);
}
#ticketTable tr.alt td { background: rgba(0,200,160,0.02); }
#ticketTable tr:hover td { background: rgba(0,200,160,0.04); }

/* ─── TICKET INFO ─── */
#ticketInfo h1 {
  padding-bottom: 10px; margin-bottom: 5px;
  border-bottom: 2px solid var(--border);
  color: var(--text-main);
  font-family: 'Syne', sans-serif;
}
#ticketInfo h1 small { font-weight: normal; color: var(--text-muted); }
.infoTable { background: var(--bg-card); border-radius: 8px; }
.infoTable th { text-align: left; padding: 6px 10px; color: var(--text-muted); }
.infoTable td { color: var(--text-main); }
table.custom-data { margin-top: 10px; }
table.custom-data th { width: 25%; background-color: var(--bg-card); padding: 6px 10px; color: var(--text-muted); }
table .headline, table.custom-data .headline {
  border-bottom: 2px solid var(--border);
  font-weight: 600; background-color: transparent; color: var(--text-main);
}

/* ─── THREAD ─── */
.thread-entry { margin-bottom: 15px; }
.thread-entry.avatar { margin-left: 60px; }
.thread-entry.response.avatar { margin-right: 60px; margin-left: 0; }
.thread-entry > .avatar {
  margin-left: -60px; display: inline-block;
  width: 48px; height: auto; border-radius: 8px;
}
.thread-entry.response > .avatar { margin-left: initial; margin-right: -60px; }
img.avatar { border-radius: inherit; }
.avatar > img.avatar { width: 100%; height: auto; }

.thread-entry .header {
  padding: 10px 1em;
  border: 1px solid var(--border);
  border-radius: 8px 8px 0 0;
  color: var(--text-muted);
  font-size: 13px;
}
.thread-entry.avatar .header { position: relative; }
.thread-entry.avatar .header:before {
  position: absolute; top: 7px; right: -8px; content: '';
  border-top: 8px solid transparent; border-bottom: 8px solid transparent;
  border-left: 8px solid var(--border); display: inline-block;
}
.thread-entry.avatar .header:after {
  position: absolute; top: 7px; right: -8px; content: '';
  border-top: 7px solid transparent; border-bottom: 7px solid transparent;
  display: inline-block; margin-top: 1px;
}
.thread-entry.response .header { background: var(--resp-header); }
.thread-entry.avatar.response .header:after {
  border-left: 7px solid var(--resp-header); margin-right: 1px;
}
.thread-entry.message .header { background: rgba(0,200,160,0.08); }
.thread-entry.avatar.message .header:before {
  top: 7px; left: -8px; right: initial;
  border-left: none; border-right: 8px solid rgba(0,200,160,0.2);
}
.thread-entry.avatar.message .header:after {
  top: 7px; left: -8px; right: initial;
  border-left: none; border-right: 7px solid rgba(0,200,160,0.08);
  margin-left: 1px;
}
.thread-entry .header .title {
  max-width: 500px; vertical-align: bottom;
  display: inline-block; margin-left: 15px; color: var(--text-dim);
}
.thread-entry .thread-body {
  border: 1px solid var(--border); border-top: none;
  border-bottom: 2px solid rgba(0,200,160,0.15);
  border-radius: 0 0 8px 8px;
  padding: 1em;
  background: var(--bg-card);
  color: var(--text-main);
}
.thread-body .attachments {
  background: rgba(0,200,160,0.04);
  margin: 0 -0.9em; position: relative; top: 0.9em;
  padding: 0.5em 0.9em; border-top: 1px solid var(--border);
  border-radius: 0 0 8px 8px;
}
.thread-body .attachments .filesize { margin-left: 0.5em; color: var(--text-dim); }
.thread-body .attachments a, .thread-body .attachments a:hover { text-decoration: none; }
.thread-body .attachment-info { margin-right: 10px; display: inline-block; width: 48%; }
.thread-body .attachment-info .filename { max-width: 80%; max-width: calc(100% - 70px); }

.thread-event { padding: 0px 2px 15px; margin-left: 60px; color: var(--text-muted); }
.type-icon {
  border-radius: 8px; background-color: var(--bg-card);
  padding: 4px 6px; margin-right: 5px; text-align: center;
  display: inline-block; font-size: 1.1em;
  border: 1px solid var(--border); vertical-align: top; color: var(--accent);
}
.type-icon.dark { border-color: var(--text-dim); background-color: var(--bg-card-hover); }
.thread-event img.avatar { vertical-align: middle; border-radius: 3px; width: auto; max-height: 24px; margin: -3px 3px 0; }
.thread-event .description {
  margin-left: -30px; padding-top: 6px; padding-left: 30px;
  display: inline-block; width: calc(100% - 95px); line-height: 1.4em;
}
.thread-event .type-icon { position: relative; }
.thread-event .type-icon::after {
  content: ""; border: 16px solid var(--bg-surface);
  position: absolute; top: -3px; bottom: 0; left: -3px; right: 0; z-index: -1;
}
.thread-entry::after { content: ""; border-bottom: 2px solid var(--bg-surface); display: block; }
.thread-entry::before { content: ""; display: block; border-top: 2px solid var(--bg-surface); }
#ticketThread::before {
  border-left: 2px dotted var(--border); position: absolute;
  margin-left: 74px; z-index: -1; content: ""; top: 0; bottom: 0; right: 0; left: 0;
}
#ticketThread { z-index: 0; position: relative; border-bottom: 2px solid var(--border); }

/* ─── REPLY BOX ─── */
#reply {
  margin-top: 10px; padding: 16px;
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: 10px;
}
#reply h2 {
  margin-bottom: 10px; padding-bottom: 8px;
  border-bottom: 2px solid var(--border);
  color: var(--text-main); font-family: 'Syne', sans-serif;
}
#reply > table { width: auto; }
#reply table td { vertical-align: top; color: var(--text-muted); }
#reply textarea { width: 100% !important; box-sizing: border-box; }
#reply input[type=text], #reply #response_options textarea {
  border: 1px solid var(--border); background: var(--bg-input); color: var(--text-main);
}

/* ─── LABEL ─── */
.label {
  font-size: 11px; padding: 2px 8px;
  border-radius: 4px; font-weight: 600;
  line-height: 16px; color: var(--bg-deep);
  vertical-align: baseline; white-space: nowrap;
  text-shadow: none; background-color: var(--accent);
}
.label-bare {
  background-color: transparent; border: 1px solid var(--accent);
  color: var(--accent); text-shadow: none;
}

/* ─── MISC ─── */
i.refresh { color: var(--accent); font-size: 80%; vertical-align: middle; }
.states small { font-size: 70%; }
.active.state { font-weight: bold; color: var(--accent); }
.search.well {
  padding: 12px; background-color: var(--bg-card);
  margin-bottom: 10px; margin-top: -15px; border-radius: 8px;
  border: 1px solid var(--border);
}

/* ─── ACTION BUTTONS ─── */
.action-button {
  border-radius: 6px;
  color: var(--text-muted) !important;
  display: inline-block;
  border: 1px solid var(--border);
  cursor: pointer; font-size: 11px; overflow: hidden;
  background: var(--bg-card) !important;
  padding: 0 8px; text-decoration: none;
  line-height: 22px; margin-left: 5px;
  transition: all 0.2s ease;
}
.action-button:hover {
  border-color: var(--accent) !important;
  color: var(--accent) !important;
  background: rgba(0,200,160,0.06) !important;
}
.action-button span, .action-button a { color: var(--text-muted) !important; display: inline-block; float: left; }
.action-button:hover span, .action-button:hover a { color: var(--accent) !important; }

/* ─── SIDEBAR ─── */
.sidebar { margin-bottom: 20px; margin-left: 20px; width: 215px; }
.rtl .sidebar { margin-left: 0; margin-right: 20px; }
.sidebar .content {
  padding: 12px; border: 1px solid var(--border);
  background: var(--bg-card); border-radius: 8px;
}
.sidebar .content:empty { display: none; }
.sidebar section .header { font-weight: 600; margin-bottom: 0.3em; color: var(--text-main); }
.sidebar section + section { margin-top: 15px; }

/* ─── SEARCH ─── */
.search-form { padding-top: 12px; }
.searchbar .search, .search-form .search {
  display: inline-block; width: 400px; border-radius: 6px;
  border: 1px solid var(--border); padding: 8px 12px;
  box-shadow: none; background: var(--bg-input); color: var(--text-main);
}
.searchbar .search { width: 100%; box-sizing: border-box; margin-bottom: 10px; }

/* ─── EXTERNAL AUTH ─── */
.external-auth + .external-auth { margin-top: 4px; }
a.external-sign-in { text-decoration: none; }
.external-auth-box { vertical-align: middle; border-radius: 6px; border: 1px solid var(--border); }
.external-auth-icon {
  display: inline-block; color: var(--text-main); width: 30px;
  padding: 5px 10px; border-right: 1px solid var(--border);
}
.external-auth-name { color: var(--text-main); width: 100px; padding: 5px 10px; line-height: 30px; font-size: 11pt; }
img.sign-in-image { border: none; max-height: 40px; max-width: 200px; width: auto; height: auto; }

/* ─── LAYOUT HELPERS ─── */
.flush-right { text-align: right; }
.flush-left { text-align: left; }
.bleed { margin: 0 !important; padding: 0 !important; }
.span4 { display: inline-block; width: 29.5%; margin: 0 1%; vertical-align: top; }
.span8 { display: inline-block; width: 66.0%; margin: 0 1%; vertical-align: top; }
.truncate {
  display: inline-block; width: auto; max-width: 100%;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; vertical-align: bottom;
}
.image-hover a.action-button:hover, .image-hover a.action-button { text-decoration: none; }
table.padded tr > td, table.padded tr > th { height: 20px; padding-bottom: 5px; }

/* ─── FILE DROP ─── */
.freetext-files {
  padding: 12px; margin-top: 10px;
  border: 1px dashed var(--border); border-radius: 8px;
  background: var(--bg-card);
}
.freetext-files .file { margin-right: 10px; display: inline-block; width: 48%; padding-top: 0.2em; }
.freetext-files .title { font-weight: 600; margin-bottom: 0.3em; font-size: 1.1em; }

/* ─── ICONS ─── */
.Icon {
  width: auto; padding-left: 20px; background-position: top left;
  background-repeat: no-repeat; color: var(--accent); text-decoration: none;
}
.Icon.Ticket { background-image: url('../images/icons/ticket.gif'); }
.Icon.webTicket { background-image: url('../images/icons/ticket_source_web.gif'); }
.Icon.emailTicket { background-image: url('../images/icons/ticket_source_email.gif'); }
.Icon.phoneTicket { background-image: url('../images/icons/ticket_source_phone.gif'); }
.Icon.otherTicket, .Icon.apiTicket { background-image: url('../images/icons/ticket_source_other.gif'); }
.Icon.attachment { background-image: url('../images/icons/attachment.gif'); }
.Icon.file { background-image: url('../images/icons/attachment.gif'); }
.Icon.refresh { background-image: url('../images/icons/refresh.gif'); }
.Icon.thread { font-weight: bold; font-size: 1em; background-image: url('../images/icons/thread.gif'); }

/* ─── LANGUAGE SELECTOR ─── */
.lang-flag, .lang-select { opacity: 0.7; transition: opacity 0.2s; }
.lang-flag:hover, .lang-select:hover { opacity: 1; }

/* ─── TOOLTIP / DROPDOWN ─── */
.tooltip-inner {
  background: var(--bg-card) !important;
  color: var(--text-main) !important;
  border: 1px solid var(--border);
}

/* ─── TABLES GENERAL ─── */
table { color: var(--text-main); }
table th { color: var(--text-muted); }
table td { color: var(--text-main); }

/* ─── CAPTCHA ─── */
#ticketForm td .captcha, #clientLogin td .captcha,
#ticketForm div .captcha, #clientLogin div .captcha {
  width: 88px; height: 31px; background: #000;
  display: block; float: left; margin-right: 20px; border-radius: 4px;
}
#ticketForm div div.captchaRow, #clientLogin div div.captchaRow { line-height: 31px; }

/* ─── RESPONSIVE ─── */
@media (max-width: 960px) {
  #container { width: 95%; margin: 10px auto; border-radius: 8px; }
  #landing_page #new_ticket, #landing_page #check_status { width: 100%; display: block; padding-left: 75px; }
  .span4, .span8 { width: 98%; display: block; margin: 5px 1%; }
  .sidebar { width: 100%; margin-left: 0; }
  #ticketForm td textarea, #clientLogin td textarea { width: 100% !important; }
}

/* Mobile: clientLogin form (Check Ticket Status) - stack columns umjesto side-by-side */
@media (max-width: 767px) {
  #clientLogin > div[style*="table-row"] { display: block !important; }
  .login-box {
    display: block !important;
    width: 100% !important;
    border-right: none !important;
    border-bottom: 1px solid var(--border);
    padding-bottom: 15px;
    margin-bottom: 15px;
    box-sizing: border-box;
  }
  .rtl .login-box { border-left: none !important; }
  #clientLogin .instructions {
    display: block !important;
    width: 100% !important;
    padding: 15px 0 0 0 !important;
    box-sizing: border-box;
  }
  .rtl #clientLogin .instructions { padding: 15px 0 0 0 !important; }
  /* Input polja da ne izlaze iz ekrana */
  #clientLogin input[type=text],
  #clientLogin input[type=password] {
    width: 100% !important;
    box-sizing: border-box;
  }
}

/* ═══════════════════════════════════════════════════════════
   OVERRIDES for osticket.css and thread.css
   ═══════════════════════════════════════════════════════════ */

/* Thread/content text colors */
.thread-body, .thread-body p, .thread-body div,
.thread-body span, .thread-body li, .thread-body td {
  color: var(--text-main) !important;
  background-color: transparent !important;
}
.thread-body a { color: var(--accent) !important; }
.thread-entry .header b, .thread-entry .header a { color: var(--text-main) !important; }
.thread-entry .header time, .thread-entry .header .faded { color: var(--text-muted) !important; }

/* Redactor editor dark mode */
.redactor-box, .redactor-editor, .re-container {
  background: var(--bg-input) !important;
  color: var(--text-main) !important;
  border-color: var(--border) !important;
}
.redactor-toolbar, .re-toolbar {
  background: var(--bg-card) !important;
  border-color: var(--border) !important;
}
.redactor-toolbar a, .re-button {
  color: var(--text-muted) !important;
}
.redactor-toolbar a:hover, .re-button:hover {
  color: var(--accent) !important;
  background: rgba(0,200,160,0.1) !important;
}
.redactor-editor[placeholder]::before,
.re-container [data-placeholder]::before {
  color: var(--text-dim) !important;
}

/* File drop zone */
.filedrop, [class*="filedrop"], .dz-message {
  background: var(--bg-card) !important;
  border: 2px dashed var(--border) !important;
  border-radius: 8px !important;
  color: var(--text-muted) !important;
}
.filedrop:hover, [class*="filedrop"]:hover {
  border-color: var(--accent) !important;
  background: rgba(0,200,160,0.04) !important;
}
.filedrop a, [class*="filedrop"] a { color: var(--accent) !important; }

/* Headings - ensure they're light on dark */
h1, h2, h3, h4, h5, h6 {
  color: var(--text-main) !important;
}
h1 { font-family: 'Syne', 'DM Sans', sans-serif; letter-spacing: -0.3px; }

/* Landing page welcome text */
#landing_page h1, #content > h1, .landing h1,
#content h1:first-of-type {
  color: var(--text-main) !important;
  font-family: 'Syne', sans-serif;
  font-size: 1.8em;
}
#landing_page p, #content > p {
  color: var(--text-muted) !important;
}

/* Ticket form labels */
#ticketTable td, #ticketTable th,
table td label, table th label {
  color: var(--text-muted) !important;
}
#ticketTable td a { color: var(--accent) !important; }

/* Bootstrap / osticket helpers */
.muted, .text-muted { color: var(--text-dim) !important; }
.pull-right, .pull-left { color: var(--text-muted); }
.description { color: var(--text-muted) !important; }

/* Breadcrumbs */
.breadcrumbs, .breadcrumbs a { color: var(--text-muted) !important; }
.breadcrumbs a:hover { color: var(--accent) !important; }

/* Pagination */
.pagination a, .pagelinks a {
  color: var(--accent) !important;
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 3px 8px;
  background: var(--bg-card);
}
.pagination a:hover, .pagelinks a:hover {
  background: rgba(0,200,160,0.1);
  border-color: var(--accent);
}
.pagination .current, .pagelinks .current {
  background: var(--accent);
  color: var(--bg-deep) !important;
  border-radius: 4px;
  padding: 3px 8px;
}

/* Loading overlay */
#loading {
  background: rgba(10,14,26,0.9) !important;
}
#loading h4 { color: var(--accent) !important; }

/* Notice / warning bars from osticket.css */
.notice_bar {
  background: rgba(0,200,160,0.1) !important;
  border-color: rgba(0,200,160,0.3) !important;
  color: var(--accent) !important;
}
.warning_bar {
  background: rgba(245,166,35,0.1) !important;
  border-color: rgba(245,166,35,0.3) !important;
  color: var(--accent-warm) !important;
}
.error_bar {
  background: rgba(220,50,50,0.1) !important;
  border-color: rgba(220,50,50,0.3) !important;
  color: #ff6b6b !important;
}

/* Status pills */
.open-status, [class*="status"] .label { background: var(--accent) !important; color: var(--bg-deep) !important; }
.closed-status { background: var(--text-dim) !important; }

/* Tab-like navigation on ticket view */
ul.tabs, .tab_nav {
  background: var(--bg-card) !important;
  border-color: var(--border) !important;
}
ul.tabs li a, .tab_nav a {
  color: var(--text-muted) !important;
}
ul.tabs li.active a, ul.tabs li a:hover, .tab_nav a:hover {
  color: var(--accent) !important;
  border-bottom-color: var(--accent) !important;
}

/* Dropdowns */
.dropdown-menu, .action-dropdown {
  background: var(--bg-card) !important;
  border: 1px solid var(--border) !important;
  box-shadow: 0 8px 24px rgba(0,0,0,0.4) !important;
  border-radius: 8px !important;
}
.dropdown-menu li a, .action-dropdown li a {
  color: var(--text-muted) !important;
  padding: 6px 12px;
}
.dropdown-menu li a:hover, .action-dropdown li a:hover {
  background: rgba(0,200,160,0.08) !important;
  color: var(--accent) !important;
}

/* Dialog / Modal */
.dialog, #popup, .ui-dialog {
  background: var(--bg-surface) !important;
  border: 1px solid var(--border) !important;
  border-radius: 12px !important;
  color: var(--text-main) !important;
}
.dialog h3, #popup h3, .ui-dialog-title {
  color: var(--text-main) !important;
  font-family: 'Syne', sans-serif;
}
.ui-dialog-titlebar {
  background: var(--bg-card) !important;
  border-bottom: 1px solid var(--border) !important;
  color: var(--text-main) !important;
}
.ui-widget-overlay {
  background: rgba(0,0,0,0.7) !important;
}
.ui-widget-content {
  background: var(--bg-surface) !important;
  color: var(--text-main) !important;
}

/* jQuery UI overrides */
.ui-state-default, .ui-widget-content .ui-state-default {
  background: var(--bg-card) !important;
  color: var(--text-muted) !important;
  border-color: var(--border) !important;
}
.ui-state-hover, .ui-widget-content .ui-state-hover {
  background: rgba(0,200,160,0.08) !important;
  color: var(--accent) !important;
  border-color: var(--accent) !important;
}
.ui-state-active, .ui-widget-content .ui-state-active {
  background: var(--accent) !important;
  color: var(--bg-deep) !important;
}

/* General table overrides */
table, tbody, tr, td, th {
  border-color: var(--border) !important;
}

/* ═══════════════════════════════════════════════════════════
   LANDING PAGE POLISH
   ═══════════════════════════════════════════════════════════ */

/* Landing page - hide sidebar buttons (using DB content buttons instead) */
#landing_page {
  text-align: center;
  max-width: 700px;
  margin: 0 auto;
}
#landing_page .sidebar .front-page-button {
  display: none !important;
}
#landing_page .sidebar {
  float: none !important;
  width: 100% !important;
  margin: 1.5rem auto 0 !important;
  max-width: 500px;
}
#landing_page .main-content {
  width: 100% !important;
  float: none !important;
}

/* Buttons - polished look */
.button, .button:visited,
a.button, a.button:visited,
input[type="submit"] {
  display: inline-block;
  padding: 10px 28px !important;
  border-radius: 8px !important;
  font-family: 'DM Sans', sans-serif !important;
  font-size: 14px !important;
  font-weight: 600 !important;
  letter-spacing: 0.3px;
  text-decoration: none !important;
  text-align: center;
  cursor: pointer;
  border: none !important;
  transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94) !important;
}
.green.button, .green.button:visited,
a.green.button, a.green.button:visited,
input[type="submit"] {
  background: var(--accent) !important;
  color: var(--bg-deep) !important;
  box-shadow: 0 0 20px rgba(0,200,160,0.15);
}
.green.button:hover, a.green.button:hover,
input[type="submit"]:hover {
  background: var(--accent-bright) !important;
  box-shadow: 0 0 30px rgba(0,200,160,0.3) !important;
  transform: translateY(-2px);
}
.blue.button, .blue.button:visited,
a.blue.button, a.blue.button:visited {
  background: var(--accent) !important;
  color: var(--bg-deep) !important;
  box-shadow: 0 0 20px rgba(0,200,160,0.15);
}
.blue.button:hover, a.blue.button:hover {
  background: var(--accent-bright) !important;
  box-shadow: 0 0 30px rgba(0,200,160,0.3) !important;
  transform: translateY(-2px);
}

/* Secondary button style */
a.button:not(.green):not(.blue),
a.button:not(.green):not(.blue):visited {
  background: transparent !important;
  color: var(--text-main) !important;
  border: 1px solid var(--border) !important;
}
a.button:not(.green):not(.blue):hover {
  border-color: var(--accent) !important;
  color: var(--accent) !important;
  background: rgba(0,200,160,0.06) !important;
  box-shadow: 0 0 20px rgba(0,200,160,0.1) !important;
  transform: translateY(-2px);
}

/* Navigation polish */
#nav li a {
  border-radius: 8px;
  font-weight: 500;
  transition: all 0.25s ease;
}

/* Content area polish */
#content h1:first-of-type {
  font-family: 'Syne', 'DM Sans', sans-serif !important;
  font-size: 1.8em !important;
  font-weight: 700 !important;
  letter-spacing: -0.5px;
  margin-bottom: 0.5rem;
}

/* Login card polish */
#clientLogin {
  border-radius: 12px !important;
  box-shadow: 0 8px 32px rgba(0,0,0,0.3) !important;
}
#clientLogin .login-box {
  border-right-color: var(--border) !important;
}
#clientLogin input[type="text"],
#clientLogin input[type="password"],
#clientLogin input[type="email"] {
  border-radius: 8px !important;
  padding: 10px 14px !important;
}

/* Form section headers */
table.form_table td.sectionbreak {
  font-family: 'Syne', sans-serif;
  font-weight: 600;
  color: var(--accent) !important;
  border-bottom: 2px solid var(--border);
  padding: 12px 0 8px;
}

/* Check ticket status form polish */
#ticketStatus {
  max-width: 480px;
  margin: 0 auto;
}

/* Label consistency */
form label, form .label-text {
  font-size: 13px;
  color: var(--text-muted) !important;
  margin-bottom: 4px;
}
form label.required {
  color: var(--text-main) !important;
}

/* Footer polish */
#footer {
  padding: 20px;
  font-size: 12px;
}
#footer p {
  margin: 0 0 4px;
}
