/**
 * Component Styles
 * Cards, KPIs, badges, buttons, tables, forms, tabs, filters,
 * workflow steps, alerts, release cards, comments, Power BI placeholder.
 */

/* =========================================================================
 * CARDS
 * ========================================================================= */

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  overflow: hidden;
  margin-bottom: 14px;
}

.card-header {
  padding: 11px 16px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.card-title {
  font-size: .85rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 6px;
}

.card-title svg {
  width: 15px;
  height: 15px;
  color: var(--mm-topas);
}

.card-body {
  padding: 14px 16px;
}

.card-body.no-pad {
  padding: 0;
}

/* =========================================================================
 * KPI CARDS
 * ========================================================================= */

.kpi-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-bottom: 16px;
}

.kpi-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 14px 16px;
  box-shadow: var(--shadow);
  position: relative;
  overflow: hidden;
}

.kpi-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 3px;
}

.kpi-card.navy::before { background: var(--mm-navy); }
.kpi-card.topas::before { background: var(--mm-topas); }
.kpi-card.smaragd::before { background: var(--mm-smaragd); }
.kpi-card.chartreuse::before { background: var(--mm-chartreuse); }

.kpi-label {
  font-size: .68rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .4px;
  color: var(--text-secondary);
  margin-bottom: 3px;
}

.kpi-value {
  font-size: 1.6rem;
  font-weight: 700;
  line-height: 1.1;
}

.kpi-change {
  font-size: .65rem;
  margin-top: 2px;
  display: flex;
  align-items: center;
  gap: 3px;
}

.kpi-change.up { color: var(--color-success); }
.kpi-change.down { color: var(--color-danger); }

/* =========================================================================
 * BUTTONS
 * ========================================================================= */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  padding: 7px 14px;
  font-size: .75rem;
  font-weight: 600;
  border: none;
  border-radius: var(--radius);
  cursor: pointer;
  transition: all var(--transition);
  font-family: inherit;
  white-space: nowrap;
}

.btn svg {
  width: 13px;
  height: 13px;
}

.btn-primary {
  background: var(--mm-navy);
  color: #fff;
}

.btn-primary:hover {
  background: #042744;
  transform: translateY(-1px);
}

.btn-topas {
  background: var(--mm-topas);
  color: #fff;
}

.btn-topas:hover {
  background: #007680;
}

.btn-success {
  background: var(--color-success);
  color: #fff;
}

.btn-danger {
  background: var(--color-danger);
  color: #fff;
}

.btn-outline {
  background: transparent;
  color: var(--mm-navy);
  border: 1.5px solid var(--mm-navy);
}

.btn-outline:hover {
  background: rgba(3, 46, 82, .05);
}

.btn-ghost {
  background: transparent;
  color: var(--text-secondary);
  padding: 4px 7px;
}

.btn-ghost:hover {
  background: var(--mm-lichtgrau);
  color: var(--text);
}

.btn-sm {
  padding: 3px 8px;
  font-size: .68rem;
}

.btn-lg {
  padding: 10px 20px;
  font-size: .82rem;
}

.btn-chartreuse {
  background: var(--mm-chartreuse);
  color: var(--mm-navy);
  font-weight: 700;
}

.btn-chartreuse:hover {
  background: #8ed015;
}

/* =========================================================================
 * BADGES
 * ========================================================================= */

.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border-radius: 10px;
  font-size: .65rem;
  font-weight: 600;
}

.badge-success { background: var(--color-success-light); color: var(--color-success); }
.badge-warning { background: var(--color-warning-light); color: var(--color-warning); }
.badge-danger  { background: var(--color-danger-light);  color: var(--color-danger);  }
.badge-info    { background: var(--color-info-light);    color: var(--color-info);    }
.badge-neutral { background: var(--mm-lichtgrau);        color: var(--mm-fossil);     }
.badge-navy    { background: rgba(3, 46, 82, .08);      color: var(--mm-navy);       }

.badge-dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: currentColor;
}

.badge-dot.pulse {
  animation: pulse 1.5s infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: .3; }
}

/* =========================================================================
 * DATA TABLE
 * ========================================================================= */

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: .75rem;
}

