/* =========================================================
   NDIS Service Agreement – Frontend (refined final)
   ========================================================= */
:root {
  --ndis-bg: #edf2f7;
  --ndis-surface: #ffffff;
  --ndis-border: #e2e8f0;
  --ndis-border-subtle: #eef2f7;
  --ndis-text: #0f172a;
  --ndis-muted: #64748b;
  --ndis-primary: #075985;
  --ndis-primary-soft: #e0f2fe;
  --ndis-accent: #0f766e;
  --ndis-danger: #f43f5e;
  --ndis-radius-lg: 14px;
  --ndis-radius-md: 10px;
  --ndis-radius-sm: 8px;
  --ndis-shadow-sm: 0 6px 18px rgba(15, 23, 42, 0.03);
  --ndis-shadow-md: 0 10px 25px rgba(15, 23, 42, 0.06);
  --ndis-font-sm: 11.5px;
  --ndis-font-md: 13px;
}

/* PAGE WRAPPER */
.ndis-page {
  width: 100%;
  max-width: 1180px;
  margin: 0 auto;
  padding: 18px 12px 40px;
  background: var(--ndis-bg);
  box-sizing: border-box;
}

/* =========================================================
   DASHBOARD
   ========================================================= */
.ndis-dashboard {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  margin-bottom: 14px;
}
.ndis-tile {
  background: var(--ndis-surface);
  border: 1px solid var(--ndis-border);
  border-radius: 12px;
  padding: 7px 10px 6px;
  min-width: 122px;
  box-shadow: var(--ndis-shadow-sm);
  box-sizing: border-box;
}
.ndis-tile-strong {
  background: var(--ndis-accent);
  border-color: var(--ndis-accent);
  color: #fff;
}
.ndis-t-label {
  font-size: 11px;
  opacity: 0.85;
  margin-bottom: 1px;
}
.ndis-t-val {
  font-size: 15px;
  font-weight: 600;
}
.ndis-actions {
  margin-left: auto;
  display: flex;
  gap: 6px;
  align-items: center;
}

/* =========================================================
   BUTTONS
   ========================================================= */
.ndis-btn {
  background: var(--ndis-primary);
  color: #ffffff;
  border: none;
  border-radius: 8px;
  padding: 5px 12px 5px;
  font-size: 12px;
  cursor: pointer;
  line-height: 1.35;
  transition: transform 0.05s ease, box-shadow 0.05s ease;
}
.ndis-btn:hover {
  background: #0e7490;
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(14, 116, 144, 0.18);
}
.ndis-btn:active {
  transform: translateY(0);
  box-shadow: none;
}
.ndis-btn-soft {
  background: #e2e8f0;
  color: #0f172a;
  border: 1px solid rgba(148, 163, 184, 0.35);
  box-shadow: none;
}
.ndis-btn-soft:hover {
  background: #d4dbe5;
}
.ndis-btn-xs {
  padding: 2px 8px;
  font-size: 10.7px;
}

/* =========================================================
   CARD / COMMON
   ========================================================= */
