/* ============================================================
   WEISS IT-Ticket — Bootstrap 5 Overrides & Custom Components
   ============================================================ */

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

/* --- Brand color overrides --------------------------------- */
:root {
  --bs-primary:       #282e31;
  --bs-primary-rgb:   40, 46, 49;
  --bs-link-color:    #5a7e96;
  --weiss-accent:     #ffee00;
  --weiss-sidebar-bg: #282e31;
}

body { font-family: "Open Sans", sans-serif; }

.btn-primary {
  --bs-btn-bg:               #ffee00;
  --bs-btn-border-color:     #ffee00;
  --bs-btn-color:            #282e31;
  --bs-btn-hover-bg:         #e6d500;
  --bs-btn-hover-border-color: #e6d500;
  --bs-btn-hover-color:      #282e31;
  --bs-btn-active-bg:        #ccc000;
  --bs-btn-active-color:     #282e31;
  --bs-btn-focus-shadow-rgb: 255, 238, 0;
}
.btn-accent {
  background-color: #ffee00; border-color: #ffee00; color: #282e31;
}
.btn-accent:hover, .btn-accent:focus {
  background-color: #e6d500; border-color: #e6d500; color: #282e31;
}

a { color: #5a7e96; }
a:hover { color: #3f5d6e; }

/* --- Navbar ------------------------------------------------ */
.navbar-weiss { background-color: #282e31; }
.navbar-weiss .navbar-brand { color: #fff; font-weight: 700; }
.navbar-weiss .nav-link     { color: rgba(255,255,255,.8); }
.navbar-weiss .nav-link:hover { color: #ffee00; }
.logo-mark {
  width: 34px; height: 34px;
  background: #ffee00;
  border-radius: 6px;
  display: inline-flex; align-items: center; justify-content: center;
  font-weight: 900; font-size: .95rem; color: #282e31;
  flex-shrink: 0;
}

/* --- Admin layout ------------------------------------------ */
body { background-color: #f4f6f9; font-size: 0.9rem; }

#wrapper { min-height: 100vh; }

#sidebar-wrapper {
  min-width: 260px;
  width: 260px;
  flex-shrink: 0;
  background-color: #ffffff;
  border-right: 1px solid #e5e7eb;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
  transition: width 0.2s ease, min-width 0.2s ease;
  overflow-x: hidden;
}

#wrapper.sidebar-hidden #sidebar-wrapper {
  width: 0 !important;
  min-width: 0;
  border-right: none;
}

.sidebar-heading {
  background-color: #282e31;
  border-bottom: 3px solid #ffee00;
  height: 58px;
  flex-shrink: 0;
  color: #fff;
  text-decoration: none;
}

.sidebar-heading:hover {
  background-color: #1e2326;
  color: #fff;
}

.sidebar-brand-name {
  font-size: 0.92rem;
  color: #fff;
  letter-spacing: -0.01em;
}

.sidebar-version {
  font-size: 0.68rem;
  color: #a9b5bd;
}

.sidebar-link {
  display: block;
  padding: 0.52rem 1.1rem;
  font-size: 0.855rem;
  color: #374151;
  text-decoration: none;
  border-left: 3px solid transparent;
  transition: background-color 0.12s, color 0.12s;
}

.sidebar-link:hover {
  background-color: #f3f4f6;
  color: #111827;
}

.sidebar-link.active {
  background-color: #fffde0;
  color: #282e31;
  border-left-color: #ffee00;
  font-weight: 600;
}

.sidebar-link.active .sidebar-icon {
  color: #282e31;
}

.sidebar-icon {
  color: #9ca3af;
  width: 16px;
  text-align: center;
  transition: color 0.12s;
}

.sidebar-link:hover .sidebar-icon {
  color: #6b7280;
}

.sidebar-section-header {
  padding: 0.65rem 1.1rem 0.3rem;
  font-size: 0.68rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: #9ca3af;
  margin-top: 4px;
  border-top: 1px solid #f3f4f6;
}

.sidebar-bottom-links {
  margin-top: auto;
  border-top: 1px solid #e5e7eb;
  padding-bottom: 0.25rem;
}

.sidebar-bottom-links .sidebar-link {
  font-size: 0.82rem;
  color: #6b7280;
}

.sidebar-footer-user {
  padding: 0.85rem 1.1rem;
  border-top: 1px solid #e5e7eb;
  font-size: 0.82rem;
}

#page-content-wrapper {
  flex: 1;
  min-width: 0;
}


/* --- Status transition buttons ----------------------------- */
.btn-outline-secondary:hover,
.btn-outline-secondary:focus { color: #fff !important; }

/* --- CI comment trigger buttons ---------------------------- */
.btn-ci-reply {
  background: transparent;
  border: 1px solid #5a7e96;
  color: #5a7e96;
}
.btn-ci-reply:hover { background: #5a7e96; border-color: #5a7e96; color: #fff; }
.btn-ci-reply-active { background: #5a7e96; border-color: #5a7e96; color: #fff; }
.btn-ci-reply-active:hover { background: #4a6e86; border-color: #4a6e86; color: #fff; }

.btn-ci-internal {
  background: transparent;
  border: 1px solid #b8a000;
  color: #b8a000;
}
.btn-ci-internal:hover { background: #ffee00; border-color: #e6d500; color: #282e31; }
.btn-ci-internal-active { background: #ffee00; border-color: #e6d500; color: #282e31; }
.btn-ci-internal-active:hover { background: #e6d500; border-color: #ccc000; color: #282e31; }

/* --- Status & Priority badges ------------------------------ */
.badge-open        { background-color: #4e7fa0 !important; }
.badge-in_progress { background-color: #b87030 !important; }
.badge-waiting     { background-color: #9a8020 !important; }
.badge-resolved    { background-color: #3a8050 !important; }
.badge-closed      { background-color: #979ea3 !important; }

/* Fehler / Störung Workflow */
.badge-reopened                   { background-color: #a05828 !important; }
.badge-on_hold                    { background-color: #607585 !important; }
.badge-rueckfrage                 { background-color: #705090 !important; }
.badge-rueckfrage_intern_extern   { background-color: #3a8090 !important; }
.badge-antwort_intern_extern      { background-color: #3a8585 !important; }
.badge-customizing_offen          { background-color: #a07030 !important; }
.badge-customizing_in_bearbeitung { background-color: #906025 !important; }
.badge-pronavis_offen             { background-color: #4e7fa0 !important; }
.badge-pronavis_in_bearbeitung    { background-color: #3a6e8e !important; }
.badge-pronavis_erledigt          { background-color: #5a8fb0 !important; }
.badge-ams_offen                  { background-color: #3a8050 !important; }
.badge-ams_in_bearbeitung         { background-color: #2a7040 !important; }
.badge-ams_erledigt               { background-color: #4a9060 !important; }
.badge-sap_offen                  { background-color: #605090 !important; }
.badge-sap_in_bearbeitung         { background-color: #504080 !important; }
.badge-sap_erledigt               { background-color: #7060a0 !important; }
.badge-test_inhouse               { background-color: #3a7575 !important; }
.badge-test_key_user              { background-color: #2a6565 !important; }
.badge-rueckfrage_test            { background-color: #7a507a !important; }
.badge-test_abgenommen            { background-color: #3a7040 !important; }
.badge-p_transport                { background-color: #7a5a28 !important; }
.badge-p_test                     { background-color: #6a4a18 !important; }

.badge-prio-low      { background-color: #3a8050 !important; }
.badge-prio-medium   { background-color: #4e7fa0 !important; }
.badge-prio-high     { background-color: #b87030 !important; }
.badge-prio-critical { background-color: #9a3535 !important; }

/* --- Sidebar toggle button --------------------------------- */
#sidebarToggle {
  background: transparent;
  border: none;
  color: #6c757d;
  padding: 4px 8px;
  border-radius: 6px;
  flex-shrink: 0;
}
#sidebarToggle:hover { background: #f3f4f6; color: #374151; }

/* --- Mini sidebar toggle ----------------------------------- */
#sidebarMiniToggle {
  background: transparent;
  border: none;
  color: rgba(255,255,255,0.45);
  padding: 2px 6px;
  border-radius: 4px;
  flex-shrink: 0;
  transition: color 0.15s;
}
#sidebarMiniToggle:hover { color: #ffee00; }
#sidebarMiniToggle .chevron-mini { transition: transform 0.2s; }

#wrapper.sidebar-mini #sidebar-wrapper { min-width: 56px; width: 56px !important; }
#wrapper.sidebar-mini .sidebar-heading { justify-content: center; }
#wrapper.sidebar-mini .sidebar-brand-name,
#wrapper.sidebar-mini .sidebar-version { display: none; }
#wrapper.sidebar-mini .sidebar-section-header,
#wrapper.sidebar-mini .sidebar-section-toggle { display: none; }
#wrapper.sidebar-mini [id^="section-"] { display: block !important; height: auto !important; }
#wrapper.sidebar-mini .sidebar-link {
  font-size: 0;
  padding: 0.65rem 0;
  justify-content: center;
  border-left: none;
  border-bottom: 2px solid transparent;
}
#wrapper.sidebar-mini .sidebar-link .sidebar-icon {
  font-size: 1.05rem;
  margin: 0 !important;
  width: 56px;
  text-align: center;
}
#wrapper.sidebar-mini .sidebar-link.active {
  border-left: none;
  border-bottom-color: #ffee00;
}
#wrapper.sidebar-mini #sidebarMiniToggle .chevron-mini { transform: rotate(180deg); }

/* --- Mobile sidebar backdrop ------------------------------- */
#sidebar-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.45);
  z-index: 1049;
  cursor: pointer;
}

/* --- Sidebar collapsible section toggle -------------------- */
.sidebar-section-toggle {
  width: 100%;
  text-align: left;
  background: transparent;
  border: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
  padding: 0.65rem 1.1rem 0.3rem;
  font-size: 0.68rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: #9ca3af;
  margin-top: 4px;
  border-top: 1px solid #f3f4f6;
}
.sidebar-section-toggle:hover { background: #f9fafb; }
.sidebar-section-toggle .chevron {
  font-size: 0.6rem;
  opacity: 0.6;
  transition: transform 0.2s ease;
}
.sidebar-section-toggle[aria-expanded="false"] .chevron,
.sidebar-section-toggle.collapsed .chevron { transform: rotate(-90deg); }

/* --- Cards ------------------------------------------------- */
.card { border-radius: 10px; }
.card-header { border-radius: 10px 10px 0 0 !important; }

/* --- Tables ------------------------------------------------ */
.table th {
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.3px;
  color: #6c757d;
  white-space: nowrap;
}
.table td { vertical-align: middle; }

/* --- Form labels ------------------------------------------- */
.form-label.fw-semibold {
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 0.3px;
  color: #495057;
}

/* --- Sortable table headers -------------------------------- */
th.sortable-col {
  cursor: pointer;
  user-select: none;
  padding-right: 20px !important;
  position: relative;
}
th.sortable-col::after {
  content: "↕";
  position: absolute;
  right: 5px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 0.65em;
  opacity: 0.3;
}
th.sortable-col.sort-asc::after  { content: "↑"; opacity: 0.8; }
th.sortable-col.sort-desc::after { content: "↓"; opacity: 0.8; }
th.sortable-col:hover { background-color: #f3f4f6 !important; }

/* --- Table row hover actions ------------------------------- */
td.row-actions { opacity: 0.3; transition: opacity 0.15s; }
tr:hover td.row-actions { opacity: 1; }

/* --- CSV floating export button ---------------------------- */
.table-responsive { position: relative; }
.csv-float-btn {
  position: absolute;
  top: 6px;
  right: 8px;
  opacity: 0;
  transition: opacity 0.15s;
  z-index: 2;
}
.table-responsive:hover .csv-float-btn { opacity: 1; }

/* --- Progress bars ----------------------------------------- */
.progress { border-radius: 50px; }
.progress-bar { transition: width 0.6s ease; }

/* --- Stat cards -------------------------------------------- */
.stat-card {
  border-left: 4px solid #282e31;
  transition: box-shadow .15s;
}
.stat-card:hover { box-shadow: 0 4px 16px rgba(0,0,0,.12) !important; }
.stat-card.accent  { border-left-color: #ffee00; }
.stat-card.success { border-left-color: #3a8050; }
.stat-card.danger  { border-left-color: #9a3535; }
.stat-card.warning { border-left-color: #b87030; }
.stat-card.muted   { border-left-color: #979ea3; }

.stat-icon {
  width: 46px; height: 46px; border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.25rem; flex-shrink: 0;
}

/* --- Knowledge Base ---------------------------------------- */
.card-hover { transition: box-shadow .15s, transform .1s; cursor: pointer; }
.card-hover:hover { box-shadow: 0 4px 16px rgba(0,0,0,.1) !important; transform: translateY(-1px); }

.kb-content { line-height: 1.8; font-size: .96rem; }
.kb-content h1, .kb-content h2, .kb-content h3 { margin-top: 1.5rem; margin-bottom: .5rem; font-weight: 700; }
.kb-content h1 { font-size: 1.4rem; }
.kb-content h2 { font-size: 1.15rem; }
.kb-content h3 { font-size: 1rem; }
.kb-content p  { margin-top: 0; margin-bottom: .35rem; }
.kb-content ul, .kb-content ol { padding-left: 1.4rem; margin-bottom: .85rem; }
.kb-content li { margin-bottom: .25rem; }
.kb-content blockquote { border-left: 4px solid #282e31; padding: .5rem 1rem; margin: 1rem 0; background: #f0f3f5; border-radius: 0 .375rem .375rem 0; color: #374151; }
.kb-content pre, .kb-content code { background: #f4f6f9; border-radius: .375rem; }
.kb-content pre  { padding: .85rem 1rem; overflow-x: auto; font-size: .88rem; }
.kb-content code { padding: .1rem .35rem; font-size: .88rem; }
.kb-content a    { color: #5a7e96; text-decoration: underline; }
.kb-content a:hover { color: #3f5d6e; }
.kb-content img  { max-width: 100%; height: auto; border-radius: .375rem; margin: .5rem 0; }
.ql-editor img   { max-width: 100%; height: auto; }

/* --- Upload area ------------------------------------------- */
.upload-area {
  border: 2px dashed #ced4da;
  border-radius: .375rem;
  padding: 1.75rem 1.25rem;
  text-align: center;
  cursor: pointer;
  position: relative;
  background: #f8f9fa;
  transition: border-color .2s, background .2s;
}
.upload-area:hover, .upload-area.drag-over {
  border-color: #282e31; background: #f0f3f5;
}
.upload-area input[type="file"] {
  position: absolute; inset: 0; opacity: 0; cursor: pointer; width: 100%; height: 100%;
}
.file-item {
  display: flex; align-items: center; gap: .65rem;
  padding: .45rem .75rem;
  border: 1px solid #dee2e6; border-radius: .375rem;
  background: #fff; font-size: .88rem;
}
.file-thumb { width: 34px; height: 34px; object-fit: cover; border-radius: 4px; flex-shrink: 0; }
.file-name  { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file-size  { color: #6c757d; white-space: nowrap; font-size: .8rem; }
.file-remove { background: none; border: none; cursor: pointer; color: #9a3535; font-size: 1.1rem; line-height: 1; padding: 0 .2rem; }

/* --- Chat-style comments ---------------------------------- */
.chat-row { align-items: flex-start; }

.chat-avatar {
  width: 36px; height: 36px; border-radius: 50%; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: .9rem;
  background: #dde8ec; color: #282e31;
}
.chat-avatar-agent { background: #282e31; color: #fff; }
.chat-internal .chat-avatar-agent { background: #856404; color: #fff; }

.chat-bubble-wrap { max-width: 72%; }

.chat-meta {
  font-size: .76rem; color: #6c757d; margin-bottom: .3rem;
  display: flex; align-items: baseline; gap: .4rem; flex-wrap: wrap;
}
.chat-row.chat-agent .chat-meta { justify-content: flex-end; }

.chat-bubble {
  background: #f0f4f8; border: 1px solid #e2e8f0;
  border-radius: 0 .75rem .75rem .75rem;
  padding: .65rem .9rem; white-space: pre-wrap;
  font-size: .93rem; line-height: 1.6; word-break: break-word;
}
.chat-agent .chat-bubble {
  background: #dde8ec; border-color: #b0c8d4;
  border-radius: .75rem 0 .75rem .75rem;
}
.chat-internal .chat-bubble {
  background: #fffbf0; border-color: #ffe8a0;
  border-radius: .75rem 0 .75rem .75rem;
}

/* --- Ticket description box -------------------------------- */
.description-box {
  background: #f8f9fa; border: 1px solid #e9ecef;
  border-radius: .375rem; padding: .85rem 1rem;
  white-space: pre-wrap; line-height: 1.7; font-size: .95rem;
}

/* --- History ---------------------------------------------- */
.history-item {
  display: flex; gap: .7rem; align-items: flex-start;
  padding: .45rem 0; border-bottom: 1px solid #f0f0f0; font-size: .83rem;
}
.history-item:last-child { border-bottom: none; }
.history-dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: #282e31; margin-top: 5px; flex-shrink: 0;
}

/* --- Attachments ------------------------------------------ */
.attachment-thumb {
  width: 100px; border: 1px solid #dee2e6;
  border-radius: .375rem; overflow: hidden;
  text-align: center; font-size: .75rem;
  transition: box-shadow .15s;
}
.attachment-thumb:hover { box-shadow: 0 2px 8px rgba(0,0,0,.12); }
.attachment-thumb a { display: block; color: #6c757d; text-decoration: none; }
.attachment-thumb img { width: 100%; height: 72px; object-fit: cover; display: block; }
.attachment-thumb .att-icon { height: 72px; display: flex; align-items: center; justify-content: center; font-size: 1.75rem; color: #adb5bd; }
.attachment-thumb .att-name { padding: .3rem .4rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* --- Login ------------------------------------------------- */
.login-card-header {
  background: #282e31; color: #fff;
  padding: 2rem; text-align: center; border-radius: .5rem .5rem 0 0;
}
.login-card-header .logo-mark { width: 50px; height: 50px; font-size: 1.4rem; margin: 0 auto .75rem; }
.login-card-header h1 { color: #fff; font-size: 1.3rem; margin: 0; }
.login-card-header p  { opacity: .75; font-size: .88rem; margin: .2rem 0 0; }

/* --- Hero -------------------------------------------------- */
.hero {
  background: linear-gradient(135deg, #282e31 0%, #3a4144 100%);
  color: #fff; padding: 3rem 0 2.5rem; text-align: center;
}
.hero h1 { color: #fff; }
.hero p   { opacity: .8; }

/* --- Responsive -------------------------------------------- */
@media (max-width: 768px) {
  #sidebar-wrapper {
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    z-index: 1050;
    width: 260px;
    transform: translateX(-100%);
    transition: transform 0.25s ease;
  }
  #wrapper.sidebar-mobile-open #sidebar-wrapper {
    transform: translateX(0);
    box-shadow: 4px 0 20px rgba(0,0,0,.18);
  }
  #wrapper.sidebar-mobile-open #sidebar-backdrop { display: block; }
  #page-content-wrapper { width: 100%; }
}

/* --- Absent-agent row highlight ---------------------------- */
tr.ticket-absent-agent td {
  background-color: rgba(255, 238, 0, 0.08);
  border-left: 3px solid #b8a000;
}
tr.ticket-absent-agent:hover td {
  background-color: rgba(255, 238, 0, 0.15);
}

/* ============================================================
   Dark mode overrides  (Bootstrap 5.3 data-bs-theme="dark")
   ============================================================ */

[data-bs-theme="dark"] body { background-color: #0d1117; }

/* Topbar */
[data-bs-theme="dark"] nav.navbar.bg-white {
  background-color: #161b22 !important;
  border-bottom-color: #30363d !important;
}

/* Sidebar */
[data-bs-theme="dark"] #sidebar-wrapper {
  background-color: #161b22;
  border-right-color: #30363d;
}
[data-bs-theme="dark"] .sidebar-heading {
  background-color: #282e31;
  border-bottom-color: #ffee00;
  color: #fff;
}
[data-bs-theme="dark"] .sidebar-heading:hover {
  background-color: #1e2326;
  color: #fff;
}
[data-bs-theme="dark"] .sidebar-brand-name { color: #fff; }
[data-bs-theme="dark"] .sidebar-link       { color: #8b949e; }
[data-bs-theme="dark"] .sidebar-link:hover { background-color: #21262d; color: #e6edf3; }
[data-bs-theme="dark"] .sidebar-link.active {
  background-color: #282500; color: #ffee00; border-left-color: #ffee00;
}
[data-bs-theme="dark"] .sidebar-link.active .sidebar-icon { color: #ffee00; }
[data-bs-theme="dark"] .sidebar-icon                      { color: #6e7681; }
[data-bs-theme="dark"] .sidebar-link:hover .sidebar-icon  { color: #8b949e; }
[data-bs-theme="dark"] .sidebar-section-header { color: #6e7681; border-top-color: #21262d; }
[data-bs-theme="dark"] .sidebar-bottom-links   { border-top-color: #30363d; }
[data-bs-theme="dark"] .sidebar-bottom-links .sidebar-link { color: #6e7681; }
[data-bs-theme="dark"] .sidebar-footer-user    { border-top-color: #30363d; }

/* Sidebar toggle */
[data-bs-theme="dark"] #sidebarToggle { color: #8b949e; }
[data-bs-theme="dark"] #sidebarToggle:hover { background: #21262d; color: #e6edf3; }

/* Mini sidebar toggle */
[data-bs-theme="dark"] #sidebarMiniToggle { color: rgba(255,255,255,0.35); }
[data-bs-theme="dark"] #sidebarMiniToggle:hover { color: #ffee00; }
[data-bs-theme="dark"] #wrapper.sidebar-mini .sidebar-link.active { border-bottom-color: #ffee00; }

/* Collapsible section toggles */
[data-bs-theme="dark"] .sidebar-section-toggle { color: #6e7681; border-top-color: #21262d; }
[data-bs-theme="dark"] .sidebar-section-toggle:hover { background: #21262d; }

/* Sortable headers */
[data-bs-theme="dark"] th.sortable-col:hover { background-color: #21262d !important; }

/* Form labels */
[data-bs-theme="dark"] .form-label.fw-semibold { color: #8b949e; }

/* Cards */
[data-bs-theme="dark"] .card { background-color: #161b22; border-color: #30363d; }
[data-bs-theme="dark"] .card-header { background-color: #161b22 !important; border-bottom-color: #30363d; }

/* KB search input */
[data-bs-theme="dark"] .input-group-text.bg-white {
  background-color: var(--bs-body-bg) !important;
  border-color: var(--bs-border-color) !important;
  color: var(--bs-body-color) !important;
}

/* Chat bubbles */
[data-bs-theme="dark"] .chat-bubble {
  background: #21262d; border-color: #30363d; color: #e6edf3;
}
[data-bs-theme="dark"] .chat-agent .chat-bubble    { background: #1a2830; border-color: #282e31; }
[data-bs-theme="dark"] .chat-internal .chat-bubble { background: #2d2415; border-color: #4d3c10; }
[data-bs-theme="dark"] .chat-avatar { background: #21262d; color: #7aaec8; }

/* Description box */
[data-bs-theme="dark"] .description-box {
  background: #161b22; border-color: #30363d; color: #e6edf3;
}

/* History */
[data-bs-theme="dark"] .history-item { border-bottom-color: #21262d; }

/* Attachments */
[data-bs-theme="dark"] .attachment-thumb { background: #161b22; border-color: #30363d; }
[data-bs-theme="dark"] .attachment-thumb a { color: #8b949e; }

/* File upload */
[data-bs-theme="dark"] .file-item    { background: #161b22; border-color: #30363d; }
[data-bs-theme="dark"] .upload-area  { background: #161b22; border-color: #30363d; }
[data-bs-theme="dark"] .upload-area:hover,
[data-bs-theme="dark"] .upload-area.drag-over { background: #1e2326; border-color: #282e31; }

/* KB content */
[data-bs-theme="dark"] .kb-content blockquote {
  background: #1e2326; border-left-color: #5a7e96; color: #8b949e;
}
[data-bs-theme="dark"] .kb-content pre,
[data-bs-theme="dark"] .kb-content code { background: #161b22; color: #e6edf3; }

/* Absent-agent row */
[data-bs-theme="dark"] tr.ticket-absent-agent td       { background-color: rgba(255,238,0,.06); }
[data-bs-theme="dark"] tr.ticket-absent-agent:hover td { background-color: rgba(255,238,0,.11); }

/* Table headers — Bootstrap applies bg on th/td cells, not thead */
[data-bs-theme="dark"] thead.table-light > tr > th,
[data-bs-theme="dark"] thead.table-light > tr > td {
  --bs-table-bg:           #21262d;
  --bs-table-border-color: #30363d;
  background-color: #21262d !important;
  color: #e6edf3 !important;
  border-color: #30363d !important;
}
/* Plain thead (no table-light) */
[data-bs-theme="dark"] thead > tr > th {
  background-color: #21262d;
  color: #e6edf3;
  border-color: #30363d;
}

/* Bootstrap utility classes that ignore data-bs-theme */
[data-bs-theme="dark"] .text-dark          { color: #e6edf3 !important; }
[data-bs-theme="dark"] .bg-white           { background-color: #161b22 !important; }
[data-bs-theme="dark"] .bg-light           { background-color: #21262d !important; }
[data-bs-theme="dark"] .badge.bg-light     { color: #e6edf3 !important; }
[data-bs-theme="dark"] .card-header.bg-white {
  background-color: #161b22 !important;
  border-bottom-color: #30363d !important;
}

/* Links */
[data-bs-theme="dark"] a                    { color: #7aaec8; }
[data-bs-theme="dark"] a:hover              { color: #ffee00; }
[data-bs-theme="dark"] a.btn-primary,
[data-bs-theme="dark"] a.btn-primary:hover  { color: #282e31; }
[data-bs-theme="dark"] a.btn-secondary,
[data-bs-theme="dark"] a.btn-secondary:hover { color: #282e31; }
[data-bs-theme="dark"] .sidebar-link        { color: #8b949e; }
[data-bs-theme="dark"] .sidebar-link:hover  { color: #e6edf3; }

/* Quill editor */
[data-bs-theme="dark"] .ql-toolbar.ql-snow,
[data-bs-theme="dark"] .ql-container.ql-snow {
  border-color: #30363d;
  background-color: #161b22;
}
[data-bs-theme="dark"] .ql-editor {
  color: #e6edf3;
}
[data-bs-theme="dark"] .ql-editor.ql-blank::before {
  color: #6e7681;
}
[data-bs-theme="dark"] .ql-toolbar .ql-stroke {
  stroke: #8b949e;
}
[data-bs-theme="dark"] .ql-toolbar .ql-fill,
[data-bs-theme="dark"] .ql-toolbar .ql-stroke.ql-fill {
  fill: #8b949e;
}
[data-bs-theme="dark"] .ql-toolbar button:hover .ql-stroke,
[data-bs-theme="dark"] .ql-toolbar button.ql-active .ql-stroke,
[data-bs-theme="dark"] .ql-toolbar .ql-picker-label:hover .ql-stroke {
  stroke: #e6edf3;
}
[data-bs-theme="dark"] .ql-toolbar button:hover .ql-fill,
[data-bs-theme="dark"] .ql-toolbar button.ql-active .ql-fill {
  fill: #e6edf3;
}
[data-bs-theme="dark"] .ql-toolbar button:hover,
[data-bs-theme="dark"] .ql-toolbar button.ql-active {
  color: #e6edf3;
}
[data-bs-theme="dark"] .ql-toolbar .ql-picker-label {
  color: #8b949e;
}
[data-bs-theme="dark"] .ql-toolbar .ql-picker-options {
  background-color: #21262d;
  border-color: #30363d;
}
[data-bs-theme="dark"] .ql-toolbar .ql-picker-item { color: #8b949e; }
[data-bs-theme="dark"] .ql-toolbar .ql-picker-item:hover { color: #e6edf3; }
