/* ================================================================
   TICKET SYSTEM – tickets.css
   Builds on top of adlsv3.min.css
   ================================================================ */

/* ── Page Header ─────────────────────────────────────────────────── */
.tk-page-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
  margin-bottom: 24px;
}

.tk-page-title {
  color: white;
  font-size: 28px;
  font-weight: 800;
  margin: 4px 0 0;
  display: flex;
  align-items: center;
  gap: 10px;
}

.tk-page-title .material-symbols {
  font-size: 32px;
  color: var(--color-branding-primary);
}

/* ── Status Summary Row ───────────────────────────────────────────── */
.tk-status-row {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 20px;
}

.tk-stat-card {
  background: var(--color-background-deep);
  border-radius: 14px;
  padding: 14px 20px;
  text-decoration: none;
  color: white;
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 100px;
  border: 1.5px solid transparent;
  transition: all 0.2s ease;
}

.tk-stat-card:hover {
  transform: translateY(-2px);
  border-color: rgba(255, 255, 255, 0.15);
}

.tk-stat-card--active {
  border-color: var(--color-branding-primary) !important;
}

.tk-stat-label {
  font-size: 12px;
  color: var(--color-background-bright);
  text-transform: uppercase;
  letter-spacing: .06em;
}

.tk-stat-num {
  font-size: 26px;
  font-weight: 800;
}

.tk-stat-card--offen   .tk-stat-num { color: #0066ff; }
.tk-stat-card--inprog  .tk-stat-num { color: var(--color-branding-secondary); }
.tk-stat-card--geklaert .tk-stat-num { color: var(--color-branding-verified); }
.tk-stat-card--closed  .tk-stat-num { color: var(--color-background-bright); }

/* ── Filter Bar ───────────────────────────────────────────────────── */
.tk-filter-bar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 24px;
  padding: 14px 18px;
  background: var(--color-background-deep);
  border-radius: 14px;
}

.tk-filter-search-wrap {
  position: relative;
  flex: 1;
  min-width: 180px;
}

.tk-filter-search-icon {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--color-background-bright);
  font-size: 18px;
  pointer-events: none;
}

.tk-filter-search {
  width: 100% !important;
  padding-left: 38px !important;
  box-sizing: border-box;
}

/* ── Select / Dropdown ───────────────────────────────────────────── */
.tk-select {
  background: var(--color-background-medium);
  color: white;
  border: 1px solid #5d6669;
  border-radius: 12px;
  padding: 10px 14px;
  font-family: var(--font-family-primary);
  font-size: 15px;
  cursor: pointer;
  outline: none;
  transition: border-color 0.2s;
}

.tk-select:disabled {
  opacity: .5;
  cursor: not-allowed;
}

.tk-select:focus {
  border-color: var(--color-branding-primary);
}

.tk-select--full {
  width: 100%;
}

/* ── Ticket List ──────────────────────────────────────────────────── */
.tk-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.tk-ticket-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px;
  min-height: unset;
  width: 100%;
  box-sizing: border-box;
  gap: 16px;
  border: 1px solid transparent;
  transition: all 0.2s ease;
}

.tk-ticket-row:hover {
  border-color: rgba(255, 255, 255, 0.08);
}

.tk-ticket-left {
  display: flex;
  align-items: center;
  gap: 14px;
  flex: 1;
  min-width: 0;
}

.tk-ticket-info {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
}

.tk-ticket-id {
  font-size: 12px;
  color: var(--color-background-bright);
  font-weight: 700;
  letter-spacing: .04em;
}