.ndis-card {
  background: var(--ndis-surface);
  border: 1px solid var(--ndis-border);
  border-radius: var(--ndis-radius-lg);
  padding: 12px;
  margin-bottom: 12px;
  box-shadow: var(--ndis-shadow-sm);
  box-sizing: border-box;
}
.ndis-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--ndis-text);
  margin-bottom: 8px;
}
.ndis-hint {
  font-size: var(--ndis-font-sm);
  color: var(--ndis-muted);
}
.ndis-flex-between {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

/* =========================================================
   FORM – STEP 1
   ========================================================= */
.ndis-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.ndis-grid-2 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(165px, 1fr));
  gap: 8px;
}
.ndis-field {
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.ndis-field label {
  font-size: 12px;
  color: var(--ndis-text);
}
.ndis-field input,
.ndis-field select,
.ndis-page input,
.ndis-page select {
  width: 100%;
  border: 1px solid #cbd5e1;
  border-radius: 10px;
  padding: 5px 7px;
  font-size: 12.5px;
  background: #fff;
  transition: border 0.12s ease, box-shadow 0.12s ease;
  box-shadow: none;
}
.ndis-field input:focus,
.ndis-field select:focus {
  outline: none;
  border-color: #0ea5e9;
  box-shadow: 0 0 0 3px rgba(14, 165, 233, 0.15);
}

/* =========================================================
   PH ICON
   ========================================================= */
.ndis-ph-group {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 6px;
  position: relative;
}
.ndis-ph-icon {
  width: 20px;
  height: 20px;
  border-radius: 9999px;
  background: #e2e8f0;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 11px;
  color: #0f172a;
}
.ndis-ph-popup {
  position: absolute;
  top: 26px;
  left: 0;
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  padding: 7px 8px 7px;
  min-width: 210px;
  box-shadow: var(--ndis-shadow-md);
  display: none;
  z-index: 99;
}
.ndis-ph-popup h4 {
  font-size: 11.5px;
  font-weight: 600;
  margin-bottom: 4px;
}
.ndis-ph-popup table {
  width: 100%;
  font-size: 11px;
}
.ndis-ph-popup table td {
  padding: 1px 2px;
}

/* =========================================================
   STEP 2 + AVAILABLE (side-by-side)
   ========================================================= */
.ndis-step2-wrap {
  display: flex;
  gap: 14px;
  align-items: stretch;
  margin-bottom: 12px;
}

/* left: weekly pattern */
.ndis-step2-card {
  flex: 0 0 46%;
  max-width: 46%;
  display: flex;
  flex-direction: column;
}

/* right: available items */
.ndis-available-card {
  flex: 0 0 54%;
  max-width: 54%;
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-height: 260px;
  /* little breathing room from the right edge */
  margin-right: 10px;
}

/* =========================================================
   WEEKLY PATTERN
   ========================================================= */
.ndis-weekly {
  border: 1px solid var(--ndis-border);
  border-radius: 11px;
  background: #fff;
  overflow: hidden;
  margin-top: 6px;
  flex: 1 1 auto;
  min-height: 260px;
}
.ndis-week-row {
  display: grid;
  grid-template-columns: 72px 1fr 1fr 1fr 70px;
  gap: 6px;
  padding: 5px 6px;
  border-bottom: 1px solid var(--ndis-border-subtle);
}
.ndis-week-row:last-child {
  border-bottom: none;
}
.ndis-week-label {
  font-size: 11.5px;
  display: flex;
  align-items: center;
  color: var(--ndis-text);
  white-space: nowrap;
}
.ndis-week-row input[type="number"],
.ndis-week-row select,
.ndis-hour-input,
.ndis-ratio-select {
  border: 1px solid #d1d5db !important;
  border-radius: 8px;
  background: #ffffff;
  height: 28px;
  font-size: 11.5px;
  padding: 3px 6px;
  box-sizing: border-box;
}
.ndis-ratio-select {
  min-width: 68px;
}

/* =========================================================
   AVAILABLE ITEMS (right card)
   ========================================================= */
.ndis-available-title {
  font-size: 12.5px;
  font-weight: 600;
  margin-bottom: 2px;
  color: var(--ndis-text);
}

/* filter pills (always visible, not in the scroll area) */
.ndis-available-filters {
  display: flex;
  gap: 10px;
  align-items: center;
}
.ndis-filter-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 9999px;
  padding: 3px 10px 3px 8px;
  font-size: 11.5px;
  color: #0f172a;
}
.ndis-filter-pill input[type="checkbox"] {
  width: 14px;
  height: 14px;
  cursor: pointer;
  accent-color: var(--ndis-primary);
}

/* scroll box */
.ndis-available-tablewrap {
  border: 1px solid var(--ndis-border);
  border-radius: 10px;
  background: #fff;
  flex: 1 1 auto;
  min-height: 215px;
  max-height: 260px;
  overflow-y: auto;
  overflow-x: hidden;
}

/* table (no horizontal scroll) */
.ndis-available-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 11.5px;
  table-layout: fixed; /* so description can ellipsis */
}
.ndis-available-table thead th {
  background: #f8fafc;
  border-bottom: 1px solid #e2e8f0;
  padding: 4px 6px;
  text-align: left;
}
.ndis-available-table tbody td {
  border-bottom: 1px solid #edf2f7;
  padding: 4px 6px;
  vertical-align: middle;
}
.ndis-available-table tbody tr:last-child td {
  border-bottom: none;
}
.ndis-available-table tbody tr:hover {
  background: #f8fafc;
}

