.header-container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: #fff;
  padding-top: 1rem;
}

.header-left .title {
  font-size: 1.875rem;
  font-weight: 700;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
  padding-right: 1rem;
}

.Card {
  &.active-card {
    font-family: Arial, Helvetica, sans-serif;
    border-style: solid;
    border-color: #e5e7eb;
    width: 100%;
    min-width: 150px;
    height: 100%;
    max-height: 115px;
    border-width: 1px;
    background-color: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 0.5rem;
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.5);
  }
}

.status-badge {
  padding: 0.5rem 1rem;
  border-radius: 0.375rem;
  font-size: 0.75rem;
  font-weight: 500;
  text-transform: capitalize;
  background-color: #1976d2;
  color: #ffffff;
  cursor: pointer;
}

.span {
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 12px;
  display: inline-block;
}

// .Card-div {
//   height: 160px;
//   width: 100%;
//   max-width: 100%;
//   background-color: #fff;
//   justify-content: space-between;
//   align-items: center;
//   display: flex;
//   padding-top: 1rem;
// }
.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;
}

.Card {
  flex: 1 1 calc(25% - 1rem);
  min-width: 150px;
  max-width: 100%;
  height: 126px;
  margin: 1rem;
  background: #fff;
}


@media (max-width: 768px) {
  .Card {
    flex: 1 1 calc(25% - 1rem);
  }
}

/* Mobile (480px) - 2 per row */
@media (max-width: 480px) {
  .Card-div {
    display: flex;
    flex-wrap: wrap;
    height: auto;
    width: 100%;
  }

  .Card-header {
    flex-direction: column;
  }

  .Card {
    flex: 1 1 calc(50% - 1rem);

    &.active-card {
      max-height: 150px;
      min-width: 150px;
      max-width: 90%;
    }
  }
}


.grid {
  display: grid;
  background-color: #fff;
}

.grid-cols-1 {
  grid-template-columns: repeat(1, minmax(0, 1fr));
}

.md-grid-cols-2 {
  grid-template-columns: repeat(1, minmax(0, 1fr));
}

@media (min-width: 768px) {
  .md-grid-cols-2 {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

// .newcard {
//   background-color: #fff;
//   border: 1px solid #e2e8f0;
//   border-radius: 0.5rem;
//   box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
//   margin: 1rem;
// }
.newcard {
  background-color: #fff;
 border: 1px solid #e2e8f0;
  border-radius: 0.5rem;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
  margin: 1rem;
  max-height: 240px;   /* height adjust pannalam */
  overflow-y: auto;    /* vertical scroll varum */
  // padding: 1rem;
  padding-bottom: 1rem;
  padding-left: 1rem;
  padding-right: 1rem;
}


.title {
  font-weight: 600;
  font-size: 1.5rem;
  padding-top: 1.5rem;
  letter-spacing: -0.025em;
  padding-left: 1.5rem;
}

.subtitle {
  font-size: 0.875rem;
  line-height: 1.25rem;
  padding-left: 1.5rem;
  color: hsl(0, 0%, 45.1%);
  padding-bottom: 1rem;
}

.priority-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
  padding-top: 10px;
  padding-left: 22px;
}

.priority-label {
  display: flex;
  align-items: center;
  width: 160px;
}

.priority-button {
  padding: 2px 10px;
  border-radius: 12px;
  font-size: 12px;
  font-weight: bold;
  color: white;
  text-transform: capitalize;
  background-color: lightblue;

  &.low {
    background-color: white;
    color: #000;
    border: 1px solid gray;
  }

  &.medium {
    background-color: #cdd7ee;
    color: #000;
    font-weight: 500;
  }

  &.high {
    background-color: #ef5350;
  }

  &.critical {
    background-color: #d32f2f;
  }
}

.category-button {
  padding: 2px 10px;
  border-radius: 12px;
  font-size: 12px;
  font-weight: bold;
  border: 1px solid lightgray;
  text-transform: capitalize;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.count {
  font-weight: 500;
  color: #444;
  padding-left: 5px;
  font-size: 12px;
}

.progress-bar-fixed {
  width: 70px;
  height: 15px;
  background-color: hsl(210, 40%, 96%);
  border-radius: 20px;
  overflow: hidden;
  display: inline-block;
  vertical-align: middle;
  margin-right: 6px;
}

.progress-fill {
  height: 100%;
  border-radius: 20px;
  background-color: #1976d2;
  transition: width 0.3s ease-in-out;
}

.progress-text {
  width: 50px;
  text-align: left;
  font-size: 12px;
  color: #333;
}

// SLA Container
.SLA-container {
  width: 100%;
  height: 100%;
  font-family: Arial, Helvetica, sans-serif;
  border-style: solid;
  border-color: #e5e7eb;
  border-width: 1px;
  border-radius: 0.5rem;
  background-color: #fff;
  border: 1px solid #e2e8f0;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
  display: flex;
  flex-direction: column;
}

.header-row {
  display: flex;
  justify-content: space-between;
  align-items: center;

  padding-left: 1.5rem;
  padding-right: 1.5rem;
}

.title-section {
  display: flex;
  flex-direction: column;
}

// 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);
}

// Filters
.filters {

  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  padding: 20px;
  align-items: flex-start;
}

.filters input[type="text"] {
  flex: 1;
  padding: 12px 16px;
  padding-left: 40px;
  border: 1px solid #e0e0e0;
  border-radius: 8px;
  font-size: 14px;
  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;

  &:focus {
    border-color: #4299e1;
    background-color: #fff;
    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: #fff;
  color: #2d3748;
  min-width: 140px;
  cursor: pointer;
  outline: none;
  transition: all 0.3s ease;

  &:focus {
    border-color: #4299e1;
    box-shadow: 0 0 0 3px rgba(66, 153, 225, 0.1);
  }

  &:hover {
    border-color: #cbd5e0;
  }
}

// Ticket Grid (Card View)
.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;
}

// 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;
}

