/* =========================================================
   NETASSET — LIFECYCLE / STATUS
   lifecycle.css
========================================================= */

/* =========================================================
   PAGE ROOT
========================================================= */

.lifecycle-page {
  background: #f4f7fb;
  color: #071b3a;
  font-family: "Inter", sans-serif;
}

.lifecycle-main {
  min-width: 0;
  background: #f4f7fb;
}

/* =========================================================
   PAGE HEADER
   SAME STRUCTURE AS LOCATIONS
========================================================= */

.lifecycle-topbar {
  min-height: 114px;

  padding: 28px 36px;

  background: #ffffff;

  border-bottom: 1px solid #d7e1ed;

  display: flex;
  align-items: center;
  justify-content: space-between;

  gap: 24px;
}

/* HEADING */

.lifecycle-heading {
  min-width: 0;
}

.lifecycle-heading .breadcrumb {
  margin-bottom: 4px;

  font-family: "Inter", sans-serif;
  font-size: 13px;
  font-weight: 500;

  line-height: 1.4;

  color: #6682a4;
}

.lifecycle-heading .page-title {
  margin: 0;

  font-family: "Space Grotesk", sans-serif;
  font-size: 28px;
  font-weight: 700;

  line-height: 1.15;

  letter-spacing: -0.4px;

  color: #071b3a;
}

/* =========================================================
   HEADER ACTIONS

   THIS FIXES:
   Refresh + Add Status
   → pushed completely to the right
========================================================= */

.lifecycle-topbar .topbar-actions {
  display: flex;

  align-items: center;

  gap: 10px;

  flex-shrink: 0;

  margin-left: auto;
}

/* REFRESH */

.lifecycle-refresh-btn {
  width: 46px;
  height: 46px;

  display: inline-flex;

  align-items: center;
  justify-content: center;

  border: 1px solid #d5e0ed;

  border-radius: 10px;

  background: #f1f3f6;

  color: #071b3a;

  font-family: "Inter", sans-serif;

  font-size: 19px;
  font-weight: 600;

  cursor: pointer;

  transition:
    background 0.18s ease,
    border-color 0.18s ease,
    color 0.18s ease,
    transform 0.18s ease;
}

.lifecycle-refresh-btn:hover {
  background: #ffffff;

  border-color: #0fb7b0;

  color: #009e9a;
}

.lifecycle-refresh-btn:active {
  transform: rotate(90deg);
}

/* ADD */

.lifecycle-add-btn {
  min-height: 46px;

  padding: 0 20px;

  border-radius: 10px;

  font-family: "Inter", sans-serif;

  font-size: 13px;

  font-weight: 600;

  letter-spacing: 0;
}

/* =========================================================
   PAGE CONTENT
========================================================= */

.lifecycle-content {
  padding: 34px 36px 48px;
}

/* =========================================================
   MAIN PANEL
========================================================= */

.lifecycle-panel {
  width: 100%;

  overflow: hidden;

  background: #ffffff;

  border: 1px solid #d5e0ed;

  border-radius: 12px;

  box-shadow: 0 1px 2px rgba(7, 27, 58, 0.02);
}

/* =========================================================
   TOOLBAR
========================================================= */

.lifecycle-toolbar {
  min-height: 76px;

  padding: 16px 20px;

  display: flex;

  align-items: center;

  justify-content: space-between;

  gap: 18px;

  border-bottom: 1px solid #d5e0ed;

  background: #ffffff;
}

/* SEARCH */

.lifecycle-search {
  width: min(520px, 100%);

  height: 44px;

  position: relative;

  display: flex;

  align-items: center;
}

.lifecycle-search-icon {
  position: absolute;

  left: 14px;

  color: #52759e;

  pointer-events: none;

  font-size: 16px;
}

.lifecycle-search input {
  width: 100%;

  height: 44px;

  padding: 0 15px 0 42px;

  border: 1px solid #d2dfed;

  border-radius: 9px;

  outline: none;

  background: #ffffff;

  color: #071b3a;

  font-family: "Inter", sans-serif;

  font-size: 13px;

  font-weight: 400;

  transition:
    border-color 0.18s ease,
    box-shadow 0.18s ease;
}

.lifecycle-search input::placeholder {
  color: #7891af;
}

.lifecycle-search input:hover {
  border-color: #bdcede;
}

.lifecycle-search input:focus {
  border-color: #0fb7b0;

  box-shadow: 0 0 0 3px rgba(15, 183, 176, 0.1);
}

/* =========================================================
   FILTERS
========================================================= */

.lifecycle-filters {
  display: flex;

  align-items: flex-end;

  gap: 10px;

  flex-shrink: 0;
}