.data-table th {
  background: var(--mm-lichtgrau);
  padding: 8px 12px;
  text-align: left;
  font-weight: 600;
  color: var(--text-secondary);
  border-bottom: 2px solid var(--border);
  font-size: .67rem;
  text-transform: uppercase;
  letter-spacing: .2px;
  white-space: nowrap;
}

.data-table td {
  padding: 8px 12px;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}

.data-table tr:hover td {
  background: var(--surface-hover);
}

.ticket-id {
  font-weight: 700;
  color: var(--mm-topas);
  cursor: pointer;
  text-decoration: none;
}

.ticket-id:hover {
  text-decoration: underline;
}

.ticket-pr {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 1px 6px;
  border-radius: var(--radius-sm);
  background: rgba(3, 46, 82, .05);
  color: var(--mm-navy);
  font-size: .67rem;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
}

.ticket-pr:hover {
  background: rgba(3, 46, 82, .10);
}

.assignee {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.assignee-avatar {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--mm-petrol);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: .5rem;
  font-weight: 700;
}

.inline-select {
  padding: 2px 5px;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  font-size: .75rem;
  background: transparent;
  cursor: pointer;
  font-family: inherit;
  color: inherit;
}

.inline-select:hover,
.inline-select:focus {
  border-color: var(--border-strong);
  background: var(--surface);
}

.pr-action-badge {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 2px 7px;
  border-radius: 8px;
  font-size: .65rem;
  font-weight: 600;
}

.pr-action-badge.running { background: #fff8e1; color: #f57f17; }
.pr-action-badge.success { background: var(--color-success-light); color: var(--color-success); }
.pr-action-badge.failed  { background: var(--color-danger-light); color: var(--color-danger); }

/* Clickable CI badge — works on <a> or <span> with onclick */
.ci-badge-link {
  text-decoration: none;
  cursor: pointer;
  transition: opacity .15s;
}

.ci-badge-link:hover {
  opacity: .7;
  text-decoration: none;
}

/* =========================================================================
 * FORMS
 * ========================================================================= */

.form-group {
  margin-bottom: 12px;
  text-align: left;
}

.form-label {
  display: block;
  font-size: .72rem;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 4px;
  text-transform: uppercase;
  letter-spacing: .3px;
}

.form-input,
.form-select,
.form-textarea {
  width: 100%;
  padding: 9px 12px;
  font-size: .85rem;
  border: 1.5px solid var(--border-strong);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--text);
  transition: border-color var(--transition), box-shadow var(--transition);
  font-family: inherit;
}

.form-textarea {
  resize: vertical;
  min-height: 70px;
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
  outline: none;
  border-color: var(--mm-topas);
  box-shadow: 0 0 0 3px rgba(0, 136, 146, .12);
}

/* =========================================================================
 * FILTER BAR
 * ========================================================================= */

.filter-bar {
  display: flex;
  align-items: center;
  gap: 7px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}

.filter-bar .form-input,
.filter-bar .form-select {
  width: auto;
  min-width: 150px;
  padding: 5px 9px;
  font-size: .75rem;
}

/* =========================================================================
 * TABS
 * ========================================================================= */

.tabs {
  display: flex;
  border-bottom: 2px solid var(--border);
  margin-bottom: 14px;
}

.tab-item {
  padding: 8px 16px;
  font-size: .78rem;
  font-weight: 600;
  color: var(--text-secondary);
  cursor: pointer;
  border: none;
  background: none;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  font-family: inherit;
}

.tab-item:hover {
  color: var(--text);
}

.tab-item.active {
  color: var(--mm-topas);
  border-bottom-color: var(--mm-topas);
}

/* =========================================================================
 * WORKFLOW STEPS
 * ========================================================================= */

.workflow-steps {
  display: flex;
  gap: 3px;
  margin-bottom: 12px;
}

.workflow-step {
  flex: 1;
  padding: 8px 10px;
  background: var(--mm-lichtgrau);
  text-align: center;
  font-size: .7rem;
  font-weight: 600;
  color: var(--text-secondary);
}

.workflow-step:first-child {
  border-radius: var(--radius) 0 0 var(--radius);
}

.workflow-step:last-child {
  border-radius: 0 var(--radius) var(--radius) 0;
}

