/*
 * PRIMROSE CUSTOMER DASHBOARD
 * Scoped styles.
 * Existing application styles remain unchanged.
 */

.pcd-overview {
  margin-bottom: 20px;
}

.pcd-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 24px;
  border-radius: 16px;
  background: linear-gradient(
    120deg,
    #102b4f,
    #1e4d78
  );
  color: #fff;
  margin-bottom: 16px;
}

.pcd-header h2 {
  color: #fff;
  font-size: 26px;
  margin: 8px 0;
}

.pcd-header p {
  color: #dbeafe;
  margin: 0;
}

.pcd-eyebrow {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 1.6px;
  color: #93c5fd;
}

.pcd-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.pcd-stat {
  min-width: 0;
  border-radius: 14px;
  padding: 18px;
  border: 1px solid #e2e8f0;
  background: #fff;
  box-shadow: 0 4px 14px rgba(15, 23, 42, .05);
  border-left: 5px solid #64748b;
}

.pcd-stat-label {
  display: block;
  color: #64748b;
  font-size: 12px;
  font-weight: 700;
  margin-bottom: 10px;
}

.pcd-stat-value {
  display: block;
  font-size: 20px;
  font-weight: 800;
  overflow-wrap: anywhere;
  color: #0f172a;
}

.pcd-success {
  border-left-color: #16a34a;
  background: #f0fdf4;
}

.pcd-danger {
  border-left-color: #dc2626;
  background: #fef2f2;
}

.pcd-warning {
  border-left-color: #d97706;
  background: #fffbeb;
}

.pcd-overview .pcd-stat:nth-child(3) {
  border-left-color: #2563eb;
}

.pcd-overview .pcd-stat:nth-child(4) {
  border-left-color: #0d9488;
}

.pcd-overview .pcd-stat:nth-child(5) {
  border-left-color: #7c3aed;
}

.pcd-overview .pcd-stat:nth-child(6) {
  border-left-color: #ea580c;
}

@media (max-width: 1000px) {
  .pcd-stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 600px) {
  .pcd-header {
    padding: 18px;
  }

  .pcd-header h2 {
    font-size: 21px;
  }

  .pcd-stats {
    grid-template-columns: 1fr;
  }

  .pcd-stat {
    padding: 15px;
  }

  .pcd-stat-value {
    font-size: 18px;
  }
}


/* PRIMROSE CUSTOMER LAYOUT PHASE 2D FIXED */

.pcd-diagnostics-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.pcd-diagnostics-heading h3 {
  margin: 0;
}

.pcd-diagnostics-toggle {
  border: 0;
  border-radius: 8px;
  background: #2563eb;
  color: #ffffff;
  padding: 9px 14px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
}

.pcd-diagnostics-toggle:hover {
  background: #1d4ed8;
}

#customerConnectionDiagnostics[hidden] {
  display: none !important;
}

#operatorUsageGraph {
  max-height: 250px;
  overflow: hidden;
}

#operatorUsageGraph svg {
  width: 100%;
  max-height: 240px;
}

#operatorUsageGraph canvas {
  max-height: 240px !important;
}

@media (max-width: 600px) {
  #operatorUsageGraph {
    max-height: 220px;
  }

  .pcd-diagnostics-heading {
    align-items: flex-start;
  }
}


/* PRIMROSE PHASE 3B CORRECTED */

.pcd-stat {
  position: relative;
  padding-bottom: 54px;
}

.pcd-card-action {
  position: absolute;
  right: 12px;
  bottom: 12px;
  border: 1px solid #cbd5e1;
  border-radius: 7px;
  background: #fff;
  color: #1e40af;
  padding: 6px 10px;
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
}

.pcd-card-action:hover {
  background: #eff6ff;
}

.pcd-modal[hidden] {
  display: none !important;
}

.pcd-modal {
  position: fixed;
  inset: 0;
  z-index: 99999;
  background: rgba(15,23,42,.68);
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 18px;
}

.pcd-modal-dialog {
  width: min(720px,100%);
  max-height: 90vh;
  overflow-y: auto;
  background: #fff;
  color: #0f172a;
  border-radius: 14px;
  padding: 22px;
  box-shadow: 0 20px 60px rgba(0,0,0,.25);
}

.pcd-modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
}

.pcd-modal-header h3 {
  margin: 0;
}

#pcdModalClose {
  border: 0;
  border-radius: 7px;
  background: #fee2e2;
  color: #991b1b;
  font-size: 24px;
  cursor: pointer;
  padding: 2px 12px;
}

#pcdModalBody > .panel {
  margin: 0;
  padding: 0;
  border: 0;
  box-shadow: none;
}

body.pcd-modal-open {
  overflow: hidden;
}