/* column widths */
.ndis-available-table th:first-child,
.ndis-available-table td:first-child {
  width: 30px;
  min-width: 30px;
  text-align: center;
}
.ndis-available-table th:nth-child(2),
.ndis-available-table td:nth-child(2) {
  width: 115px;        /* Item # always visible */
  min-width: 115px;
  white-space: nowrap;
}
.ndis-available-table th:nth-child(3),
.ndis-available-table td:nth-child(3) {
  width: auto;         /* description gets the leftover */
}
/* description ellipsis + tooltip (title is set in JS) */
.ndis-available-table td:nth-child(3) {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  cursor: help;
}
.ndis-available-table th:last-child,
.ndis-available-table td:last-child {
  width: 110px;        /* fit to right edge */
  min-width: 110px;
  text-align: right;
  padding-right: 12px;
  white-space: nowrap;
}
.ndis-available-table input[type="checkbox"] {
  width: 14px;
  height: 14px;
  cursor: pointer;
  accent-color: var(--ndis-primary);
}
#ndis-check-all {
  margin: 0 auto;
  display: block;
}

/* =========================================================
   STEP 3 – MANUAL ITEMS
   ========================================================= */
#ndis-manual-wrap .ndis-manual-line {
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  padding: 7px 7px 9px 7px;
  margin-bottom: 6px;
  background: #f8fafc;
  box-sizing: border-box;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.3);
}
.ndis-manual-head {
  display: grid;
  grid-template-columns: 1.05fr 1.05fr 1.5fr 0.6fr 0.5fr 0.5fr 32px;
  gap: 6px;
  align-items: center; /* center everything vertically */
}
.ndis-manual-head label {
  display: block;
  font-size: 10.5px;
  color: #475569;
  margin-bottom: 2px;
}
.ndis-manual-head select,
.ndis-manual-head input {
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  padding: 3px 4px;
  font-size: 11.5px;
  background: #ffffff;
  width: 100%;
  box-sizing: border-box;
}
.ndis-manual-head .manual-price {
  min-width: 80px;
}
/* delete button in manual line */
.ndis-delete-manual {
  background: var(--ndis-danger);
  border: none;
  width: 26px;
  height: 26px;
  border-radius: 9999px;
  display: inline-flex;          /* inline so it sits nicely in the grid cell */
  align-items: center;
  justify-content: center;
  color: #fff;
  cursor: pointer;
  line-height: 1;                /* no extra space */
  place-self: end;               /* push to bottom/right of the grid cell */
  box-shadow: 0 2px 6px rgba(244, 63, 94, 0.25);
}
.ndis-delete-manual::before {
  content: "×";
  font-size: 16px;
  line-height: 1;
  font-weight: 600;
  display: block;                /* ensures proper centering */
}
.ndis-delete-manual:hover {
  background: #e11d48;
}


/* =========================================================
   OUTPUT TABLES
   ========================================================= */
.ndis-output-card {
  background: var(--ndis-surface);
  border: 1px solid var(--ndis-border);
  border-radius: 14px;
  margin-bottom: 12px;
}
.ndis-output-head {
  display: flex;
  gap: 6px;
  align-items: center;
  margin-bottom: 8px;
}
.ndis-tag {
  background: var(--ndis-accent);
  color: #fff;
  font-size: 10.5px;
  padding: 2px 7px;
  border-radius: 9999px;
}
.ndis-tag-soft {
  background: #e2e8f0;
  color: #0f172a;
}
.ndis-output-tablewrap {
  max-height: 280px;
  overflow-y: auto;
  border: 1px solid #e2e8f0;
  border-radius: 11px;
  background: #ffffff;
}
.ndis-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 11.5px;
}
.ndis-table thead th {
  background: #f8fafc;
  text-align: left;
  font-weight: 600;
  border-bottom: 1px solid #e2e8f0;
  padding: 4px 5px;
  position: sticky;
  top: 0;
  z-index: 1;
}
.ndis-table tbody td {
  border-bottom: 1px solid #e2e8f0;
  padding: 4px 5px;
}
.ndis-table tbody tr:hover {
  background: #f8fafc;
}
/* show full text in output tables */
.ndis-table .ndis-desc {
  display: inline-block;
  max-width: none;
  white-space: normal;
  overflow: visible;
  text-overflow: clip;
}
/* leave breathing room on the right of the Available line items column */
.ndis-step2-wrap {
  gap: 10px;
}

