/* Devices / SIM Details, SimTest Details and Encrypted MSISDNs: the spreadsheet-like tables. */

/* ----------------------------------------------------------------------
   Devices / SIM Details table
   ------------------------------------------------------------------- */

.live-tag {
  padding: 5px 11px;
  border-radius: 7px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.8px;
  color: var(--green);
  background: var(--green-bg);
}

.live-tag[hidden] {
  display: none;
}

.muted-text {
  color: var(--muted);
  font-size: 13px;
}

.sd-shell.maximized {
  position: fixed;
  inset: 0;
  z-index: 15;
  overflow: auto;
  padding: 22px 28px;
  background: var(--bg);
}

.sd-fs-title {
  display: none;
  margin: 0 0 16px;
  font-size: 22px;
  font-weight: 750;
}

.sd-shell.maximized .sd-fs-title {
  display: block;
}

body.sd-full {
  overflow: hidden;
}

.sd-scroll {
  overflow: auto;
  max-height: 74vh;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 18px;
}

.sd th {
  position: sticky;
  top: 0;
  z-index: 3;
  padding: 0;
  text-align: left;
  background: var(--inset);
  border-bottom: 1px solid var(--line-hi);
}

.sd th .th {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  padding: 12px 14px;
  white-space: nowrap;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.6px;
  text-transform: uppercase;
  color: var(--muted);
}

.sd th:hover .col-hide {
  opacity: 1;
}

.sd td {
  padding: 12px 14px;
  vertical-align: top;
  border-top: 1px dashed var(--line);
  overflow-wrap: anywhere;
  white-space: pre-line;
}

.sd tbody.grp tr:first-child td {
  border-top: 1px solid var(--line-hi);
}

.sd tbody.grp:first-of-type tr:first-child td {
  border-top: 0;
}

.sd tbody.grp:hover td {
  background: rgba(255, 255, 255, 0.022);
}

.sd td.g {
  background: rgba(255, 255, 255, 0.015);
  border-right: 1px solid var(--line);
}

.sd tbody.grp:hover td.g {
  background: rgba(255, 255, 255, 0.035);
}

.sd th.c-edit,
.sd td.c-edit {
  padding-left: 8px;
  padding-right: 8px;
  text-align: center;
}

.sd td.c-edit .icon-btn {
  width: 30px;
  height: 30px;
}

.sd .mono {
  font-family: 'JetBrains Mono', 'SF Mono', Consolas, monospace;
  font-size: 12.5px;
}

.sd .na {
  color: #6f788b;
}

.sd .none {
  color: var(--faint);
}

.tpill {
  display: inline-block;
  padding: 1px 8px;
  border-radius: 5px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  color: #c2c8d4;
  background: rgba(255, 255, 255, 0.08);
}

.tpill.prepaid {
  color: var(--blue);
  background: rgba(143, 178, 255, 0.15);
}

.chip {
  display: inline-block;
  padding: 2px 9px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-soft);
  background: rgba(255, 255, 255, 0.07);
  white-space: nowrap;
}

.chip.os {
  color: var(--muted);
  font-weight: 500;
}

.chip.price {
  color: var(--green);
  background: var(--green-bg);
}

.sd a {
  color: var(--blue);
  text-decoration: none;
}

.sd a:hover {
  text-decoration: underline;
}

.sd-fixed {
  display: flex;
  align-items: baseline;
  gap: 12px;
  margin-top: 16px;
  padding: 14px 18px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 14px;
}

.sd-fixed span {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.6px;
  text-transform: uppercase;
  color: var(--muted);
}

.sd-fixed b {
  font-size: 22px;
}

.sd-fixed small {
  color: var(--muted);
  font-size: 12.5px;
}

.sd td .copy {
  cursor: copy;
  overflow-wrap: anywhere;
}

.sd td .copy:hover {
  color: var(--blue);
}

.sd tr.empty-row td {
  padding: 44px 16px;
  text-align: center;
  color: var(--muted);
  white-space: normal;
  border-top: 0;
}

.sd-shell.maximized .sd-scroll {
  max-height: calc(100vh - 230px);
}

.sd th .th-sub {
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0;
  text-transform: none;
  color: var(--muted);
  margin-left: auto;
}

.sd td.svcs-cell {
  white-space: normal;
  padding: 8px 10px;
}

.sd td.ie-cell {
  position: relative;
  padding-right: 32px;
}

.sd td:hover > .ie-btn,
.sd td.ie-cell:hover .ie-btn {
  opacity: 1;
}

.exp {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 650;
  font-style: normal;
  color: var(--text-soft);
  background: rgba(255, 255, 255, 0.07);
  white-space: nowrap;
}

.exp.amber {
  color: var(--amber);
  background: var(--amber-bg);
  box-shadow: inset 0 0 0 1px rgba(245, 194, 107, 0.35);
}