// Status Badges
.badge-closed {
  background-color: #059669;
  color: #fff;
}

.badge-pending {
  background-color: #3b82f6;
  color: #fff;
}

.badge-allotted {
  background-color: #f59e0b;
  color: #fff;
}

.badge-Completed {
  background-color: #22c55e;
  color: #fff;
}
.badge-pick {
  background-color: #6b7280; /* gray */
  color: #fff;
  padding: 4px 10px;
}

/* Work in progress */
.badge-pending {
  background-color: #3b82f6; /* blue */
  color: #fff;
  padding: 4px 10px;
}

.badge-allotted {
  background-color: #f59e0b; /* amber */
  color: #fff;
  padding: 4px 10px;
}

.badge-postponed {
  background-color: #a855f7; /* purple */
  color: #fff;
  padding: 4px 10px;
}

.badge-callback {
  background-color: #0ea5e9; /* sky blue */
  color: #fff;
  padding: 4px 10px;
}

/* Final states */
.badge-Completed {
  background-color: #22c55e; 
  color: #fff;
  padding: 4px 10px;
}
.badge-acknowledge {
  background-color: #8b5cf6; /* purple */
  color: #fff;
  padding: 4px 10px;
}

.badge-reopen {
  background-color: #dc2626; /* red */
  color: #fff;
  padding: 4px 10px;
}


.badge-closed {
  background-color: #059669; 
  color: #fff;
  padding: 4px 10px;
}

.badge-cancel {
  background-color: #ef4444; 
  color: #fff;
  padding: 4px 10px;
}


.badge-request-cancel {
  background-color: #f97316; 
  color: #fff;
  padding: 4px 10px;
}

.badge-waiting-spares {
  background-color: #6366f1; 
  color: #fff;
  padding: 4px 10px;
}

.badge-pending-approval {
  background-color: #eab308; 
  color: #000;
  padding: 4px 10px;
}


.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 16px;
  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: 280px;
  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: 510;
  font-size: 12px;
  color: gray;
  border-bottom: 2px solid #e5e7eb;
  position: sticky;
  top: 0;
  z-index: 10;
  font-size: 12px;
}

.rightalign {
  text-align: right !important;
}

.table-row {
  border-bottom: 1px solid #f3f4f6;
  transition: background-color 0.2s ease;

  &:hover {
    background-color: #f9fafb;
  }

  td {
    padding: 12px 13px;
    vertical-align: top;
  }
}

.title-text {
  font-weight: 500;
  color: #374151;
  margin-bottom: 4px;
}

.subtitle-text {
  font-size: 12px;
  color: #6b7280;
}

// 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;
}

.fontfamily {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
}

::ng-deep gb-card .title-icon-container {
  width: 40px;
  align-items: center;
  justify-content: center;
  display: flex;
  border-radius: 6px;
  padding-top: 5px;
  padding-bottom: 5px;
}

::ng-deep gb-card[ng-reflect-icon="confirmation_number"] .title-icon {
  color: #1e88e5 !important;
}

::ng-deep gb-card[ng-reflect-icon="access_time"] .title-icon {
  color: #ef6c00 !important;
}

::ng-deep gb-card[ng-reflect-icon="check_circle"] .title-icon {
  color: #2e7d32 !important;
}

::ng-deep gb-card[ng-reflect-icon="schedule"] .title-icon {
  color: #ef6c00 !important;
}

::ng-deep gb-card[ng-reflect-icon="error"] .title-icon {
  color: #d32f2f !important;
}

::ng-deep gb-card[ng-reflect-icon="confirmation_number"] .title-icon-container {
  background-color: #F0F7FD !important;
}

::ng-deep gb-card[ng-reflect-icon="check_circle"] .title-icon-container {
  background-color: #e8f5e9 !important;
}

::ng-deep gb-card[ng-reflect-icon="access_time"] .title-icon-container {
  background-color: #fff8e1 !important;
}

::ng-deep gb-card[ng-reflect-icon="schedule"] .title-icon-container {
  background-color: #fff8e1 !important;
}

::ng-deep gb-card[ng-reflect-icon="error"] .title-icon-container {
  background-color: #ffebee !important;
}

// 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%;
  }
}