/* ClawTrack styles — theme-aware via [data-theme] */

:root {
  --ct-accent: #3b82f6;
  --ct-accent-green: #7bc043;
  --ct-radius: 10px;
}

/* Light theme (default) */
[data-theme="light"] {
  --ct-bg:             #f5f6f8;
  --ct-surface:        #ffffff;
  --ct-surface-2:      #fafbfd;
  --ct-border:         #e6e9ef;
  --ct-text:           #1a1f2e;
  --ct-text-muted:     #8892a8;
  --ct-sidebar-bg:     #1f2a44;
  --ct-sidebar-hover:  #2a3758;
  --ct-sidebar-active: #3b82f6;
  --ct-sidebar-text:   #e6ebf5;
  --ct-sidebar-muted:  #8892a8;
  --ct-input-bg:       #ffffff;
  --ct-input-border:   #d6dae3;
  --ct-tag-bg:         #e9eef7;
  --ct-tag-text:       #2a3758;
  --ct-bar-bg:         #eef0f4;
  --ct-bar-fill-1:     #60a5fa;
  --ct-bar-fill-2:     #3b82f6;
  --ct-shadow:         0 2px 8px rgba(0,0,0,0.04);
}

/* Dark theme (Clockify-style) */
[data-theme="dark"] {
  --ct-bg:             #121a2a;
  --ct-surface:        #1a2332;
  --ct-surface-2:      #222d3f;
  --ct-border:         #2a3548;
  --ct-text:           #e6ebf5;
  --ct-text-muted:     #8892a8;
  --ct-sidebar-bg:     #0f1824;
  --ct-sidebar-hover:  #1a2332;
  --ct-sidebar-active: #7bc043;
  --ct-sidebar-text:   #e6ebf5;
  --ct-sidebar-muted:  #6b7689;
  --ct-input-bg:       #222d3f;
  --ct-input-border:   #344057;
  --ct-tag-bg:         #2a3548;
  --ct-tag-text:       #c8d0dd;
  --ct-bar-bg:         #222d3f;
  --ct-bar-fill-1:     #a0d563;
  --ct-bar-fill-2:     #7bc043;
  --ct-shadow:         0 2px 8px rgba(0,0,0,0.2);
}