.exp.red {
  color: var(--red);
  background: var(--red-bg);
  box-shadow: inset 0 0 0 1px rgba(255, 77, 67, 0.4);
}

.exp-rel {
  margin-top: 3px;
  font-size: 11.5px;
  color: var(--muted);
}

.exp-rel.amber {
  color: var(--amber);
}

.exp-rel.red {
  color: var(--red);
  font-weight: 600;
}

.exp-main.ie-host {
  padding-right: 26px;
  min-height: 22px;
}

.exp-note {
  margin-top: 6px;
  padding: 5px 9px;
  border-radius: 8px;
  background: rgba(143, 178, 255, 0.09);
  color: #c9d3ea;
  font-size: 12px;
  line-height: 1.4;
  white-space: pre-line;
}

.exp-note.ie-host {
  padding-right: 26px;
}

.exp-note .ie-btn {
  top: 3px;
  right: 3px;
}

.exp-note:has(.note-add) {
  padding: 0;
  background: none;
}

.note-add {
  border: 1px dashed var(--line-hi);
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-size: 11.5px;
  border-radius: 7px;
  padding: 2px 9px;
  cursor: pointer;
  opacity: 0;
  transition: 0.15s;
}

.sd tr:hover .note-add {
  opacity: 1;
}

.note-add:focus {
  opacity: 1;
}

.note-add:hover {
  color: var(--blue);
  border-color: var(--blue);
}

.exp-edit {
  display: flex;
  align-items: center;
  gap: 10px;
}

.exp-edit input {
  width: 100%;
  min-width: 0;
  padding: 5px 8px;
  background: var(--inset);
  border: 1px solid var(--blue);
  border-radius: 8px;
  color: var(--text);
  font: inherit;
  font-size: 13px;
  outline: 0;
  color-scheme: dark;
}

.ln {
  cursor: copy;
  border-radius: 5px;
  padding: 0 4px;
  margin: 0 -4px;
}

.ln:hover {
  background: var(--blue-bg);
  color: var(--blue);
}

.legend i.exp {
  padding: 1px 9px;
}

.sd tr.inactive td:not(.g):not(.c-edit) {
  opacity: 0.55;
}

.sd tr.inactive:hover td {
  opacity: 1;
}

.dpill {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  background: rgba(255, 255, 255, 0.06);
  white-space: nowrap;
}

.dpill.ondemand {
  background: var(--amber-bg);
  color: var(--amber);
}

.dpill.yes {
  background: rgba(52, 199, 89, 0.12);
  color: #6fdc8c;
}

.dpill.no {
  background: var(--red-bg);
  color: var(--red);
}

.tpill.postpaid {
  background: rgba(185, 140, 255, 0.16);
  color: #c9a6ff;
  box-shadow: inset 0 0 0 1px rgba(185, 140, 255, 0.45);
  font-weight: 700;
}

.payg {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 9px;
  font-size: 12.5px;
  font-weight: 600;
  color: #9fd0ff;
  background: rgba(80, 150, 255, 0.12);
  box-shadow: inset 0 0 0 1px rgba(80, 150, 255, 0.3);
}

.tar-edit {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.payg-btn {
  align-self: flex-start;
  padding: 3px 10px;
  border-radius: 9px;
  border: 1px solid rgba(80, 150, 255, 0.45);
  background: rgba(80, 150, 255, 0.12);
  color: #9fd0ff;
  font: inherit;
  font-size: 12px;
  cursor: pointer;
}

.payg-btn:hover {
  background: rgba(80, 150, 255, 0.28);
}

.sd th:hover .col-filter {
  opacity: 1;
}

.payg-btn.set {
  margin-top: 6px;
}

@media (hover: none) {
  .note-add {
    opacity: 0.7;
  }
}

/* ----------------------------------------------------------------------
   Column menu and hiding
   ------------------------------------------------------------------- */

.col-hide {
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  flex: none;
  background: none;
  border: 0;
  border-radius: 6px;
  color: var(--muted);
  cursor: pointer;
  opacity: 0;
  transition: 0.15s;
}

.col-hide svg {
  width: 14px;
  height: 14px;
}

.col-hide:hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.1);
}

.col-wrap {
  position: relative;
}

.col-wrap .btn-ghost.on {
  color: var(--amber);
  border-color: rgba(245, 194, 107, 0.5);
}

.col-menu {
  position: absolute;
  right: 0;
  top: calc(100% + 8px);
  z-index: 12;
  min-width: 250px;
  max-height: 62vh;
  overflow: auto;
  padding: 10px;
  background: #0d1015;
  border: 1px solid var(--line-hi);
  border-radius: 14px;
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.6);
}

.col-menu[hidden] {
  display: none;
}

.col-menu-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 4px 6px 10px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.6px;
  text-transform: uppercase;
  color: var(--muted);
}