#operatorUsageGraph {
  width: 100%;
  max-width: none;
}

#operatorUsageGraph svg {
  width: 100%;
  max-width: none;
  height: 220px;
}


/* PRIMROSE PHASE 3C PART 1 */

.pcd-edit-customer {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  margin: 8px 0 14px;
  padding: 9px 15px;
  border: 1px solid #2563eb;
  border-radius: 8px;
  background: #eff6ff;
  color: #1d4ed8;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
}

.pcd-edit-customer:hover {
  background: #dbeafe;
}

.pcd-edit-customer:disabled {
  opacity: .6;
  cursor: wait;
}

#operatorUsageGraph {
  display: block;
  width: 100% !important;
  min-width: 0 !important;
  max-width: 100% !important;
  box-sizing: border-box;
}

#operatorUsageGraph svg {
  display: block;
  width: 100% !important;
  min-width: 0 !important;
  max-width: 100% !important;
  height: auto;
  max-height: 240px;
}

#pcdModalBody > .panel > h3[hidden] {
  display: none !important;
}



/* PRIMROSE PHASE 3C SAFE CORRECTION */

.pcd-hidden-list-edit {
  display: none !important;
}

.pcd-customer-details-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 14px;
}

.pcd-customer-details-heading h3,
.pcd-customer-details-heading .pcd-edit-customer {
  margin: 0;
}

.pcd-package-change {
  display: grid;
  gap: 14px;
}

.pcd-package-change select {
  width: 100%;
  padding: 12px;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
}

.pcd-package-warning {
  background: #fff7ed;
  color: #9a3412;
  padding: 12px;
  border-radius: 8px;
  font-size: 12px;
}


/* PRIMROSE CUSTOMER LIST PHASE 3D FIXED */

.pcd-hidden-view {
  display: none !important;
}

.pcd-customer-link {
  display: inline;
  width: auto;
  min-height: 0;
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
  color: #1764b4;
  font: inherit;
  font-weight: 600;
  text-align: left;
  cursor: pointer;
}

.pcd-customer-link:hover {
  color: #0b4381;
  text-decoration: underline;
}

.pcd-customer-link:focus-visible {
  outline: 2px solid #1764b4;
  outline-offset: 3px;
  border-radius: 3px;
}


/* PRIMROSE CUSTOMER FULL CELL CLICK PHASE 3F */

.pcd-clickable-cell {
  cursor: pointer !important;
  color: #1764b4;
}

.pcd-clickable-cell:hover {
  background: #f0f7ff !important;
  color: #0b4381;
}

.pcd-clickable-cell:focus-visible {
  outline: 2px solid #1764b4;
  outline-offset: -2px;
  background: #f0f7ff;
}



/* PRIMROSE PHASE 3H PACKAGE POPUP UPGRADE */

.pcd-package-current {
  padding: 14px;
  border: 1px solid #dbeafe;
  border-radius: 10px;
  background: #eff6ff;
}

.pcd-package-current strong {
  display: block;
  margin-bottom: 6px;
  color: #1e40af;
}

.pcd-package-preview {
  padding: 14px;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  background: #f8fafc;
}

.pcd-package-preview-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 15px;
  padding: 9px 0;
  border-bottom: 1px solid #e2e8f0;
}

.pcd-package-preview-row:last-child {
  border-bottom: none;
}

.pcd-package-preview-row span {
  color: #64748b;
}

.pcd-package-preview-row strong {
  color: #0f172a;
  text-align: right;
}

#pcdPackageSave:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}


/* PRIMROSE CUSTOMER USAGE GRAPH LAYOUT 2026-10-13 */

.pcd-usage-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
  margin-bottom: 8px;
}

.pcd-usage-header h3 {
  margin: 8px 0 0;
  white-space: nowrap;
}

.pcd-usage-header .pcd-usage-buttons {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 6px;
  margin-left: auto;
}

.pcd-usage-header .usagePeriod {
  width: auto;
  min-width: 115px;
  padding: 7px 10px;
  font-size: 12px;
  text-align: left;
}

.pcd-usage-header .usagePeriod small {
  font-size: 10px;
}

#operatorUsageGraph {
  max-height: none !important;
  height: auto !important;
  overflow: visible !important;
}

#operatorUsageGraph svg {
  display: block;
  width: 100% !important;
  height: 300px !important;
  max-height: none !important;
  overflow: visible !important;
}

@media (max-width: 700px) {
  .pcd-usage-header {
    display: block;
  }

  .pcd-usage-header .pcd-usage-buttons {
    justify-content: flex-start;
    margin: 10px 0;
  }

  .pcd-usage-header .usagePeriod {
    min-width: 100px;
  }
}