/* Default to dark on pages without explicit attr (edge cases) */
:root { color-scheme: light dark; }

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background: var(--ct-bg, #f5f6f8);
  color: var(--ct-text, #1a1f2e);
}

/* --- Auth (login/register) --- */
.ct-auth-wrap {
  min-height: 100vh;
  display: flex; align-items: center; justify-content: center;
  padding: 24px;
}
.ct-auth-card {
  background: var(--ct-surface);
  padding: 32px;
  border-radius: 12px;
  box-shadow: 0 10px 30px rgba(0,0,0,0.18);
  width: 100%; max-width: 420px;
  border: 1px solid var(--ct-border);
}
.ct-auth-card h1 { font-size: 1.5rem; margin-bottom: 4px; color: var(--ct-text); }
.ct-auth-card .muted { color: var(--ct-text-muted); margin-bottom: 24px; font-size: 0.95rem; }

/* --- Layout --- */
.ct-layout { display: flex; min-height: 100vh; }
.ct-sidebar {
  width: 240px;
  background: var(--ct-sidebar-bg);
  color: var(--ct-sidebar-text);
  display: flex; flex-direction: column;
  padding: 20px 0;
  flex-shrink: 0;
}
.ct-brand {
  display: flex; align-items: center; gap: 10px;
  padding: 0 20px 20px;
  border-bottom: 1px solid rgba(255,255,255,0.08);
  font-weight: 600; font-size: 1.15rem;
}
.ct-brand-mark { font-size: 1.4rem; }
.ct-nav { display: flex; flex-direction: column; padding: 12px 10px; flex-grow: 1; }
.ct-nav-item {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 14px;
  border-radius: 8px;
  color: var(--ct-sidebar-text);
  text-decoration: none;
  font-size: 0.95rem;
  margin-bottom: 4px;
  transition: background 120ms;
}
.ct-nav-item:hover { background: var(--ct-sidebar-hover); color: #fff; }
.ct-nav-item.active { background: var(--ct-sidebar-active); color: #fff; }
.ct-nav-icon { width: 22px; text-align: center; }
.ct-sidebar-footer { padding: 14px 20px; border-top: 1px solid rgba(255,255,255,0.08); }

.ct-user-email {
  font-size: 0.9rem;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  color: #fff; font-weight: 500;
}
.ct-user-sub {
  font-size: 0.78rem;
  color: var(--ct-sidebar-muted);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.ct-nav-section {
  padding: 14px 14px 6px;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--ct-sidebar-muted);
}

.ct-main { flex-grow: 1; padding: 28px 36px; overflow-x: auto; background: var(--ct-bg); }
.ct-main h1 { font-size: 1.5rem; margin-top: 0; color: var(--ct-text); }

/* --- Cards & tables --- */
.ct-card {
  background: var(--ct-surface);
  border: 1px solid var(--ct-border);
  border-radius: var(--ct-radius);
  padding: 20px 24px;
  box-shadow: var(--ct-shadow);
  margin-bottom: 20px;
  color: var(--ct-text);
}
.ct-card h5 { color: var(--ct-text); }
.ct-card .form-label { color: var(--ct-text); }

table.ct-table { width: 100%; border-collapse: collapse; color: var(--ct-text); }
table.ct-table th, table.ct-table td {
  padding: 10px 12px; text-align: left;
  border-bottom: 1px solid var(--ct-border);
  font-size: 0.95rem; vertical-align: middle;
}
table.ct-table th {
  color: var(--ct-text-muted); font-weight: 600;
  font-size: 0.85rem; text-transform: uppercase; letter-spacing: 0.03em;
}
table.ct-table tr:last-child td { border-bottom: none; }

.ct-tag {
  display: inline-block; padding: 2px 8px; border-radius: 999px;
  background: var(--ct-tag-bg); color: var(--ct-tag-text);
  font-size: 0.8rem; margin-right: 4px;
}
.ct-inline-form { display: inline; }
.ct-muted-small { color: var(--ct-text-muted); font-size: 0.85rem; }

/* Form controls follow theme */
[data-theme="dark"] .form-control,
[data-theme="dark"] .form-select {
  background-color: var(--ct-input-bg);
  border-color: var(--ct-input-border);
  color: var(--ct-text);
}
[data-theme="dark"] .form-control::placeholder { color: var(--ct-text-muted); }
[data-theme="dark"] .form-control:focus,
[data-theme="dark"] .form-select:focus {
  background-color: var(--ct-input-bg);
  border-color: var(--ct-accent);
  color: var(--ct-text);
  box-shadow: 0 0 0 0.25rem rgba(59,130,246,0.25);
}
[data-theme="dark"] .input-group-text {
  background-color: var(--ct-surface-2);
  border-color: var(--ct-input-border);
  color: var(--ct-text-muted);
}
[data-theme="dark"] .btn-outline-primary { color: #a0d563; border-color: #a0d563; }
[data-theme="dark"] .btn-outline-primary:hover { background: #7bc043; border-color: #7bc043; color: #0f1824; }
[data-theme="dark"] .btn-primary { background: #7bc043; border-color: #7bc043; color: #0f1824; }
[data-theme="dark"] .btn-primary:hover { background: #8ecf55; border-color: #8ecf55; color: #0f1824; }

/* --- Timer inline form --- */
.ct-timer-inline {
  display: grid;
  grid-template-columns: minmax(200px, 2fr) minmax(140px, 1fr) minmax(140px, 1fr) 130px 90px 90px auto;
  gap: 8px;
  align-items: stretch;
}
.ct-timer-inline .form-control,
.ct-timer-inline .form-select { height: 42px; }
.ct-timer-inline button { height: 42px; white-space: nowrap; padding: 0 18px; }
@media (max-width: 1200px) {
  .ct-timer-inline { grid-template-columns: 1fr 1fr 1fr; }
  .ct-timer-inline button { grid-column: 1 / -1; }
}

.ct-material-addrow {
  display: grid;
  grid-template-columns: 1fr 100px auto;
  gap: 8px;
  align-items: stretch;
}
.ct-material-addrow .form-control { height: 42px; }
.ct-material-addrow button { height: 42px; white-space: nowrap; }

.ct-material-item {
  display: grid;
  grid-template-columns: 1fr 80px 120px 30px;
  gap: 12px;
  align-items: center;
  padding: 8px 12px;
  background: var(--ct-surface-2);
  border: 1px solid var(--ct-border);
  border-radius: 6px;
}
.ct-material-item .ct-material-name { font-weight: 500; }
.ct-material-item .ct-material-qty { color: var(--ct-text-muted); font-size: 0.9rem; }
.ct-material-item .ct-material-price { text-align: right; font-weight: 600; }
.ct-material-item .ct-material-remove {
  color: var(--ct-text-muted); text-decoration: none; font-size: 1rem;
  text-align: center;
}
.ct-material-item .ct-material-remove:hover { color: #ef4444; }

.ct-tabs .nav-link {
  padding: 6px 14px; font-size: 0.9rem;
  color: var(--ct-text-muted);
  border-radius: 6px;
}
.ct-tabs .nav-link:hover { color: var(--ct-text); }
.ct-tabs .nav-link.active {
  background: var(--ct-sidebar-active);
  color: #fff;
}
.ct-tab-count {
  display: inline-block; margin-left: 6px;
  background: rgba(255,255,255,0.2);
  padding: 0 6px; border-radius: 10px; font-size: 0.75rem;
}
.ct-tabs .nav-link:not(.active) .ct-tab-count {
  background: var(--ct-tag-bg);
  color: var(--ct-text-muted);
}

tr.ct-row-self td { background: rgba(123, 192, 67, 0.06); }
tr.ct-row-pending td { background: rgba(234, 179, 8, 0.08); }
tr.ct-row-manual td { background: rgba(59, 130, 246, 0.05); }

/* v9.15: Pagination auf Admin-Einträge */
.ct-pagination {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  padding-top: 6px;
  border-top: 1px solid var(--ct-border);
  margin-top: 12px;
}
.ct-pagination .disabled {
  pointer-events: none;
  opacity: 0.4;
}
.ct-pagination-pages {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.ct-pagination-link {
  display: inline-block;
  min-width: 32px;
  text-align: center;
  padding: 4px 8px;
  border-radius: 4px;
  color: var(--ct-text-muted);
  text-decoration: none;
  border: 1px solid transparent;
}
.ct-pagination-link:hover {
  background: var(--ct-surface-2);
  color: var(--ct-text);
  border-color: var(--ct-border);
}
.ct-pagination-current {
  display: inline-block;
  min-width: 32px;
  text-align: center;
  padding: 4px 8px;
  border-radius: 4px;
  background: var(--ct-accent-green);
  color: #fff;
}

/* --- Dashboard --- */
.ct-kpi { display: flex; flex-direction: column; }
.ct-big-number {
  font-size: 1.8rem; font-weight: 600;
  margin-top: 4px; color: var(--ct-text); white-space: nowrap;
}

.ct-chart {
  display: grid;
  grid-template-columns: 60px 1fr;
  gap: 8px;
  height: 320px;
}
.ct-chart-scale {
  display: flex; flex-direction: column; justify-content: space-between;
  padding: 20px 0 22px 0;
  position: relative;
}
.ct-chart-tick {
  font-size: 0.72rem;
  color: var(--ct-text-muted);
  text-align: right;
  line-height: 1;
  transform: translateY(-50%);
}
.ct-chart-tick:first-child { transform: translateY(0); }
.ct-chart-tick:last-child { transform: translateY(-100%); }

.ct-chart-plot {
  position: relative;
  padding-top: 20px;
}
.ct-chart-gridlines {
  position: absolute;
  inset: 20px 0 22px 0;
  display: flex; flex-direction: column; justify-content: space-between;
  pointer-events: none;
}
.ct-chart-gridline {
  border-top: 1px dashed var(--ct-border);
  opacity: 0.5;
}
.ct-chart-gridline:first-child,
.ct-chart-gridline:last-child { border-top: 1px solid var(--ct-border); opacity: 0.8; }

.ct-bars {
  display: grid;
  grid-template-columns: repeat(var(--bar-count, 12), minmax(0, 1fr));
  gap: 6px;
  align-items: end;
  height: 100%;
  position: relative;
}
.ct-bar {
  display: flex; flex-direction: column; align-items: center;
  height: 100%;
  justify-content: flex-end;
}
.ct-bar-value {
  font-size: 0.68rem;
  color: var(--ct-text);
  margin-bottom: 2px;
  line-height: 1;
  white-space: nowrap;
  font-weight: 500;
  min-height: 10px;
}
.ct-bar-track {
  width: 100%;
  background: transparent;
  position: relative; overflow: visible;
  display: flex; align-items: flex-end;
  flex: 1;
}
.ct-bar-fill {
  width: 100%;
  background: linear-gradient(180deg, var(--ct-bar-fill-1), var(--ct-bar-fill-2));
  border-radius: 4px 4px 0 0;
  transition: height 200ms;
}
.ct-bar-label {
  font-size: 0.72rem; color: var(--ct-text-muted);
  margin-top: 4px; white-space: nowrap;
  line-height: 1;
}
@media (max-width: 720px) {
  .ct-chart { height: 220px; grid-template-columns: 40px 1fr; }
  .ct-bar-label { font-size: 0.62rem; }
  .ct-bar-value { font-size: 0.6rem; }
  .ct-chart-tick { font-size: 0.6rem; }
}

/* --- Donut + breakdown --- */
.ct-donut-wrap {
  display: grid;
  grid-template-columns: 300px 1fr;
  gap: 24px;
  align-items: center;
}
@media (max-width: 900px) { .ct-donut-wrap { grid-template-columns: 1fr; } }
.ct-donut-outer { position: relative; width: 260px; height: 260px; margin: 0 auto; }
.ct-donut-center {
  position: absolute; inset: 0;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  text-align: center; pointer-events: none;
}
.ct-donut-center .ct-big-number { font-size: 1.4rem; margin: 0; }
.ct-donut-center .ct-muted-small { font-size: 0.75rem; }

.ct-breakdown-list { display: flex; flex-direction: column; gap: 10px; max-height: 260px; overflow-y: auto; padding-right: 6px; }
.ct-breakdown-row { display: grid; grid-template-columns: 14px 1fr auto; gap: 10px; align-items: center; }
.ct-breakdown-dot { width: 12px; height: 12px; border-radius: 50%; }
.ct-breakdown-main { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.ct-breakdown-head { display: flex; justify-content: space-between; gap: 8px; font-size: 0.9rem; }
.ct-breakdown-name { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ct-breakdown-time { color: var(--ct-text-muted); }
.ct-breakdown-bar { height: 6px; background: var(--ct-bar-bg); border-radius: 3px; overflow: hidden; }
.ct-breakdown-bar-fill { height: 100%; background: var(--ct-bar-fill-2); }
.ct-breakdown-amount { font-weight: 600; white-space: nowrap; }

/* --- Date range picker (custom) --- */
.ct-daterange { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.ct-daterange .form-control { max-width: 160px; }

/* --- Mobile sidebar --- */
@media (max-width: 720px) {
  .ct-layout { flex-direction: column; }
  .ct-sidebar { width: 100%; flex-direction: row; padding: 8px; }
  .ct-brand { border: none; padding: 8px 12px; }
  .ct-nav { flex-direction: row; flex-wrap: wrap; padding: 8px; }
  .ct-sidebar-footer { border: none; padding: 8px 12px; }
  .ct-user { display: none; }
  .ct-main { padding: 16px; }
}

/* Scrollbar in dark mode */
[data-theme="dark"] .ct-breakdown-list::-webkit-scrollbar { width: 8px; }
[data-theme="dark"] .ct-breakdown-list::-webkit-scrollbar-thumb { background: var(--ct-border); border-radius: 4px; }

/* --- Timer: Wochen-/Tagesgruppen --- */
.ct-entries-section { margin-top: 8px; }
.ct-week-header {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--ct-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin: 22px 0 10px;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--ct-border);
}
.ct-week-header:first-child { margin-top: 4px; }
.ct-day-card { padding: 0; overflow: hidden; }
.ct-day-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 16px;
  background: var(--ct-surface-2);
  border-bottom: 1px solid var(--ct-border);
  font-size: 0.9rem;
}
.ct-day-date { font-weight: 600; color: var(--ct-text); }
.ct-day-total { color: var(--ct-text-muted); font-variant-numeric: tabular-nums; }
.ct-day-table { margin: 0; }
.ct-day-table tbody tr:last-child td { border-bottom: 0; }
.ct-day-table td { padding: 10px 16px; vertical-align: middle; }

/* --- Admin-Abrechnung --- */
.ct-billing-totals {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 18px;
}
@media (max-width: 900px) { .ct-billing-totals { grid-template-columns: repeat(2, 1fr); } }
.ct-billing-stat {
  background: var(--ct-surface-2);
  border: 1px solid var(--ct-border);
  border-radius: var(--ct-radius);
  padding: 14px 16px;
}
.ct-billing-stat-label { font-size: 0.75rem; color: var(--ct-text-muted); text-transform: uppercase; letter-spacing: 0.04em; }
.ct-billing-stat-value { font-size: 1.4rem; font-weight: 600; margin-top: 4px; font-variant-numeric: tabular-nums; }
.ct-billing-section { margin-top: 28px; }
.ct-billing-section h5 { margin-bottom: 10px; }

/* v9.12: HTML-View im Ticket-Thread */
.ct-view-toggle .ct-view-btn {
  padding: 2px 10px;
  font-size: 0.75rem;
}
.ct-view-toggle .ct-view-btn.active {
  background: var(--ct-accent-green);
  color: #fff;
  border-color: var(--ct-accent-green);
}
.ct-msg-body-html {
  background: var(--ct-surface-2);
  border: 1px solid var(--ct-border);
  border-radius: 6px;
  padding: 12px 14px;
  max-width: 100%;
  overflow-x: auto;
  color: var(--ct-text);
  font-size: 0.92rem;
  line-height: 1.5;
}
.ct-msg-body-html .ct-html-content {
  max-width: 100%;
  overflow-wrap: anywhere;
}
.ct-msg-body-html .ct-html-content img {
  max-width: 100%;
  height: auto;
}
.ct-msg-body-html .ct-html-content a {
  color: var(--ct-accent-blue, #3b82f6);
  text-decoration: underline;
}
.ct-msg-body-html .ct-html-content table {
  border-collapse: collapse;
  max-width: 100%;
}
.ct-msg-body-html .ct-html-content blockquote {
  border-left: 3px solid var(--ct-border);
  padding-left: 10px;
  color: var(--ct-text-muted);
  margin: 8px 0;
}
.ct-img-warning {
  background: rgba(234, 179, 8, 0.15);
  border: 1px solid rgba(234, 179, 8, 0.4);
  border-radius: 6px;
  padding: 8px 12px;
  margin-bottom: 10px;
  font-size: 0.85rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

/* v9.11: Collapse-Toggle im Ticket-Thread */
.ct-msg-toggle-wrap {
  display: flex;
  justify-content: center;
  margin: 14px 0;
  position: relative;
}
.ct-msg-toggle-wrap::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 0; right: 0;
  height: 1px;
  background: var(--ct-border);
  z-index: 0;
}
.ct-msg-toggle {
  position: relative;
  z-index: 1;
  background: var(--ct-surface);
  border: 1px solid var(--ct-border);
  color: var(--ct-text-muted);
  padding: 6px 16px;
  border-radius: 999px;
  font-size: 0.85rem;
  cursor: pointer;
  transition: all 0.15s ease;
}
.ct-msg-toggle:hover {
  background: var(--ct-surface-2);
  color: var(--ct-text);
  border-color: var(--ct-accent-green);
}

/* Bezahlte Zeilen in der Abrechnung */
.ct-table tr.ct-paid td {
  opacity: 0.45;
  text-decoration: line-through;
  text-decoration-color: var(--ct-text-muted);
}
.ct-table tr.ct-paid td:last-child {
  opacity: 1;
  text-decoration: none;
}

/* Abgerechnete Kunden (monats-spezifisch) */
.ct-table tr.ct-client-marked td {
  opacity: 0.45;
  text-decoration: line-through;
  text-decoration-color: var(--ct-text-muted);
  background: rgba(34, 197, 94, 0.05);
}
.ct-table tr.ct-client-marked td:last-child {
  opacity: 1;
  text-decoration: none;
}
.ct-table tr.ct-client-marked td a {
  color: var(--ct-text-muted);
}

/* --- Ticket-Thread --- */
.ct-ticket-msg {
  border-left: 4px solid var(--ct-border);
}
.ct-ticket-msg.ct-msg-in {
  border-left-color: #60a5fa;
}
.ct-ticket-msg.ct-msg-out {
  border-left-color: var(--ct-accent-green);
  background: var(--ct-surface-2);
}
.ct-msg-body {
  white-space: pre-wrap;
  word-wrap: break-word;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.85rem;
  background: var(--ct-bg);
  padding: 10px 12px;
  border-radius: 6px;
  margin: 0;
  color: var(--ct-text);
  max-height: 500px;
  overflow-y: auto;
}

/* Interne Notizen — dunkelrot */
/* v9.4: Interne Notizen — leichter weinroter Hintergrund auf der ganzen Card */
.ct-ticket-msg.ct-msg-internal {
  border-left-color: #b91c1c;
  background: rgba(136, 19, 55, 0.18); /* wine red, dezent */
}
[data-theme="light"] .ct-ticket-msg.ct-msg-internal {
  background: rgba(190, 18, 60, 0.08);
}
.ct-ticket-msg.ct-msg-internal .ct-msg-body {
  background: transparent;
  color: inherit;
  border: none;
  padding-left: 0;
}
.ct-internal-form {
  border-left: 4px solid #b91c1c;
}

/* --- Pending Tickets im Timer --- */
.ct-pending-tickets {
  border-left: 4px solid #eab308; /* amber */
}
.ct-pending-tickets table { margin-bottom: 0; }
.ct-pending-tickets tbody tr:hover { background: var(--ct-surface-2); }

/* Live-Timer Widget (v8.9) */
.ct-live-timer {
  border-left: 4px solid var(--ct-accent-green);
}
.ct-live-timer-running {
  border-left-color: #ef4444; /* red pulse */
}
.ct-live-icon {
  font-size: 1.3em;
  color: var(--ct-accent-green);
  margin-right: 4px;
}
.ct-live-label {
  font-size: 0.85em;
  color: var(--ct-text-muted);
  margin-bottom: 2px;
}
.ct-live-desc {
  font-size: 1.15em;
  font-weight: 600;
  color: var(--ct-text);
  margin-bottom: 2px;
}
.ct-live-clock {
  font-family: ui-monospace, "SF Mono", Consolas, monospace;
  font-size: 1.8em;
  font-weight: 600;
  color: #ef4444;
  min-width: 120px;
  text-align: right;
  letter-spacing: 0.5px;
}
/* Ticket Attachments (v9) */
.ct-attachments {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.ct-attachment-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  background: var(--ct-tag-bg);
  color: var(--ct-tag-text);
  border-radius: 16px;
  font-size: 0.9em;
  text-decoration: none;
  border: 1px solid var(--ct-border);
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.ct-attachment-chip:hover {
  background: var(--ct-accent);
  color: #fff;
  text-decoration: none;
}
.ct-attachment-chip:hover .ct-muted-small { color: #fff; opacity: 0.85; }
/* Non-billable entries (v9.2) */
.ct-non-billable {
  opacity: 0.65;
  background: repeating-linear-gradient(
    45deg,
    transparent,
    transparent 8px,
    rgba(239, 68, 68, 0.04) 8px,
    rgba(239, 68, 68, 0.04) 16px
  );
}
.ct-non-billable td:nth-child(3) {
  font-style: italic;
}
/* Ticket-Badge in Timer-Eintr\u00e4gen (v9.3) */
.ct-tag-ticket {
  background: #7c3aed33;
  color: var(--ct-text);
  text-decoration: none;
  font-weight: 600;
}
.ct-tag-ticket:hover {
  background: #7c3aed;
  color: #fff;
  text-decoration: none;
}
/* Nav-Badge f\u00fcr Ticket-Count (v9.4) */
.ct-nav-item {
  position: relative;
}
.ct-nav-badge {
  margin-left: auto;
  background: #ef4444;
  color: #fff;
  font-size: 0.75em;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 10px;
  line-height: 1.2;
  min-width: 22px;
  text-align: center;
}
.ct-nav-item.active .ct-nav-badge {
  background: #fff;
  color: #1f2a44;
}

/* Neu-Badge bei offenen Tickets (v9.4) */
.ct-new-badge {
  display: inline-block;
  background: #dc2626;
  color: #fff;
  font-size: 0.7em;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 6px;
  margin-right: 4px;
  vertical-align: middle;
  letter-spacing: 0.5px;
}
/* Reply-Badge (v9.5) */
.ct-reply-badge {
  display: inline-block;
  background: #eab308;
  color: #1f2a44;
  font-size: 0.7em;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 6px;
  margin-right: 4px;
  vertical-align: middle;
  letter-spacing: 0.3px;
}

/* Live-Notification-Banner (v9.5) */
.ct-live-banner {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 9999;
  padding: 12px 18px;
  background: #1f2a44;
  color: #fff;
  border-radius: 8px;
  box-shadow: 0 4px 16px rgba(0,0,0,0.3);
  font-size: 0.95em;
  max-width: 400px;
  animation: ct-banner-slide-in 0.3s ease-out;
  border-left: 4px solid #3b82f6;
}
.ct-live-banner.ct-banner-new {
  border-left-color: #dc2626;
}
.ct-live-banner.ct-banner-reply {
  border-left-color: #eab308;
}
.ct-live-banner a {
  color: #7bc043;
  text-decoration: none;
  margin-left: 8px;
  font-weight: 600;
}
.ct-live-banner a:hover {
  text-decoration: underline;
}
.ct-live-banner-hide {
  opacity: 0;
  transform: translateX(40px);
  transition: all 0.5s ease-in;
}
@keyframes ct-banner-slide-in {
  from { opacity: 0; transform: translateX(40px); }
  to { opacity: 1; transform: translateX(0); }
}
/* Nav-Badge Warn-Variant (v9.6) */
.ct-nav-badge.ct-nav-badge-warn {
  background: #f59e0b;
  color: #1f2a44;
}
.ct-nav-item.active .ct-nav-badge.ct-nav-badge-warn {
  background: #fff;
  color: #92400e;
}
/* User-Overview unten auf timer.php (v9.7) */
.ct-users-overview {
  margin-bottom: 0;
}
.ct-users-overview th {
  font-size: 0.85em;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--ct-text-muted);
  border-bottom: 1px solid var(--ct-border);
}
.ct-users-overview td {
  vertical-align: middle;
}
.ct-user-bar-wrap {
  position: relative;
  background: var(--ct-bar-bg);
  border-radius: 6px;
  height: 22px;
  overflow: hidden;
  width: 100%;
}
.ct-user-bar {
  background: linear-gradient(90deg, var(--ct-bar-fill-1), var(--ct-bar-fill-2));
  height: 100%;
  border-radius: 6px;
  transition: width 0.5s ease-out;
  min-width: 2px;
}
.ct-user-bar-label {
  position: absolute;
  top: 0;
  left: 10px;
  right: 10px;
  line-height: 22px;
  font-size: 0.82em;
  font-weight: 600;
  color: var(--ct-text);
  text-shadow: 0 0 4px var(--ct-surface);
  pointer-events: none;
  display: flex;
  justify-content: space-between;
}