/* container */
.ndis-manual-line {
  margin-bottom: 8px;
}

.ndis-manual-head {
  display: flex;
  gap: 10px;
  align-items: center;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 10px 12px;
}

/* base: label + input stacked */
.ndis-manual-head > div {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

/* wider ones */
.ndis-manual-head .ndis-manual-cat {
  flex: 1 1 210px;
}
.ndis-manual-head .ndis-manual-rg {
  flex: 1 1 210px;
}
.ndis-manual-head .ndis-manual-item {
  flex: 1 1 240px;
}

/* compact ones */
.ndis-manual-head .ndis-manual-price {
  width: 90px;
}
.ndis-manual-head .ndis-manual-hours {
  width: 80px;
}
.ndis-manual-head .ndis-manual-days {
  width: 80px;
}
.ndis-manual-head .manual-ratio-wrap {
  width: 80px;
}

/* inputs/selects */
.ndis-manual-head select,
.ndis-manual-head input[type="number"],
.ndis-manual-head input[type="text"] {
  height: 30px;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  padding: 2px 6px;
  font-size: 13px;
}

/* delete button locked to the right */
.ndis-manual-head .ndis-delete-manual {
  margin-left: 4px;
  width: 34px;
  height: 34px;
  border-radius: 9999px;
  background: #f43f5e;
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  cursor: pointer;
  flex: 0 0 34px;
}
.ndis-manual-head .ndis-delete-manual::before {
  content: "×";
  font-size: 18px;
  line-height: 1;
  font-weight: 600;
}
.ndis-manual-head .ndis-delete-manual:hover {
  background: #e11d48;
}
/* container for the search input */
.ndis-manual-search {
  width: 240px;
  position: relative;
}

/* suggestion dropdown – wider + readable */
.manual-suggest {
  position: absolute;
  top: 38px;
  left: 0;
  min-width: 800px;          /* ← wider now */
  max-width: 800px;          /* ← you can increase if needed */
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  box-shadow: 0 12px 25px rgba(15, 23, 42, 0.08);
  max-height: 240px;
  overflow-y: auto;
  z-index: 200;
}

/* list in the dropdown */
.manual-suggest ul {
  list-style: none;
  margin: 0;
  padding: 6px;
}

/* each result – allow wrapping so full name is visible */
.manual-suggest li {
  display: block;
  padding: 6px 8px 7px;
  font-size: 12.5px;
  cursor: pointer;
  border-radius: 6px;
  line-height: 1.25;
  white-space: normal;        /* ← no truncation */
}

.manual-suggest li:hover {
  background: #ecfdf3;
}

/* green-ish search input so it stands out */
.manual-search {
  background: #ecfdf3;
  border: 1px solid #bbf7d0;
  color: #065f46;
  height: 34px;
  border-radius: 8px;
  padding: 4px 8px;
  font-size: 13px;
}
.manual-search:focus {
  outline: 2px solid rgba(34, 197, 94, 0.35);
  outline-offset: 1px;
}

/* delete button – force clean round X, kill any theme icon/+ */
.ndis-delete-manual {
  width: 34px;
  height: 34px;
  border: none !important;
  background: #f43f5e !important;
  border-radius: 999px;
  cursor: pointer;
  position: relative;
  flex: 0 0 auto;
  padding: 0;
  line-height: 0;
  background-image: none !important;  /* ← remove + */
  color: transparent !important;      /* ← if theme injects text */
}

.ndis-delete-manual::before,
.ndis-delete-manual::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 15px;
  height: 2px;
  background: #fff;
  transform-origin: center;
}

