.Card-div {
  height: auto;
  /* CHANGE from height: 160px; */
  width: 100%;
  background-color: #ffff;
  justify-content: space-between;
  align-items: center;
  display: flex;
  padding-top: 0.5rem;
  padding-bottom: 1rem;
  /* ADD THIS */
  margin-bottom: 2rem;
  /* ADD THIS */
}

.Card-header {
  height: 100%;
  width: 100%;
  // display: flex;
  // justify-content: space-between;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1.5rem;
}

.rightalign {
  text-align: right !important;
}

.Card {
  flex: 1 1 calc(25% - 20px);
  height: 126px;
  margin: 10px;
  background: #fff;
}

/* Tab Container */
.tab-container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  padding: 0 1rem;
}

.tabs-list {
  border-bottom: 1px solid #e2e8f0;
  background-color: #f1f5f9;
  border-radius: 8px;
  padding: 4px;
  display: flex;
  gap: 4px;
}

.tab-trigger {
  padding: 8px 16px;
  border: none;
  background-color: transparent;
  color: #6b7280;
  cursor: pointer;
  border-radius: 6px;
  font-size: 14px;
  transition: all 0.2s ease;

  &:hover {
    background-color: #f3f4f6;
    color: #374151;
  }

  &.active {
    background-color: #fff;
    color: #0f172a;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
  }
}

.tab-count {
  font-size: 12px;
  opacity: 0.8;
}

/* Toggle Switch */
.view-toggle {
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  flex-direction: row;
  padding-right: 6px;
}

.toggle-label {
  font-size: 14px;
  font-weight: 500;
  color: #374151;
}

.toggle-switch {
  width: 50px;
  height: 26px;
  background-color: #e5e7eb;
  border-radius: 13px;
  position: relative;
  cursor: pointer;
  transition: background-color 0.3s ease;
  border: 2px solid #e5e7eb;

  &:hover {
    background-color: #d1d5db;
    border-color: #d1d5db;
  }

  &.active {
    background-color: #3b82f6;
    border-color: #3b82f6;

    .toggle-slider {
      transform: translateX(24px);
    }
  }
}