.workflow-step.active {
  background: var(--mm-topas);
  color: #fff;
}

.workflow-step.done {
  background: var(--color-success);
  color: #fff;
}

/* =========================================================================
 * RELEASE CARDS
 * ========================================================================= */

.release-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  margin-bottom: 12px;
  overflow: hidden;
}

.release-header {
  padding: 12px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
}

.release-header:hover {
  background: var(--surface-hover);
}

.release-info {
  display: flex;
  align-items: center;
  gap: 10px;
}

.release-version {
  font-size: .95rem;
  font-weight: 700;
  color: var(--mm-navy);
  font-family: 'Consolas', monospace;
}

.release-name {
  font-size: .78rem;
  color: var(--text-secondary);
}

.release-meta {
  display: flex;
  align-items: center;
  gap: 10px;
}

.release-date {
  font-size: .72rem;
  color: var(--text-secondary);
}

.release-progress-bar {
  width: 90px;
  height: 5px;
  background: var(--mm-lichtgrau);
  border-radius: 3px;
  overflow: hidden;
}

.release-progress-fill {
  height: 100%;
  border-radius: 3px;
  background: var(--gradient-primary);
}

.release-tickets {
  display: none;
}

.release-tickets.open {
  display: block;
}

.gradient-bar {
  height: 3px;
  background: var(--gradient-primary);
}

/* =========================================================================
 * ALERTS
 * ========================================================================= */

.alert {
  padding: 8px 12px;
  border-radius: var(--radius);
  font-size: .75rem;
  margin-bottom: 10px;
}

.alert-warning {
  background: var(--color-warning-light);
  color: var(--color-warning);
}

.alert-info {
  background: var(--color-info-light);
  color: var(--color-info);
}

/* =========================================================================
 * COMMENTS
 * ========================================================================= */

.comment-box {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 9px;
  margin-bottom: 7px;
}

.comment-header {
  display: flex;
  align-items: center;
  gap: 5px;
  margin-bottom: 3px;
}

.comment-author {
  font-weight: 600;
  font-size: .75rem;
}

.comment-date {
  font-size: .65rem;
  color: var(--text-light);
}

.comment-text {
  font-size: .75rem;
  color: var(--text-secondary);
}

/* =========================================================================
 * TOKEN STATUS
 * ========================================================================= */

.token-status {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: .72rem;
  margin-top: 3px;
}

.token-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  display: inline-block;
}

.token-dot.ok   { background: var(--color-success); }
.token-dot.bad  { background: var(--color-danger);  }
.token-dot.none { background: var(--mm-grau);        }

/* =========================================================================
 * POWER BI PLACEHOLDER
 * ========================================================================= */

.powerbi-placeholder {
  width: 100%;
  min-height: 420px;
  background: var(--surface);
  border: 2px dashed var(--border-strong);
  border-radius: var(--radius-lg);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: var(--text-secondary);
  gap: 8px;
}

.powerbi-placeholder svg {
  width: 40px;
  height: 40px;
  color: var(--mm-topas);
}

/* =============================================================================
   Project Classification — Kanban Board with Sidebar Layout
   ============================================================================= */

/* Wrapper: sidebar (left) + board (right) side by side */
.classification-wrapper {
  display: flex;
  gap: 16px;
  height: calc(100vh - 160px);
  min-height: 500px;
}