.col-opt {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 7px 8px;
  border-radius: 8px;
  font-size: 13.5px;
  cursor: pointer;
}

.col-opt:hover {
  background: rgba(255, 255, 255, 0.05);
}

.col-opt input {
  width: 16px;
  height: 16px;
  accent-color: var(--brand);
  cursor: pointer;
}

.th-btns {
  display: flex;
  align-items: center;
  gap: 2px;
}

.col-filter {
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  flex: none;
  background: none;
  border: 0;
  border-radius: 6px;
  color: var(--muted);
  cursor: pointer;
  opacity: 0;
  transition: 0.15s;
}

.col-filter svg {
  width: 13px;
  height: 13px;
}

.col-filter:hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.1);
}

.col-filter.on {
  opacity: 1;
  color: var(--blue);
  background: var(--blue-bg);
}

/* ----------------------------------------------------------------------
   Grouped tables (SimTest Details, Encrypted MSISDNs)
   ------------------------------------------------------------------- */

.g-country {
  font-size: 14px;
  font-weight: 700;
}

.svcs {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(158px, 1fr));
  gap: 6px;
}

.svc:hover {
  border-color: var(--blue);
  background: var(--blue-bg);
}

.svc-s {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  color: var(--muted);
}

.svc:hover .svc-s {
  color: var(--blue);
}

.svc-v {
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-family: 'JetBrains Mono', 'SF Mono', Consolas, monospace;
  font-size: 12px;
}

.svc {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 1px;
  min-width: 0;
  padding: 5px 9px;
  text-align: left;
  background: var(--inset);
  border: 1px solid var(--line);
  border-radius: 9px;
  color: var(--text);
  cursor: copy;
  font: inherit;
  transition: 0.15s;
  position: relative;
}

.ie-btn {
  position: absolute;
  top: 5px;
  right: 5px;
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  padding: 0;
  border: 0;
  border-radius: 7px;
  background: rgba(255, 255, 255, 0.07);
  color: var(--muted);
  cursor: pointer;
  opacity: 0;
  transition: 0.15s;
}

.ie-btn svg {
  width: 12px;
  height: 12px;
}

.ie-btn:hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.16);
}

.svc:hover > .ie-btn {
  opacity: 1;
}

.svc.add {
  border-style: dashed;
  background: transparent;
  cursor: pointer;
  font: inherit;
  color: var(--muted);
}

.svc.add .svc-v {
  font-family: inherit;
  color: var(--faint);
}

.svc.add:hover {
  border-color: var(--blue);
  color: var(--blue);
}

.svc.add:hover .svc-v {
  color: var(--blue);
}

.svc.editing {
  border-color: var(--blue);
  background: var(--blue-bg);
  cursor: text;
}

.ie-in {
  width: 100%;
  min-width: 0;
  padding: 5px 8px;
  margin: -3px 0;
  background: var(--inset);
  border: 1px solid var(--blue);
  border-radius: 8px;
  color: var(--text);
  font: inherit;
  font-size: 13px;
  outline: 0;
  resize: vertical;
}

.svc .ie-in {
  margin: 1px 0 0;
  padding: 3px 6px;
  font-size: 12px;
}

.ie-in.mono {
  font-family: 'JetBrains Mono', 'SF Mono', Consolas, monospace;
  font-size: 12.5px;
}

.ie-host {
  position: relative;
}

.ie-host:hover > .ie-btn {
  opacity: 1;
}

select.ie-in {
  width: 100%;
  cursor: pointer;
  color-scheme: dark;
}

@media (hover: none) {
  .ie-btn {
    opacity: 0.7;
  }
}

/* ----------------------------------------------------------------------
   Column filter popup
   ------------------------------------------------------------------- */

.fpop {
  position: fixed;
  z-index: 9999;
  width: 290px;
  max-height: 70vh;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 12px;
  border-radius: 14px;
  background: #1b2029;
  border: 1px solid var(--line-hi);
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.55);
}

.fhead {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 13px;
}

.fq {
  padding: 7px 10px;
  background: var(--inset);
  border: 1px solid var(--line-hi);
  border-radius: 9px;
  color: var(--text);
  font: inherit;
  font-size: 13px;
  outline: 0;
}

.fq:focus {
  border-color: var(--blue);
}

.fhint {
  font-size: 11px;
  color: var(--muted);
}

.flist {
  overflow: auto;
  display: flex;
  flex-direction: column;
  gap: 1px;
  min-height: 40px;
}

.fopt {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 5px 6px;
  border-radius: 7px;
  font-size: 13px;
  cursor: pointer;
}

.fopt:hover {
  background: rgba(255, 255, 255, 0.06);
}

.fopt span {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.fopt i {
  font-style: normal;
  font-size: 11px;
  color: var(--muted);
}