.toggle-slider {
  width: 20px;
  height: 20px;
  background-color: white;
  border-radius: 50%;
  position: absolute;
  top: 1px;
  left: 1px;
  transition: transform 0.3s ease;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

/* Ticket Grid */
.ticket-grid {
  display: grid;
  padding: 1.5rem;
  grid-template-columns: repeat(auto-fit, minmax(450px, 1fr));
  gap: 24px;
  background-color: #fff;
}

/* Ticket Card */
.ticket-card {
  width: 100%;
  min-height: 280px;
  border-radius: 12px;
  padding: 20px;
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  border: 1px solid #e2e8f0;
  background-color: #fff;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
  transition: all 0.3s ease;
  display: flex;
  flex-direction: column;

  &:hover {
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
    transform: translateY(-2px);
    cursor: pointer;
  }
}

.ticket-header {
  font-weight: 600;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  font-size: 1.125rem;
  line-height: 1.4;
  margin-bottom: 8px;
}

.ticket-title {
  flex: 1;
  margin-right: 12px;
  word-break: break-word;
}

.ticket-badges {
  display: flex;
  gap: 6px;
  align-items: center;
  flex-shrink: 0;
}

/* Badges */
.priority-badge,
.status-badge {
  padding: 4px 12px;
  border-radius: 16px;
  font-size: 11px;
  font-weight: 600;
  text-transform: capitalize;
  letter-spacing: 0.5px;
  white-space: nowrap;
}

.default {
  background-color: #3b82f6;
  color: #fff;
}

/* Priority Badges */
.critical {
  background-color: #dc2626;
  color: #fff;
}

.high {
  background-color: #ef4444;
  color: #fff;
}

.medium {
  background-color: #f59e0b;
  color: #fff;
}

.low {
  background-color: #10b981;
  color: #fff;
}

/* Neutral / Default */
.badge-pick {
  background-color: #6b7280;
  /* gray */
  color: #fff;
}

/* Work in progress */
.badge-pending {
  background-color: #3b82f6;
  /* blue */
  color: #fff;
}

.badge-allotted {
  background-color: #f59e0b;
  /* amber */
  color: #fff;
}

.badge-postponed {
  background-color: #a855f7;
  /* purple */
  color: #fff;
}

.badge-callback {
  background-color: #0ea5e9;
  /* sky blue */
  color: #fff;
}

/* Final states */
.badge-Completed {
  background-color: #22c55e;
  color: #fff;
}

.badge-acknowledge {
  background-color: #8b5cf6;
  /* purple */
  color: #fff;
}

.badge-reopen {
  background-color: #dc2626;
  /* red */
  color: #fff;
}

.badge-closed {
  background-color: #059669;
  color: #fff;
}

.badge-cancel {
  background-color: #ef4444;
  color: #fff;
}

.badge-request-cancel {
  background-color: #f97316;
  color: #fff;
}

.badge-waiting-spares {
  background-color: #6366f1;
  color: #fff;
}

.badge-pending-approval {
  background-color: #eab308;
  color: #000;
}

/* Fallback */
.badge-default {
  background-color: #9ca3af;
  /* light gray */
  color: #fff;
}

.ticket-description {
  color: #6b7280;
  font-size: 0.875rem;
  line-height: 1.5;
  margin-bottom: 16px;
  flex-grow: 1;
}

/* Ticket Meta */
.ticket-meta {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  grid-template-rows: auto auto;
  gap: 12px 8px;
  margin-bottom: 20px;
  padding: 16px;
  background-color: #f8fafc;
  border-radius: 8px;
  border: 1px solid #e2e8f0;
}

.meta-item {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.813rem;
  line-height: 1.4;
  min-height: 40px;

  mat-icon {
    font-size: 18px;
    height: 18px;
    width: 18px;
    color: #64748b;
    flex-shrink: 0;
  }
}

.meta-content {
  display: flex;
  flex-direction: column;
  gap: 2px;
  flex: 1;
  min-width: 0;
}

.meta-main {
  font-weight: 500;
  color: #374151;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.meta-sub {
  font-size: 0.75rem;
  color: #6b7280;
  font-weight: 400;
}

/* Button Group */
.button-group {
  display: flex;
  gap: 12px;
  align-items: center;
  justify-content: flex-start;
  margin-top: auto;
  padding-top: 16px;
  border-top: 1px solid #e5e7eb;
}

.btn-outline,
.btn-primary {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 10px 16px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 500;
  justify-content: center;
  transition: all 0.2s ease;
  cursor: pointer;
  min-height: 40px;
}

.btn-wide {
  flex: 1;
}

.btn-outline {
  border: 1px solid #d1d5db;
  background: white;
  color: #374151;

  &:hover {
    background-color: #f3f4f6;
    border-color: #9ca3af;
  }
}

.btn-primary {
  border: none;
  background-color: #2563eb;
  color: white;

  &:hover {
    background-color: #1d4ed8;
  }
}

.btn-icon {
  height: 16px;
  width: 16px;
  font-size: 16px;
}

/* Table Styles */
.outer-container {
  background-color: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  margin: 1rem;
  overflow: hidden;
}

.inner-container {
  max-height: 400px;
  overflow-y: auto;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  margin: 20px;
}

.tickets-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

.table-header th {
  background-color: #f8fafc;
  padding: 12px 16px;
  text-align: left;
  font-weight: 600;
  color: gray;
  border-bottom: 2px solid #e5e7eb;
  position: sticky;
  top: 0;
  z-index: 10;
  font-size: 14px;
}

.table-row {
  border-bottom: 1px solid #f3f4f6;
  transition: background-color 0.2s ease;

  &:hover {
    background-color: #f9fafb;
  }

  td {
    padding: 12px 16px;
    vertical-align: top;
  }
}

.title-text {
  font-weight: 500;
  color: #374151;
  margin-bottom: 4px;
}

.subtitle-text {
  font-size: 12px;
  color: #6b7280;
}

.category-button {
  background-color: #e5e7eb;
  color: #374151;
  padding: 4px 8px;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 500;
}

/* Table Priority Badges */
.priority-critical,
.priority-high,
.priority-low,
.priority-button.medium {
  padding: 4px 8px;
  border-radius: 12px;
  font-size: 11px;
  font-weight: 600;
  color: #fff;
}

.priority-critical {
  background-color: #dc2626;
}

.priority-high {
  background-color: #ef4444;
}

.priority-low {
  background-color: #10b981;
}

.priority-button.medium {
  background-color: #f59e0b;
}

/* Responsive Design */
@media (max-width: 1200px) {
  .ticket-grid {
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 20px;
    padding: 1rem;
  }
}

@media (max-width: 768px) {
  .ticket-grid {
    grid-template-columns: 1fr;
    gap: 16px;
    padding: 0.75rem;
  }

  .ticket-meta {
    grid-template-columns: 1fr;
    grid-template-rows: repeat(6, auto);
    gap: 8px;
  }

  .button-group {
    flex-direction: column;
    gap: 8px;
  }

  .btn-wide {
    width: 100%;
  }

  .tab-container {
    flex-direction: column;
    gap: 16px;
    align-items: flex-start;
  }

  .view-toggle {
    margin-left: 0;
    align-self: flex-end;
  }
}

.filters {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 20px;
  overflow: hidden;
}

.filters input[type="text"] {
  flex: 1;
  padding: 12px 16px;
  padding-left: 40px;
  border: 1px solid #e0e0e0;
  border-radius: 8px;
  font-size: 14px;
  // background: #f8f9fa;
  background-image: url('data:image/svg+xml;charset=UTF-8,<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="gray" viewBox="0 0 16 16"><path d="M11.742 10.344a6.5 6.5 0 1 0-1.397 1.398h-.001c.03.04.062.078.098.115l3.85 3.85a1 1 0 0 0 1.415-1.414l-3.85-3.85a1.007 1.007 0 0 0-.115-.1zM12 6.5a5.5 5.5 0 1 1-11 0 5.5 5.5 0 0 1 11 0z"/></svg>');
  background-repeat: no-repeat;
  background-position: 12px center;
  outline: none;
  transition: all 0.3s ease;
}

.filters input[type="text"]:focus {
  border-color: #4299e1;
  background-color: #ffffff;
  box-shadow: 0 0 0 3px rgba(66, 153, 225, 0.1);
}

.filters select {
  padding: 12px 16px;
  border: 1px solid #e0e0e0;
  border-radius: 8px;
  font-size: 14px;
  background: #ffffff;
  color: #2d3748;
  min-width: 140px;
  cursor: pointer;
  outline: none;
  transition: all 0.3s ease;
}

.filters select:focus {
  border-color: #4299e1;
  box-shadow: 0 0 0 3px rgba(66, 153, 225, 0.1);
}

.filters select:hover {
  border-color: #cbd5e0;
}