/* Left sidebar — scrollable project list */
.classification-sidebar {
  width: 260px;
  min-width: 220px;
  max-width: 300px;
  flex-shrink: 0;
  background: var(--card-bg, #fff);
  border: 1px solid var(--border-color, #e0e0e0);
  border-radius: 8px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.classification-sidebar-header {
  padding: 10px 12px;
  border-bottom: 1px solid var(--border-color, #e0e0e0);
  flex-shrink: 0;
}

.classification-sidebar-header h3 {
  margin: 0 0 8px;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text-secondary, #6c757d);
}

.classification-sidebar-search {
  padding: 6px 10px !important;
  font-size: 0.78rem !important;
}

.classification-sidebar-list {
  flex: 1;
  overflow-y: auto;
  padding: 8px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.classification-sidebar-list.drag-over {
  background: rgba(0,155,141,0.04);
}

.classification-sidebar-count {
  padding: 6px 12px;
  border-top: 1px solid var(--border-color, #e0e0e0);
  font-size: 0.68rem;
  color: var(--text-secondary, #adb5bd);
  text-align: center;
  flex-shrink: 0;
}

/* Board wrapper: contains global search + columns area */
.classification-board-wrapper {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
  overflow: hidden;
}

/* Global search bar above the board */
.classification-global-search {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
  flex-shrink: 0;
}

.classification-global-search-input {
  flex: 1;
  max-width: 400px;
  padding: 7px 12px !important;
  font-size: 0.82rem !important;
  border-radius: 6px;
}

.classification-global-search-count {
  font-size: 0.72rem;
  color: var(--text-secondary, #6c757d);
  white-space: nowrap;
}

/* Search highlight / dim states */
.classification-card.search-dimmed {
  opacity: 0.15;
  transition: opacity 0.25s ease;
}

.classification-card.search-highlight {
  box-shadow: 0 0 0 3px var(--mm-topas, #009B8D), 0 2px 12px rgba(0,155,141,0.25);
  border-color: var(--mm-topas, #009B8D);
  transition: box-shadow 0.25s ease, border-color 0.25s ease;
  z-index: 1;
  position: relative;
}

/* Board layout: horizontal scroll of columns, fills remaining space */
.classification-board {
  display: flex;
  gap: 12px;
  flex: 1;
  overflow-x: auto;
  align-items: stretch;
  padding-bottom: 4px;
}

/* Single priority column */
.classification-column {
  flex: 1 1 200px;
  min-width: 200px;
  max-width: 340px;
  background: var(--card-bg, #fff);
  border: 1px solid var(--border-color, #e0e0e0);
  border-radius: 8px;
  display: flex;
  flex-direction: column;
  transition: box-shadow 0.2s;
}

.classification-column.drag-over {
  box-shadow: 0 0 0 2px var(--mm-topas, #009B8D), 0 4px 12px rgba(0,155,141,0.15);
}

/* Column header — sticky at top */
.classification-column-header {
  padding: 10px 14px;
  border-radius: 8px 8px 0 0;
  color: #fff;
  font-weight: 600;
  font-size: 0.88rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  user-select: none;
  position: sticky;
  top: 0;
  z-index: 2;
}

.classification-column-header .column-count {
  background: rgba(255,255,255,0.25);
  padding: 2px 8px;
  border-radius: 10px;
  font-size: 0.75rem;
  font-weight: 700;
}

/* Column body — cards container, scrollable */
.classification-column-body {
  padding: 8px;
  flex: 1;
  min-height: 60px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  overflow-y: auto;
}

.classification-column-body.drag-over {
  background: rgba(0,155,141,0.06);
  border-radius: 0 0 8px 8px;
}

/* Project card */
.classification-card {
  background: var(--card-bg, #fff);
  border: 1px solid var(--border-color, #e0e0e0);
  border-radius: 6px;
  padding: 8px 10px;
  cursor: grab;
  transition: box-shadow 0.15s, opacity 0.15s, transform 0.15s;
  user-select: none;
}

.classification-card:hover {
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

.classification-card.dragging {
  opacity: 0.4;
  transform: scale(0.97);
}

.classification-card.selected {
  outline: 2px solid var(--mm-topas, #009B8D);
  outline-offset: -2px;
  box-shadow: 0 0 0 3px rgba(0,155,141,0.18);
}

/* Card in sidebar — compact style */
.classification-sidebar-list .classification-card {
  padding: 6px 10px;
}

.classification-sidebar-list .classification-card-name {
  font-size: 0.78rem;
  margin-bottom: 0;
}

.classification-card-name {
  font-weight: 600;
  font-size: 0.82rem;
  margin-bottom: 4px;
  color: var(--text-primary, #1a1a2e);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 4px;
}

.classification-card-name .card-edit-btn {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text-secondary, #6c757d);
  padding: 2px 4px;
  border-radius: 4px;
  opacity: 0;
  transition: opacity 0.15s, color 0.15s;
  flex-shrink: 0;
}

.classification-card:hover .card-edit-btn {
  opacity: 1;
}

.classification-card-name .card-edit-btn:hover {
  color: var(--mm-topas, #009B8D);
  background: var(--hover-bg, rgba(0,155,141,0.08));
}

/* Collapsible area toggle button */
.classification-card-areas-toggle {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 0.65rem;
  color: var(--text-secondary, #adb5bd);
  padding: 1px 4px;
  border-radius: 3px;
  transition: color 0.15s;
  display: inline-flex;
  align-items: center;
  gap: 3px;
}

.classification-card-areas-toggle:hover {
  color: var(--mm-topas, #009B8D);
}

/* Area sections within a card */
.classification-card-areas {
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin-top: 4px;
}

.classification-card-areas.collapsed {
  display: none;
}

.classification-card-area {
  font-size: 0.72rem;
  padding: 3px 6px;
  border-radius: 3px;
  display: flex;
  flex-direction: column;
  gap: 0;
  line-height: 1.3;
}

.classification-card-area .area-label {
  color: var(--text-secondary, #6c757d);
  font-size: 0.65rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.classification-card-area .area-users {
  color: var(--text-primary, #1a1a2e);
  font-weight: 600;
  font-size: 0.75rem;
  padding-left: 2px;
}

.classification-card-area .area-users .user-inactive {
  text-decoration: line-through;
  opacity: 0.5;
}

/* Highlight levels for areas */
.classification-card-area.highlight-1 {
  border-left: 3px solid var(--mm-topas, #009B8D);
  background: rgba(0,155,141,0.06);
  font-weight: 600;
}

.classification-card-area.highlight-1 .area-label {
  color: var(--mm-topas, #009B8D);
  font-weight: 700;
}

.classification-card-area.highlight-2 {
  border-left: 3px solid #fd7e14;
  background: rgba(253,126,20,0.05);
  font-weight: 500;
}

.classification-card-area.highlight-2 .area-label {
  color: #e67312;
  font-weight: 600;
}

.classification-card-area.highlight-3 {
  border-left: 2px solid var(--border-color, #dee2e6);
  background: rgba(0,0,0,0.015);
}

.classification-card-area.highlight-4 {
  /* Normal/standard — no special styling */
  padding-left: 9px;
}

/* Priority color classes (for column headers and badges) */
.priority-red { background: #dc3545; }
.priority-orange { background: #fd7e14; }
.priority-grey { background: #6c757d; }
.priority-green { background: #28a745; }
.priority-blue { background: #007bff; }
.priority-purple { background: #6f42c1; }
.priority-yellow { background: #ffc107; color: #333; }

/* Flashing/pulsing effects */
.priority-flash-red {
  background: #dc3545;
  animation: priorityFlash 1.5s ease-in-out infinite;
}

.priority-flash-orange {
  background: #fd7e14;
  animation: priorityFlash 1.5s ease-in-out infinite;
}

@keyframes priorityFlash {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.65; }
}

/* Responsive: stack on small screens */

/* Priority badge (for dashboard widget and small displays) */
.priority-badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: 12px;
  font-size: 0.78rem;
  font-weight: 600;
  color: #fff;
}

.priority-badge.priority-flash-red,
.priority-badge.priority-flash-orange {
  animation: priorityFlash 1.5s ease-in-out infinite;
}

/* Dashboard classification widget (read-only) */
.classification-widget {
  background: var(--card-bg, #fff);
  border: 1px solid var(--border-color, #e0e0e0);
  border-radius: 8px;
  padding: 16px;
}

.classification-widget-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.classification-widget-header h3 {
  margin: 0;
  font-size: 0.95rem;
  font-weight: 600;
}

.classification-widget-areas {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.classification-widget-area {
  display: flex;
  align-items: baseline;
  gap: 8px;
  font-size: 0.82rem;
  padding: 4px 8px;
  border-radius: 4px;
}

.classification-widget-area .widget-area-label {
  color: var(--text-secondary, #6c757d);
  min-width: 180px;
}

.classification-widget-area .widget-area-users {
  color: var(--text-primary, #1a1a2e);
  font-weight: 600;
}

/* Widget highlight levels (reuse card highlight styles) */
.classification-widget-area.highlight-1 {
  border-left: 3px solid var(--mm-topas, #009B8D);
  background: rgba(0,155,141,0.06);
}
.classification-widget-area.highlight-1 .widget-area-label {
  color: var(--mm-topas, #009B8D);
  font-weight: 700;
}
.classification-widget-area.highlight-2 {
  border-left: 3px solid #fd7e14;
  background: rgba(253,126,20,0.05);
}
.classification-widget-area.highlight-2 .widget-area-label {
  color: #e67312;
  font-weight: 600;
}
.classification-widget-area.highlight-3 {
  border-left: 2px solid var(--border-color, #dee2e6);
  background: rgba(0,0,0,0.015);
}
.classification-widget-area.highlight-4 {
  padding-left: 11px;
}

/* Settings modals for priorities and areas */
.classification-settings-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin: 12px 0;
}

.classification-settings-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  background: var(--card-bg, #f8f9fa);
  border: 1px solid var(--border-color, #dee2e6);
  border-radius: 6px;
}

.classification-settings-item .drag-handle {
  cursor: grab;
  color: var(--text-secondary, #adb5bd);
  padding: 0 4px;
  font-size: 1.1rem;
  line-height: 1;
}

.classification-settings-item[draggable="true"] {
  cursor: grab;
}

.classification-settings-item[draggable="true"]:active {
  cursor: grabbing;
}

.classification-settings-item .item-name {
  flex: 1;
  font-weight: 500;
}

.classification-settings-item .item-preview {
  display: inline-block;
  width: 18px;
  height: 18px;
  border-radius: 4px;
}

.classification-settings-item .item-actions {
  display: flex;
  gap: 4px;
}

.classification-settings-item .item-actions button {
  background: none;
  border: none;
  cursor: pointer;
  padding: 2px 6px;
  border-radius: 4px;
  color: var(--text-secondary, #6c757d);
  font-size: 0.82rem;
}

.classification-settings-item .item-actions button:hover {
  background: var(--hover-bg, rgba(0,0,0,0.05));
  color: var(--text-primary, #1a1a2e);
}

.classification-settings-item .item-actions button.btn-delete:hover {
  color: #dc3545;
  background: rgba(220,53,69,0.08);
}

/* Responsive: stack wrapper vertically on small screens */
@media (max-width: 900px) {
  .classification-wrapper {
    flex-direction: column;
    height: auto;
  }
  .classification-sidebar {
    width: 100%;
    max-width: 100%;
    max-height: 250px;
  }
  .classification-global-search-input {
    max-width: 100%;
  }
  .classification-board {
    flex-direction: column;
    overflow-x: visible;
  }
  .classification-column {
    max-width: 100%;
    min-width: 0;
  }
  .classification-widget-area .widget-area-label {
    min-width: 120px;
  }
}

/* =============================================================================
   Project Overview — Accordion List (read-only)
   ============================================================================= */

/* Accordion chevron rotation */
.accordion-chevron {
  transition: transform 0.2s ease;
  display: inline-block;
  flex-shrink: 0;
}

.accordion-chevron.rotated {
  transform: rotate(90deg);
}

/* Accordion header button */
.project-overview-accordion-header {
  width: 100%;
  display: flex;
  align-items: center;
  padding: 12px 16px;
  background: none;
  border: none;
  cursor: pointer;
  font-family: inherit;
  text-align: left;
  transition: background 0.15s;
  border-radius: 8px;
}

.project-overview-accordion-header:hover {
  background: var(--surface-hover, rgba(0, 0, 0, 0.02));
}

.project-overview-accordion-title {
  display: flex;
  align-items: center;
  gap: 8px;
}

/* Accordion content */
.project-overview-accordion-content {
  border-top: 1px solid var(--border, #e0e0e0);
}

/* Project row in accordion */
.project-overview-row {
  padding: 10px 16px;
  border-bottom: 1px solid var(--border, #e0e0e0);
  transition: background 0.1s;
}

.project-overview-row:last-child {
  border-bottom: none;
}

.project-overview-row:hover {
  background: var(--surface-hover, rgba(0, 0, 0, 0.02));
}

.project-overview-row-header {
  display: flex;
  align-items: center;
  margin-bottom: 4px;
}

.project-overview-name {
  font-weight: 600;
  font-size: 0.82rem;
  color: var(--mm-topas, #009B8D);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  transition: opacity 0.15s;
}

.project-overview-name:hover {
  opacity: 0.7;
}

/* Area badges within a project row */
.project-overview-areas {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 12px;
  margin-top: 4px;
}

.project-overview-area {
  font-size: 0.72rem;
  display: flex;
  align-items: baseline;
  gap: 4px;
}

.project-overview-area-label {
  color: var(--text-secondary, #6c757d);
  font-weight: 500;
}

.project-overview-area-users {
  color: var(--text, #1a1a2e);
  font-weight: 600;
}

/* ============================================
   SUPPORT GROUP ASSIGNMENT PAGE
   ============================================ */

/* Back link */
.sga-back-link {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--primary);
  text-decoration: none;
  font-size: 0.875rem;
  margin-bottom: 1rem;
  transition: opacity 0.2s;
}
.sga-back-link:hover {
  opacity: 0.8;
  text-decoration: underline;
}

/* Main wrapper — two-panel layout */
.sga-wrapper {
  display: flex;
  gap: 1.5rem;
  height: calc(100vh - 200px);
  min-height: 400px;
}

/* Left panel: Project Pool */
.sga-project-pool {
  width: 320px;
  min-width: 280px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  overflow: hidden;
}

.sga-pool-header {
  padding: 1rem;
  border-bottom: 1px solid var(--border-color);
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.sga-pool-count {
  font-size: 0.8rem;
  color: var(--text-secondary);
  font-weight: 400;
}

.sga-search-wrapper {
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--border-color);
}

.sga-search-input {
  width: 100%;
  padding: 0.5rem 0.75rem;
  border: 1px solid var(--border-color);
  border-radius: 6px;
  font-size: 0.875rem;
  background: var(--bg-main);
  color: var(--text-primary);
  outline: none;
  transition: border-color 0.2s;
}
.sga-search-input:focus {
  border-color: var(--primary);
}

.sga-project-list {
  flex: 1;
  overflow-y: auto;
  padding: 0.5rem;
}

/* Individual project card in pool */
.sga-project-card {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 0.75rem;
  margin-bottom: 0.25rem;
  border: 2px solid transparent;
  border-radius: 6px;
  cursor: grab;
  font-size: 0.85rem;
  color: var(--text-primary);
  background: var(--bg-main);
  transition: border-color 0.15s, background-color 0.15s, box-shadow 0.15s;
  user-select: none;
}
.sga-project-card:hover {
  background: var(--bg-hover, rgba(0,0,0,0.03));
  border-color: var(--border-color);
}
.sga-project-card.sga-selected {
  border-color: var(--primary);
  background: rgba(var(--primary-rgb, 59, 130, 246), 0.08);
  box-shadow: 0 0 0 1px rgba(var(--primary-rgb, 59, 130, 246), 0.2);
}
.sga-project-card:active {
  cursor: grabbing;
}

.sga-project-checkbox {
  flex-shrink: 0;
  width: 16px;
  height: 16px;
  accent-color: var(--primary);
  cursor: pointer;
}

.sga-project-name {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sga-assignment-badge {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 22px;
  height: 20px;
  padding: 0 5px;
  background: var(--primary);
  color: #fff;
  font-size: 0.7rem;
  font-weight: 600;
  border-radius: 10px;
}

/* Drag ghost */
.sga-drag-ghost {
  position: fixed;
  top: -1000px;
  left: -1000px;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  background: var(--primary);
  color: #fff;
  border-radius: 8px;
  font-size: 0.85rem;
  font-weight: 600;
  box-shadow: 0 4px 12px rgba(0,0,0,0.2);
  z-index: 9999;
  pointer-events: none;
}

/* Right panel: Group Columns */
.sga-group-columns {
  flex: 1;
  display: flex;
  gap: 1rem;
  overflow-x: auto;
  padding-bottom: 0.5rem;
}

/* Individual group column */
.sga-group-column {
  min-width: 260px;
  width: 280px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  overflow: hidden;
}

.sga-group-header {
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.sga-group-title {
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.sga-group-meta {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.sga-member-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  font-size: 0.75rem;
  color: var(--text-secondary);
  background: var(--bg-main);
  padding: 0.15rem 0.5rem;
  border-radius: 10px;
}

.sga-threshold-badge {
  display: inline-flex;
  align-items: center;
  font-size: 0.7rem;
  padding: 0.15rem 0.5rem;
  border-radius: 10px;
  font-weight: 500;
}
.sga-threshold-badge[data-threshold="Niedrig"] { background: #d1fae5; color: #065f46; }
.sga-threshold-badge[data-threshold="Normal"] { background: #dbeafe; color: #1e40af; }
.sga-threshold-badge[data-threshold="Hoch"] { background: #fef3c7; color: #92400e; }
.sga-threshold-badge[data-threshold="Dringend"] { background: #fed7aa; color: #9a3412; }
.sga-threshold-badge[data-threshold="Notfall"] { background: #fecaca; color: #991b1b; }

.sga-project-count {
  font-size: 0.75rem;
  color: var(--text-secondary);
  margin-left: auto;
}

/* Drop zone inside each group column */
.sga-group-dropzone {
  flex: 1;
  overflow-y: auto;
  padding: 0.5rem;
  min-height: 80px;
  transition: background-color 0.2s;
}
.sga-group-dropzone.sga-drop-hover {
  background-color: rgba(var(--primary-rgb, 59, 130, 246), 0.08);
}

/* Pool drop zone highlight for remove drag-back */
.sga-project-list.sga-drop-hover {
  background-color: rgba(239, 68, 68, 0.06);
}

/* Assigned project card inside a group column */
.sga-assigned-card {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.4rem 0.6rem;
  margin-bottom: 0.25rem;
  background: var(--bg-main);
  border: 1px solid var(--border-color);
  border-radius: 5px;
  font-size: 0.82rem;
  color: var(--text-primary);
  cursor: grab;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.sga-assigned-card:hover {
  border-color: var(--primary);
  box-shadow: 0 1px 3px rgba(0,0,0,0.08);
}
.sga-assigned-card:active {
  cursor: grabbing;
}

.sga-assigned-name {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sga-remove-btn {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border: none;
  background: transparent;
  color: var(--text-secondary);
  cursor: pointer;
  border-radius: 4px;
  font-size: 1rem;
  line-height: 1;
  transition: background-color 0.15s, color 0.15s;
}
.sga-remove-btn:hover {
  background: rgba(239, 68, 68, 0.1);
  color: #ef4444;
}

/* Empty states */
.sga-empty-state {
  padding: 1.5rem 1rem;
  text-align: center;
  color: var(--text-secondary);
  font-size: 0.85rem;
  font-style: italic;
}

.sga-no-results {
  padding: 1rem;
  text-align: center;
  color: var(--text-secondary);
  font-size: 0.85rem;
}

/* Selection count bar */
.sga-selection-bar {
  padding: 0.5rem 1rem;
  background: var(--primary);
  color: #fff;
  font-size: 0.8rem;
  font-weight: 500;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--border-color);
}
.sga-selection-bar button {
  background: rgba(255,255,255,0.2);
  border: none;
  color: #fff;
  padding: 0.25rem 0.75rem;
  border-radius: 4px;
  cursor: pointer;
  font-size: 0.78rem;
}
.sga-selection-bar button:hover {
  background: rgba(255,255,255,0.3);
}

/* No groups state */
.sga-no-groups {
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 1;
  color: var(--text-secondary);
  font-size: 1rem;
  font-style: italic;
  padding: 2rem;
}

/* Redmine sync status indicator */
.sga-sync-status {
  font-size: 0.78rem;
  padding: 0.3rem 0.75rem;
  border-radius: 6px;
  font-weight: 500;
  white-space: nowrap;
}
.sga-sync-status.sga-sync-running {
  color: #92400e;
  background: #fef3c7;
}
.sga-sync-status.sga-sync-done {
  color: #065f46;
  background: #d1fae5;
}
.sga-sync-status.sga-sync-error {
  color: #991b1b;
  background: #fecaca;
}

/* Responsive: stack on smaller screens */
@media (max-width: 900px) {
  .sga-wrapper {
    flex-direction: column;
    height: auto;
  }
  .sga-project-pool {
    width: 100%;
    max-height: 300px;
  }
  .sga-group-columns {
    flex-direction: column;
  }
  .sga-group-column {
    width: 100%;
    min-width: auto;
  }
}