.lifecycle-filter-group {
  width: 178px;

  display: flex;

  flex-direction: column;

  gap: 6px;
}

.lifecycle-filter-group label {
  font-size: 11px;

  font-weight: 500;

  color: #58769a;
}

.lifecycle-filter-group select {
  width: 100%;

  height: 44px;

  padding: 0 38px 0 14px;

  border: 1px solid #d2dfed;

  border-radius: 9px;

  outline: none;

  background-color: #ffffff;

  color: #071b3a;

  font-family: "Inter", sans-serif;

  font-size: 13px;

  font-weight: 500;

  cursor: pointer;

  transition:
    border-color 0.18s ease,
    box-shadow 0.18s ease;
}

.lifecycle-filter-group select:hover {
  border-color: #bdcede;
}

.lifecycle-filter-group select:focus {
  border-color: #0fb7b0;

  box-shadow: 0 0 0 3px rgba(15, 183, 176, 0.1);
}

/* =========================================================
   STATISTICS
   SAME DIMENSION AS LOCATIONS
========================================================= */

.lifecycle-stats {
  width: 100%;

  display: grid;

  grid-template-columns: repeat(4, minmax(0, 1fr));

  background: #ffffff;

  border-bottom: 1px solid #d5e0ed;
}

.lifecycle-stat {
  min-height: 104px;

  padding: 22px 24px;

  display: flex;

  flex-direction: column;

  justify-content: center;

  border-right: 1px solid #d5e0ed;
}

.lifecycle-stat:last-child {
  border-right: none;
}

.lifecycle-stat-label {
  display: block;

  margin-bottom: 8px;

  font-family: "Inter", sans-serif;

  font-size: 11px;

  font-weight: 600;

  line-height: 1.3;

  text-transform: uppercase;

  letter-spacing: 0.7px;

  color: #5d7b9f;
}

.lifecycle-stat-value {
  display: block;

  font-family: "Space Grotesk", sans-serif;

  font-size: 28px;

  font-weight: 700;

  line-height: 1;

  letter-spacing: -0.5px;

  color: #071b3a;
}

.lifecycle-stat-description {
  margin-top: 7px;

  color: #6682a4;

  font-size: 11px;
}

/* =========================================================
   TABLE HEADING
========================================================= */

.lifecycle-table-heading {
  min-height: 86px;

  padding: 0 20px;

  display: flex;

  align-items: center;

  justify-content: space-between;

  gap: 18px;

  background: #ffffff;
}

.lifecycle-table-heading h2 {
  margin: 0;

  color: #071b3a;

  font-family: "Space Grotesk", sans-serif;

  font-size: 18px;

  font-weight: 700;
}

.lifecycle-table-heading p {
  margin: 5px 0 0;

  color: #6682a4;

  font-family: "Inter", sans-serif;

  font-size: 12px;
}

.lifecycle-result-count {
  color: #607d9e;

  font-family: "IBM Plex Mono", monospace;

  font-size: 11px;

  white-space: nowrap;
}

/* =========================================================
   TABLE
========================================================= */

.lifecycle-table-wrapper {
  width: 100%;

  overflow-x: auto;

  background: #ffffff;
}

.lifecycle-table {
  width: 100%;

  border-collapse: collapse;

  table-layout: fixed;

  font-family: "Inter", sans-serif;
}

/* COLUMN WIDTH */

.lifecycle-table .status-column {
  width: 22%;
}

.lifecycle-table .group-column {
  width: 15%;
}

.lifecycle-table .color-column {
  width: 13%;
}

.lifecycle-table .sort-column {
  width: 13%;
}

.lifecycle-table .active-column {
  width: 12%;
}

.lifecycle-table .updated-column {
  width: 13%;
}

.lifecycle-table .actions-column {
  width: 12%;
}

/* HEADER */

.lifecycle-table thead {
  background: #f4f7fa;
}

.lifecycle-table th {
  height: 50px;

  padding: 0 18px;

  border-bottom: 1px solid #d5e0ed;

  color: #58769a;

  font-family: "Inter", sans-serif;

  font-size: 11px;

  font-weight: 600;

  line-height: 1.2;

  letter-spacing: 0.65px;

  text-align: left;

  text-transform: uppercase;

  white-space: nowrap;
}

/* ROW */

.lifecycle-table tbody tr {
  background: #ffffff;

  transition: background 0.15s ease;
}

.lifecycle-table tbody tr:hover {
  background: #f9fbfd;
}

.lifecycle-table td {
  padding: 19px 18px;

  border-bottom: 1px solid #dbe4ee;

  vertical-align: middle;

  color: #071b3a;

  font-size: 13px;

  font-weight: 400;

  line-height: 1.45;
}

/* =========================================================
   EMPTY STATE
========================================================= */