.ndis-delete-manual::before {
  transform: translate(-50%, -50%) rotate(45deg);
}
.ndis-delete-manual::after {
  transform: translate(-50%, -50%) rotate(-45deg);
}

.manual-search {
  background: #ecfdf3;              /* soft green */
  border: 1px solid #bbf7d0;        /* light green border */
  color: #065f46;                   /* dark green text */
  height: 34px;
  border-radius: 8px;
  padding: 4px 8px;
  font-size: 13px;
}

.manual-search::placeholder {
  color: #16a34a;                   /* green-ish placeholder */
  opacity: 0.6;
}

.manual-search:focus {
  outline: 2px solid rgba(22, 163, 74, 0.35);
  outline-offset: 1px;
  background: #f0fdf4;              /* a touch lighter on focus */
}

.ndis-step1-search {
  max-width: 280px;
  position: relative;
}
.ndis-step1-search .manual-suggest {
  width: 100%;
}
/* step 1: put search + category + reg group in one row */
.ndis-step1-has-search {
  display: flex;
  gap: 14px;
  align-items: flex-start;
}

.ndis-step1-has-search .ndis-field {
  flex: 1;
}

/* make search a bit wider */
.ndis-field-searchitem {
  flex: 1.3;
  position: relative;
}

/* suggestion dropdown for step 1 */
.step1-suggest {
  position: absolute;
  top: 58px; /* below label + input */
  left: 0;
  right: 0;
  background: #fff;
  border: 1px solid #d4edda;
  border-radius: 8px;
  box-shadow: 0 14px 28px rgba(15,23,42,0.08);
  max-height: 240px;
  overflow-y: auto;
  z-index: 90;
}

.step1-suggest ul {
  list-style: none;
  margin: 0;
  padding: 4px;
}

.step1-suggest li {
  padding: 6px 8px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 12.5px;
}

.step1-suggest li:hover {
  background: #e6f4ea;
}

/* subtle green border on step 1 search */
#ndis-step1-item-search {
  border: 1px solid #c6f6d5;
  background: #f7fffa;
}

.ndis-manual-days label {
  display: flex;
  align-items: center;
  gap: 4px;
}

.manual-days-fill {
  background: none;
  border: none;
  padding: 0;
  line-height: 1;
  cursor: pointer;
  font-size: 11px;        /* small */
  color: #16a34a;         /* subtle green */
}

.manual-days-fill:hover {
  color: #0f766e;
}

.manual-days-fill:focus {
  outline: none;
}



/* desktop: make the right card a bit narrower so the 10px margin fits */
@media (min-width: 1025px) {
  .ndis-available-card {
    flex: 0 0 calc(54% - 10px);
    max-width: calc(54% - 10px);
    margin-right: 10px;
  }
}
/* step 1 two-row layout */
.ndis-step1-row {
  display: grid;
  gap: 8px;
}

/* top row: 5 items */
.ndis-step1-top {
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
}

/* bottom row: 2 wider items */
.ndis-step1-bottom {
  margin-top: 6px;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
}

@media (max-width: 720px) {
  .ndis-step1-top,
  .ndis-step1-bottom {
    grid-template-columns: 1fr;
  }
}


/* =========================================================
   RESPONSIVE
   ========================================================= */
@media (max-width: 1024px) {
  .ndis-step2-wrap {
    flex-direction: column;
  }
  .ndis-step2-card,
  .ndis-available-card {
    max-width: 100%;
    flex: 1 1 auto;
    margin-right: 0;
  }
  .ndis-available-tablewrap {
    max-height: none;
  }
}
@media (max-width: 900px) {
  .ndis-dashboard {
    flex-direction: column;
    align-items: flex-start;
  }
  .ndis-actions {
    margin-left: 0;
  }
  .ndis-manual-head {
    grid-template-columns: 1fr 1fr;
  }
  .ndis-week-row {
    grid-template-columns: 1fr 1fr 1fr 1fr;
  }
}
@media (max-width: 540px) {
  .ndis-page {
    padding: 14px 8px 40px;
  }
  .ndis-output-tablewrap {
    max-height: none;
  }
}