.tk-ticket-title {
  font-size: 16px;
  font-weight: 700;
  color: white;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.tk-ticket-desc {
  font-size: 13px;
  color: var(--color-background-bright);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.tk-ticket-right {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.tk-assignee {
  font-size: 13px;
  color: var(--color-background-bright);
}

.tk-assignee--none {
  font-style: italic;
  opacity: .6;
}

.tk-ticket-date {
  font-size: 12px;
  color: var(--color-background-bright);
  min-width: 78px;
  text-align: right;
}

.tk-comment-count {
  font-size: 12px;
  color: var(--color-background-bright);
}

/* ── Priority Badges ─────────────────────────────────────────────── */
.tk-prio-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 4px 10px;
  border-radius: 10px;
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
  flex-shrink: 0;
  min-width: 34px;
}

.tk-prio-1 { background: rgba(52, 168, 67, .2);  color: var(--color-branding-verified); }
.tk-prio-2 { background: rgba(0, 102, 255, .2);  color: #66aaff; }
.tk-prio-3 { background: rgba(230, 138, 0, .2);  color: var(--color-branding-secondary); }
.tk-prio-4 { background: rgba(204, 0, 0, .2);    color: #ff6666; }
.tk-prio-5 { background: rgba(204, 0, 0, .85);   color: white; animation: tk-pulse 1.4s infinite; }

@keyframes tk-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(204,0,0,.5); }
  50%       { box-shadow: 0 0 0 6px rgba(204,0,0,0); }
}

/* ── Status Badges ───────────────────────────────────────────────── */
.tk-status-badge {
  display: inline-block;
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}

.tk-status-offen         { background: rgba(0,102,255,.2);   color: #66aaff; }
.tk-status-in_bearbeitung { background: rgba(230,138,0,.2); color: var(--color-branding-secondary); }
.tk-status-geklaert      { background: rgba(52,168,67,.2);   color: var(--color-branding-verified); }
.tk-status-geschlossen   { background: rgba(100,100,100,.2); color: var(--color-background-bright); }

/* ── Empty State ─────────────────────────────────────────────────── */
.tk-empty {
  text-align: center;
  padding: 64px 20px;
  color: var(--color-background-bright);
}

.tk-empty-icon {
  font-size: 64px;
  display: block;
  margin-bottom: 16px;
  opacity: .4;
}

/* ── Form ────────────────────────────────────────────────────────── */
.tk-form-card {
  max-width: 720px;
  width: 100%;
  padding: 28px 32px;
}

.tk-field-group {
  margin-bottom: 22px;
}

.tk-field-group--half {
  flex: 1;
  min-width: 200px;
}

.tk-field-row {
  display: flex;
  gap: 20px;
  flex-wrap: wrap;
}

.tk-label {
  display: block;
  font-size: 13px;
  font-weight: 700;
  color: var(--color-background-bright);
  text-transform: uppercase;
  letter-spacing: .06em;
  margin-bottom: 8px;
}

.tk-required {
  color: var(--color-branding-primary);
}

.tk-textfield-full {
  width: 100% !important;
  box-sizing: border-box !important;
}

.tk-textarea {
  resize: vertical;
  min-height: 100px;
}

.tk-prio-selector {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.tk-prio-selector input[type="radio"] {
  display: none;
}

.tk-prio-option {
  padding: 6px 14px;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  border: 1.5px solid transparent;
  transition: all 0.15s;
  background: var(--color-background-medium);
  color: var(--color-background-bright);
}

.tk-prio-selector input:checked + .tk-prio-option {
  border-color: currentColor;
}

.tk-prio-opt-1:hover, .tk-prio-selector input:checked + .tk-prio-opt-1 { color: var(--color-branding-verified); }
.tk-prio-opt-2:hover, .tk-prio-selector input:checked + .tk-prio-opt-2 { color: #66aaff; }
.tk-prio-opt-3:hover, .tk-prio-selector input:checked + .tk-prio-opt-3 { color: var(--color-branding-secondary); }
.tk-prio-opt-4:hover, .tk-prio-selector input:checked + .tk-prio-opt-4 { color: #ff6666; }
.tk-prio-opt-5:hover, .tk-prio-selector input:checked + .tk-prio-opt-5 { color: white; background: var(--color-branding-primary); }

.tk-form-actions {
  display: flex;
  gap: 12px;
  justify-content: flex-end;
  margin-top: 8px;
}

/* ── Detail Layout ───────────────────────────────────────────────── */
.tk-detail-layout {
  display: grid;
  grid-template-columns: 1fr 280px;
  gap: 20px;
  align-items: start;
}

@media (max-width: 900px) {
  .tk-detail-layout {
    grid-template-columns: 1fr;
  }
}

.tk-detail-title-row {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}

.tk-detail-id-badge {
  background: var(--color-branding-primary);
  color: white;
  font-size: 13px;
  font-weight: 800;
  padding: 4px 12px;
  border-radius: 8px;
  flex-shrink: 0;
}

.tk-detail-title {
  color: white;
  font-size: 22px;
  font-weight: 800;
  margin: 0;
  flex: 1;
}

.tk-meta-strip {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  margin-bottom: 20px;
}

.tk-meta-item {
  font-size: 13px;
  color: var(--color-background-bright);
}

/* ── Detail Cards ────────────────────────────────────────────────── */
.tk-desc-card,
.tk-stepper-card,
.tk-comment-card {
  width: 100%;
  box-sizing: border-box;
  padding: 20px;
  margin-bottom: 16px;
  min-height: unset;
}

.tk-desc-text {
  color: white;
  line-height: 1.7;
  margin: 0;
  white-space: pre-wrap;
  word-break: break-word;
}

.tk-desc-empty {
  color: var(--color-background-bright);
  font-style: italic;
}

/* ── Stepper ─────────────────────────────────────────────────────── */
.tk-stepper {
  display: flex;
  align-items: center;
  gap: 0;
  flex-wrap: nowrap;
  overflow-x: auto;
  padding: 4px 0;
}

.tk-step {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  background: none;
  border: none;
  cursor: pointer;
  color: var(--color-background-bright);
  padding: 0 8px;
  transition: all 0.2s;
  min-width: 80px;
}

.tk-step:hover {
  color: white;
}

.tk-step-circle {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--color-background-lighter);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 700;
  transition: background 0.2s;
}

.tk-step--active .tk-step-circle {
  background: var(--color-branding-primary);
  color: white;
}

.tk-step--done .tk-step-circle {
  background: var(--color-branding-verified);
  color: white;
}

.tk-step-label {
  font-size: 11px;
  text-align: center;
  white-space: nowrap;
  font-weight: 600;
}

.tk-step--active .tk-step-label {
  color: white;
}

.tk-step--done .tk-step-label {
  color: var(--color-branding-verified);
}

.tk-step-line {
  flex: 1;
  height: 2px;
  background: var(--color-background-lighter);
  min-width: 20px;
  margin-bottom: 18px;
  transition: background 0.3s;
}

.tk-step-line--done {
  background: var(--color-branding-verified);
}

/* ── Comments ────────────────────────────────────────────────────── */
.tk-comment {
  padding: 14px 0;
  border-bottom: 1px solid var(--color-background-lighter);
}

.tk-comment:last-child {
  border-bottom: none;
}

.tk-comment-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 6px;
}

.tk-comment-author {
  font-size: 13px;
  font-weight: 700;
  color: white;
  display: flex;
  align-items: center;
  gap: 5px;
}

.tk-comment-date {
  font-size: 11px;
  color: var(--color-background-bright);
}

.tk-comment-body {
  color: var(--color-background-bright);
  font-size: 14px;
  margin: 0;
  white-space: pre-wrap;
  word-break: break-word;
  line-height: 1.6;
}

.tk-no-comments {
  color: var(--color-background-bright);
  font-style: italic;
  font-size: 14px;
  padding: 12px 0;
}

.tk-comment-form-wrap {
  margin-top: 18px;
  padding-top: 18px;
  border-top: 1px solid var(--color-background-lighter);
}

.tk-comment-form-header {
  font-size: 13px;
  font-weight: 700;
  color: var(--color-background-bright);
  text-transform: uppercase;
  letter-spacing: .05em;
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 6px;
}

/* ── Sidebar ─────────────────────────────────────────────────────── */
.tk-detail-sidebar {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.tk-sidebar-card {
  min-height: unset;
  width: 100%;
  box-sizing: border-box;
  padding: 16px 18px;
}

.tk-sidebar-card-title {
  margin: 0;
  font-size: 12px;
  color: var(--color-background-bright);
  text-transform: uppercase;
  letter-spacing: .06em;
}

.tk-time-row {
  display: flex;
  justify-content: space-between;
  font-size: 13px;
  padding: 4px 0;
}

.tk-time-label {
  color: var(--color-background-bright);
}

.tk-time-val {
  color: white;
  font-weight: 600;
}

.tk-danger-card {
  border: 1px solid rgba(204, 0, 0, .25);
}

/* ── Admin: Stepper locked state ─────────────────────────────────── */
.tk-step--locked {
  cursor: not-allowed;
  opacity: .55;
}

.tk-step--locked:hover {
  color: var(--color-background-bright);
}

.tk-step--locked .tk-step-circle {
  position: relative;
}

/* ── Admin: Disabled select hint ─────────────────────────────────── */
.tk-admin-hint {
  margin: 8px 0 0;
  font-size: 12px;
  color: var(--color-background-bright);
  display: flex;
  align-items: center;
  gap: 4px;
}

/* ── Admin: Active card in sidebar ───────────────────────────────── */
.tk-admin-active-card {
  border: 1px solid rgba(230, 138, 0, .35);
  background: rgba(230, 138, 0, .06);
}

/* ── Admin: Login hint card in sidebar ───────────────────────────── */
.tk-admin-login-hint-card {
  border: 1px solid rgba(255, 255, 255, .08);
}

/* ── Admin: Navbar badge & logout ────────────────────────────────── */
.tk-nav-admin-badge {
  background: rgba(230, 138, 0, .9) !important;
  font-size: 12px;
  padding: 4px 10px;
  border-radius: 10px;
  display: inline-flex;
  align-items: center;
}

/* Logout-Button im Dropdown wie ein normaler Link aussehen lassen */
.smd-component_dropdown-logout-btn {
  display: flex;
  align-items: center;
  width: 100%;
  background: none;
  border: none;
  cursor: pointer;
  padding: 12px 16px;
  font-family: var(--font-family-primary);
  font-size: 1rem;
  color: white;
  text-decoration: none;
  background-color: var(--color-background-medium);
  margin: 4px 10px;
  border-radius: 12px;
  width: calc(100% - 20px);
  transition: background-color 0.3s cubic-bezier(0.4,0,0.2,1);
}

.smd-component_dropdown-logout-btn:hover {
  background-color: var(--color-background-lighter);
}

/* ── Admin: Login page ───────────────────────────────────────────── */
.tk-admin-login-wrap {
  display: flex;
  justify-content: center;
  margin-top: 40px;
}

.tk-admin-login-card {
  width: 100%;
  max-width: 420px;
  padding: 36px 36px 28px;
  min-height: unset;
}

.tk-admin-login-icon {
  text-align: center;
  margin-bottom: 12px;
}

.tk-admin-login-icon .material-symbols {
  font-size: 52px;
  color: var(--color-branding-secondary);
}

.tk-admin-login-title {
  text-align: center;
  color: white;
  font-size: 22px;
  font-weight: 800;
  margin: 0 0 6px;
}

.tk-admin-login-sub {
  text-align: center;
  color: var(--color-background-bright);
  font-size: 14px;
  margin: 0 0 22px;
  line-height: 1.5;
}