.lifecycle-empty-state {
  min-height: 280px;

  padding: 48px 24px;

  display: flex;

  flex-direction: column;

  align-items: center;

  justify-content: center;

  text-align: center;

  background: #ffffff;
}

.lifecycle-empty-icon {
  width: 46px;

  height: 46px;

  margin-bottom: 14px;

  display: flex;

  align-items: center;

  justify-content: center;

  border: 1px solid #d6e2ee;

  border-radius: 12px;

  background: #f5f8fb;

  color: #6884a5;

  font-size: 22px;
}

.lifecycle-empty-state h3 {
  margin: 0 0 7px;

  color: #071b3a;

  font-family: "Space Grotesk", sans-serif;

  font-size: 16px;

  font-weight: 600;
}

.lifecycle-empty-state p {
  margin: 0;

  color: #6c87a7;

  font-size: 13px;
}

/* =========================================================
   TABLE FOOTER
========================================================= */

.lifecycle-table-footer {
  min-height: 58px;

  padding: 0 18px;

  display: flex;

  align-items: center;

  justify-content: space-between;

  gap: 18px;

  border-top: 1px solid #d5e0ed;

  background: #ffffff;

  color: #607d9e;

  font-family: "Inter", sans-serif;

  font-size: 12px;
}

.lifecycle-table-footer strong {
  color: #071b3a;
}

/* =========================================================
   STATUS BADGES
========================================================= */

.lifecycle-status-badge {
  display: inline-flex;

  align-items: center;

  gap: 6px;

  min-height: 27px;

  padding: 0 9px;

  border-radius: 7px;

  font-size: 11px;

  font-weight: 500;
}

.lifecycle-status-dot {
  width: 6px;

  height: 6px;

  border-radius: 50%;

  background: currentColor;
}

/* ACTIVE */

.lifecycle-status-badge.active {
  background: #eaf8f2;

  color: #238765;
}

/* INACTIVE */

.lifecycle-status-badge.inactive {
  background: #f1f3f5;

  color: #718096;
}

/* =========================================================
   MODAL
========================================================= */

.lifecycle-modal {
  width: min(760px, calc(100vw - 48px));

  max-height: calc(100vh - 48px);

  padding: 0;

  overflow: hidden;

  border: 1px solid #d5e0ed;

  border-radius: 12px;

  background: #ffffff;

  box-shadow: 0 24px 70px rgba(7, 27, 58, 0.2);
}

.lifecycle-modal::backdrop {
  background: rgba(7, 27, 58, 0.55);
}

.lifecycle-modal-inner {
  display: flex;

  flex-direction: column;
}

/* HEADER */

.lifecycle-modal-header {
  min-height: 88px;

  padding: 20px 24px;

  display: flex;

  align-items: center;

  justify-content: space-between;

  gap: 20px;

  border-bottom: 1px solid #d5e0ed;

  background: #ffffff;
}

.lifecycle-modal-eyebrow {
  margin-bottom: 5px;

  color: #079f9d;

  font-family: "IBM Plex Mono", monospace;

  font-size: 10px;

  font-weight: 500;

  letter-spacing: 0.8px;

  text-transform: uppercase;
}

.lifecycle-modal-header h2 {
  margin: 0;

  color: #071b3a;

  font-family: "Space Grotesk", sans-serif;

  font-size: 22px;

  font-weight: 700;
}

.lifecycle-modal-header p {
  margin: 5px 0 0;

  color: #6682a4;

  font-family: "Inter", sans-serif;

  font-size: 11px;
}

/* CLOSE */

.lifecycle-modal-close {
  width: 38px;

  height: 38px;

  flex-shrink: 0;

  display: inline-flex;

  align-items: center;

  justify-content: center;

  border: 1px solid #d5e0ed;

  border-radius: 8px;

  background: #ffffff;

  color: #071b3a;

  font-size: 21px;

  cursor: pointer;
}

.lifecycle-modal-close:hover {
  border-color: #0fb7b0;

  background: #f4fffe;

  color: #009f9b;
}

/* =========================================================
   FORM
========================================================= */

.lifecycle-modal form {
  padding: 24px;
}

.lifecycle-form-grid {
  display: grid;

  grid-template-columns: repeat(2, minmax(0, 1fr));

  gap: 18px 20px;
}

.lifecycle-form-group {
  min-width: 0;

  display: flex;

  flex-direction: column;

  gap: 7px;
}

.lifecycle-form-group.full {
  grid-column: 1 / -1;
}

.lifecycle-form-group label {
  color: #071b3a;

  font-family: "Inter", sans-serif;

  font-size: 11px;

  font-weight: 600;
}

.lifecycle-form-group label span {
  color: #0fb7b0;
}

.lifecycle-form-group input,
.lifecycle-form-group select {
  width: 100%;

  min-height: 42px;

  box-sizing: border-box;

  padding: 0 12px;

  border: 1px solid #d2dfed;

  border-radius: 8px;

  outline: none;

  background: #ffffff;

  color: #071b3a;

  font-family: "Inter", sans-serif;

  font-size: 12px;
}

.lifecycle-form-group input:focus,
.lifecycle-form-group select:focus {
  border-color: #0fb7b0;

  box-shadow: 0 0 0 3px rgba(15, 183, 176, 0.1);
}

.technical-field {
  background: #f7f9fb !important;

  font-family: "IBM Plex Mono", monospace !important;
}

/* =========================================================
   TOGGLE
========================================================= */

.lifecycle-toggle {
  min-height: 42px;

  display: flex !important;

  flex-direction: row !important;

  align-items: center;

  gap: 8px;

  cursor: pointer;
}

.lifecycle-toggle input {
  position: absolute;

  opacity: 0;
}

.lifecycle-toggle span {
  position: relative;

  width: 38px;

  height: 21px;

  flex-shrink: 0;

  border-radius: 999px;

  background: #ccd5df;

  transition: background 0.18s ease;
}

.lifecycle-toggle span::after {
  content: "";

  position: absolute;

  top: 3px;

  left: 3px;

  width: 15px;

  height: 15px;

  border-radius: 50%;

  background: #ffffff;

  transition: transform 0.18s ease;
}

.lifecycle-toggle input:checked + span {
  background: #0fb7b0;
}

.lifecycle-toggle input:checked + span::after {
  transform: translateX(17px);
}

/* =========================================================
   MODAL FOOTER
========================================================= */

.lifecycle-modal-footer {
  min-height: 70px;

  padding: 14px 24px;

  display: flex;

  align-items: center;

  justify-content: flex-end;

  gap: 9px;

  border-top: 1px solid #d5e0ed;

  background: #ffffff;
}

.lifecycle-modal-secondary,
.lifecycle-modal-primary {
  min-height: 38px;

  padding: 0 15px;

  border-radius: 8px;

  font-family: "Inter", sans-serif;

  font-size: 11px;

  font-weight: 600;

  cursor: pointer;
}

.lifecycle-modal-secondary {
  border: 1px solid #d2dfed;

  background: #ffffff;

  color: #557492;
}

.lifecycle-modal-primary {
  border: 1px solid #0fb7b0;

  background: #0fb7b0;

  color: #ffffff;
}

/* =========================================================
   RESPONSIVE
========================================================= */

@media (max-width: 1200px) {
  .lifecycle-content {
    padding: 28px 28px 40px;
  }

  .lifecycle-topbar {
    padding: 26px 28px;
  }

  .lifecycle-toolbar {
    flex-wrap: wrap;
  }

  .lifecycle-search {
    width: min(480px, 100%);
  }

  .lifecycle-filters {
    margin-left: auto;
  }

  .lifecycle-table {
    min-width: 1050px;
  }
}

@media (max-width: 900px) {
  .lifecycle-topbar {
    align-items: flex-start;

    flex-direction: column;
  }

  .lifecycle-topbar .topbar-actions {
    width: 100%;
  }

  .lifecycle-add-btn {
    flex: 1;
  }

  .lifecycle-toolbar {
    align-items: stretch;

    flex-direction: column;
  }

  .lifecycle-search {
    width: 100%;
  }

  .lifecycle-filters {
    width: 100%;

    display: grid;

    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .lifecycle-filter-group {
    width: 100%;
  }
}

@media (max-width: 640px) {
  .lifecycle-topbar {
    min-height: auto;

    padding: 22px 18px;
  }

  .lifecycle-heading .page-title {
    font-size: 24px;
  }

  .lifecycle-content {
    padding: 20px 14px 32px;
  }

  .lifecycle-panel {
    border-radius: 10px;
  }

  .lifecycle-toolbar {
    padding: 14px;
  }

  .lifecycle-filters {
    grid-template-columns: 1fr;
  }

  .lifecycle-stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .lifecycle-stat {
    min-height: 92px;

    padding: 18px;
  }

  .lifecycle-stat:nth-child(2) {
    border-right: none;
  }

  .lifecycle-stat:nth-child(-n + 2) {
    border-bottom: 1px solid #d5e0ed;
  }

  .lifecycle-stat-value {
    font-size: 24px;
  }

  .lifecycle-table-heading {
    align-items: flex-start;

    flex-direction: column;

    padding: 18px;
  }

  .lifecycle-table-footer {
    align-items: flex-start;

    flex-direction: column;

    padding: 14px 16px;
  }
}
