/* Components shared by every screen: buttons, pills, forms, tables, modal, tooltip, toast. */

/* ----------------------------------------------------------------------
   Buttons
   ------------------------------------------------------------------- */

.btn {
  flex: 1;
  min-width: 0;
  border: 0;
  border-radius: 12px;
  padding: 12px;
  font-size: 14.5px;
  font-weight: 700;
  cursor: pointer;
  transition: 0.15s;
}

.btn.reserve {
  background: var(--text);
  color: var(--bg);
}

.btn.reserve:hover {
  background: var(--white);
  transform: translateY(-1px);
}

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

.btn.inuse .l2 {
  display: none;
}

.btn.inuse:hover {
  background: transparent;
  color: var(--text);
  box-shadow: inset 0 0 0 1px var(--line-hi);
}

.btn.inuse:hover .l1 {
  display: none;
}

.btn.inuse:hover .l2 {
  display: inline;
}

.btn.held {
  background: var(--red-bg);
  color: var(--red);
  box-shadow: inset 0 0 0 1px rgba(255, 77, 67, 0.35);
  cursor: not-allowed;
}

.btn.fix {
  background: var(--green);
  color: var(--on-green);
}

.btn.fix:hover {
  filter: brightness(1.08);
  transform: translateY(-1px);
}

.btn.blocked {
  background: rgba(255, 255, 255, 0.05);
  color: var(--muted);
  box-shadow: inset 0 0 0 1px var(--line);
  cursor: not-allowed;
}

.btn:disabled {
  cursor: not-allowed;
}

.btn-report {
  flex: none;
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 0 14px;
  color: var(--red);
  background: var(--red-bg);
  border: 1px solid rgba(255, 77, 67, 0.4);
  border-radius: 12px;
  font-size: 13px;
  font-weight: 700;
  white-space: nowrap;
  cursor: pointer;
  transition: 0.15s;
}

.btn-report svg {
  width: 14px;
  height: 14px;
}

.btn-report:hover:not(:disabled) {
  background: var(--red);
  color: var(--white);
  border-color: var(--red);
}

.btn-report:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

.link {
  background: none;
  border: 0;
  padding: 0;
  color: var(--muted);
  font-size: 12.5px;
  cursor: pointer;
}

.link:hover {
  color: var(--text);
  text-decoration: underline;
}

.mini {
  border: 0;
  border-radius: 10px;
  padding: 0 14px;
  min-height: 38px;
  font-size: 13px;
  font-weight: 650;
  cursor: pointer;
  background: var(--card-hi);
  color: var(--text);
  box-shadow: inset 0 0 0 1px var(--line-hi);
}

.mini.save {
  background: var(--text);
  color: var(--bg);
  box-shadow: none;
}

.mini.danger {
  background: var(--red);
  color: var(--white);
  box-shadow: none;
}

.btn-primary,
.btn-ghost {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 42px;
  padding: 0 20px;
  border-radius: 11px;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  transition: 0.15s;
  border: 1px solid transparent;
}

.btn-primary svg,
.btn-ghost svg {
  width: 15px;
  height: 15px;
}

.btn-primary {
  background: var(--text);
  color: var(--bg);
}

.btn-primary:hover:not(:disabled) {
  background: var(--white);
  transform: translateY(-1px);
}

.btn-ghost {
  background: transparent;
  color: var(--muted);
  border-color: var(--line-hi);
}

.btn-ghost:hover:not(:disabled) {
  color: var(--text);
  border-color: var(--muted);
}

.btn-primary:disabled,
.btn-ghost:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.btn-primary.sm,
.btn-ghost.sm {
  min-height: 34px;
  padding: 0 14px;
  font-size: 12.5px;
}

.mini.ok {
  background: var(--green-bg);
  color: var(--green);
  box-shadow: inset 0 0 0 1px rgba(52, 210, 123, 0.35);
}

.mini.ok:hover {
  background: var(--green);
  color: var(--on-green);
}

.icon-btn {
  display: inline-grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 9px;
  background: none;
  border: 0;
  color: var(--muted);
  cursor: pointer;
  transition: 0.15s;
}

.icon-btn svg {
  width: 16px;
  height: 16px;
}

.icon-btn:hover {
  color: var(--red);
  background: var(--red-bg);
}

.icon-btn.edit:hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.08);
}

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

.mini.bad:hover {
  background: var(--red);
  color: var(--white);
}

.btn-support {
  display: flex;
  align-items: center;
  gap: 7px;
  color: var(--blue);
  background: var(--blue-bg);
  border: 1px solid rgba(143, 178, 255, 0.4);
  border-radius: 12px;
  font-size: 13px;
  font-weight: 700;
  white-space: nowrap;
  cursor: pointer;
  transition: 0.15s;
}

.btn-support svg {
  width: 14px;
  height: 14px;
}

.btn-support:hover:not(:disabled) {
  background: var(--blue);
  color: #0c1020;
  border-color: var(--blue);
}

.btn-support:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

.mini-sims {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.mini-sim {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 11px;
  background: var(--inset);
  border-radius: 10px;
  font-size: 13.5px;
}

.mini-sim .op {
  color: var(--muted);
}

.mini-num {
  background: none;
  border: 0;
  padding: 0;
  color: var(--text);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.2px;
  cursor: pointer;
}

.mini-num:hover {
  text-decoration: underline;
}

a.btn-support {
  text-decoration: none;
}

.btn-support.wa {
  color: var(--whatsapp);
  background: rgba(37, 211, 102, 0.1);
  border-color: rgba(37, 211, 102, 0.4);
}

.btn-support.wa:hover:not(:disabled) {
  background: var(--whatsapp);
  color: #07210f;
  border-color: var(--whatsapp);
}

.btn-support.wa:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.mini.done {
  background: var(--green);
  color: var(--on-green);
  box-shadow: none;
  border-radius: 12px;
  font-weight: 700;
}

/* same green as Mark as fixed, without the grey ring of .mini */

.mini.done:hover {
  filter: brightness(1.08);
}

@media (hover: none) {
  .btn.inuse .l1 {
    display: none;
  }

  .btn.inuse .l2 {
    display: inline;
  }
}

/* ----------------------------------------------------------------------
   Status pills and tags
   ------------------------------------------------------------------- */

.tag {
  display: inline-block;
  font-size: 12px;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 7px;
  background: rgba(255, 255, 255, 0.07);
}

.spill {
  display: inline-block;
  font-size: 12px;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 999px;
}

.spill.wait {
  color: var(--amber);
  background: var(--amber-bg);
}

.spill.done {
  color: var(--green);
  background: var(--green-bg);
}

.spill.fail {
  color: var(--red);
  background: var(--red-bg);
}

.spill.off {
  color: var(--muted);
  background: rgba(255, 255, 255, 0.07);
}

.spill.tog {
  border: 0;
  font-family: inherit;
  cursor: pointer;
  transition: 0.15s;
}

.spill.tog:hover:not(:disabled) {
  box-shadow: 0 0 0 1px currentColor;
  filter: brightness(1.15);
}

.spill.tog:disabled {
  opacity: 0.5;
  cursor: wait;
}

/* ----------------------------------------------------------------------
   Toolbar, search and filters
   ------------------------------------------------------------------- */

.toolbar {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  align-items: center;
  margin-bottom: 22px;
}

.search {
  flex: 1 1 260px;
  position: relative;
}

.search svg {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  width: 16px;
  height: 16px;
  color: var(--muted);
}

.search input {
  width: 100%;
  background: var(--card);
  border: 1px solid var(--line);
  color: var(--text);
  border-radius: 12px;
  padding: 12px 14px 12px 40px;
  font-size: 14px;
  outline: 0;
  transition: 0.15s;
}

input:focus,
textarea:focus {
  border-color: var(--line-focus);
}

.f {
  display: flex;
  flex-direction: column;
  gap: 7px;
  min-width: 170px;
  flex: 1 1 170px;
}

.f.grow {
  flex: 2 1 260px;
}

.f > span {
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  color: var(--muted);
}

.f input,
.f select {
  background: var(--inset);
  border: 1px solid var(--line);
  color: var(--text);
  border-radius: 10px;
  padding: 11px 12px;
  font: inherit;
  font-size: 14px;
  outline: 0;
  transition: border-color 0.15s;
  width: 100%;
}

.f input:focus,
.f select:focus {
  border-color: var(--line-focus);
}

.toolbar .sd-count {
  margin-left: auto;
}

.toolbar .tabs.mode {
  margin-left: auto;
}

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

/* ----------------------------------------------------------------------
   Tables
   ------------------------------------------------------------------- */

.tbl {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

.tbl th {
  padding: 13px 16px;
  text-align: left;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.6px;
  text-transform: uppercase;
  color: var(--muted);
  background: var(--inset);
  white-space: nowrap;
}

.tbl td {
  padding: 11px 16px;
  border-top: 1px solid var(--line);
  vertical-align: middle;
}

.tbl tbody tr:hover {
  background: rgba(255, 255, 255, 0.02);
}

.tbl .acts {
  white-space: nowrap;
  text-align: right;
}

.tbl .acts > * + * {
  margin-left: 8px;
}

.tbl small.by {
  display: block;
  margin-top: 2px;
  font-size: 12px;
  color: var(--muted);
}

.tbl .muted {
  color: #c2c8d4;
}

.tbl.assign td {
  padding: 6px 10px;
}

.tbl.assign .cell {
  background: transparent;
  border-color: transparent;
  padding: 9px 10px;
}

.tbl.assign .cell:hover {
  border-color: var(--line);
}

.tbl.assign .cell:focus {
  background: var(--inset);
  border-color: var(--line-focus);
}

.tbl.assign .addrow td {
  background: rgba(255, 255, 255, 0.02);
}

.tbl.assign .cell.new {
  background: var(--inset);
  border-color: var(--line);
}

.tbl.sd {
  table-layout: fixed;
  min-width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 13px;
  line-height: 1.5;
}

/* the edit button and the country stay in view while scrolling sideways */

.tbl.sd.stickycols td.c-edit,
.tbl.sd.stickycols td.stk {
  position: sticky;
  left: 0;
  z-index: 2;
  background: #181c24;
}

.tbl.sd.stickycols th.c-edit,
.tbl.sd.stickycols th.stk {
  position: sticky;
  left: 0;
  z-index: 5;
}

.tbl.sd.stickycols td.stk,
.tbl.sd.stickycols th.stk {
  box-shadow: inset -1px 0 0 var(--line-hi);
}

.tbl.sd.stickycols td.stk.adm,
.tbl.sd.stickycols th.stk.adm {
  left: 56px;
}

.tbl.sd.stickycols tbody.grp:hover td.c-edit,
.tbl.sd.stickycols tbody.grp:hover td.stk {
  background: #1d222c;
}

/* ----------------------------------------------------------------------
   Tooltip
   ------------------------------------------------------------------- */

.tip {
  position: fixed;
  left: 0;
  top: 0;
  z-index: 25;
  max-width: 330px;
  min-width: 200px;
  padding: 12px 14px;
  pointer-events: none;
  background: #0d1015;
  border: 1px solid var(--line-hi);
  border-radius: 14px;
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.6);
  opacity: 0;
  visibility: hidden;
  transform: translateY(4px);
  transition:
    opacity 0.12s,
    transform 0.12s;
}

.tip.show {
  opacity: 1;
  visibility: visible;
  transform: none;
}

.tip-h {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.7px;
  text-transform: uppercase;
  color: var(--muted);
}

.tip-h span {
  color: var(--blue);
}

.tip-i {
  display: flex;
  gap: 10px;
  align-items: flex-start;
}

.tip-i + .tip-i {
  margin-top: 11px;
  padding-top: 11px;
  border-top: 1px solid var(--line);
}

.tip-m {
  font-size: 12px;
  color: var(--muted);
}

.tip-m b {
  color: var(--text);
  font-weight: 650;
}

.tip-t {
  margin-top: 3px;
  font-size: 13.5px;
  line-height: 1.4;
  overflow-wrap: anywhere;
}

/* ----------------------------------------------------------------------
   Toast
   ------------------------------------------------------------------- */

.toast {
  position: fixed;
  bottom: 26px;
  left: 50%;
  transform: translate(-50%, 12px);
  z-index: 30;
  padding: 12px 18px;
  font-size: 14px;
  background: #05070a;
  border: 1px solid var(--line-hi);
  border-radius: 12px;
  opacity: 0;
  pointer-events: none;
  transition: 0.22s;
}

.toast.show {
  opacity: 1;
  transform: translate(-50%, 0);
}

/* ----------------------------------------------------------------------
   Modal
   ------------------------------------------------------------------- */

.modal-bg {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(5, 7, 10, 0.72);
}

.modal {
  width: 100%;
  max-width: 470px;
  overflow: hidden;
  background: var(--card);
  border: 1px solid var(--line-hi);
  border-radius: 18px;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.6);
}

.mh {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 18px 20px 12px;
}

.mt {
  font-size: 18px;
  font-weight: 750;
}

.mt i {
  font-style: normal;
  font-size: 12px;
  color: var(--blue);
  background: rgba(143, 178, 255, 0.18);
  border-radius: 6px;
  padding: 2px 8px;
  margin-left: 8px;
  vertical-align: middle;
}

.ms {
  color: var(--muted);
  font-size: 13px;
  margin-top: 4px;
}

.x {
  background: none;
  border: 0;
  color: var(--muted);
  font-size: 18px;
  cursor: pointer;
  padding: 2px 8px;
  border-radius: 8px;
}

.x:hover {
  color: var(--text);
  background: var(--card-hi);
}

.mbody {
  padding: 4px 20px 20px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

textarea.m-input {
  min-height: 104px;
  resize: vertical;
  line-height: 1.45;
}

.mempty {
  color: var(--muted);
  font-size: 13.5px;
  line-height: 1.5;
  padding: 2px 0;
}

.mnote {
  color: var(--muted);
  font-size: 13.5px;
  line-height: 1.5;
  padding: 2px 0;
}

.m-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 4px;
}

.m-actions .push-left,
.m-actions .count {
  margin-right: auto;
  font-size: 12px;
  color: var(--muted);
}

.m-input {
  flex: 1;
  min-width: 0;
  background: var(--inset);
  border: 1px solid var(--line);
  color: var(--text);
  border-radius: 10px;
  padding: 11px 12px;
  font: inherit;
  font-size: 14px;
  outline: 0;
  transition: border-color 0.15s;
  width: 100%;
}

/* editor */

.modal.wide {
  max-width: 860px;
  max-height: 92vh;
  overflow: auto;
}

.modal.mid {
  max-width: 640px;
  max-height: 92vh;
  overflow: auto;
}

/* ----------------------------------------------------------------------
   Editor forms
   ------------------------------------------------------------------- */

.cell {
  background: var(--inset);
  border: 1px solid var(--line);
  color: var(--text);
  border-radius: 10px;
  padding: 11px 12px;
  font: inherit;
  font-size: 14px;
  outline: 0;
  transition: border-color 0.15s;
  width: 100%;
}

.cell:focus {
  border-color: var(--line-focus);
}

.ed-body {
  gap: 14px;
}

.ef-row {
  display: grid;
  grid-template-columns: 1.2fr 1.2fr 0.8fr;
  gap: 12px;
}

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

.ef > span {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  color: var(--muted);
}

.ef select {
  width: 100%;
  background-color: var(--inset);
  border: 1px solid var(--line);
  color: var(--text);
  border-radius: 10px;
  padding: 9px 11px;
  font: inherit;
  font-size: 13.5px;
  outline: 0;
  cursor: pointer;
}

.ef input,
.ef textarea {
  width: 100%;
  background: var(--inset);
  border: 1px solid var(--line);
  color: var(--text);
  border-radius: 10px;
  padding: 9px 11px;
  font: inherit;
  font-size: 13.5px;
  outline: 0;
  resize: vertical;
}

.ef input:focus,
.ef textarea:focus {
  border-color: var(--line-focus);
}

.ef-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}

.ef.wide {
  grid-column: span 1;
}

.ef-grid.two {
  grid-template-columns: 1fr 1fr;
}

.ef.full {
  grid-column: 1/-1;
}

/* editor: the services of one number in their own compact block */

.ef-sub {
  margin: 14px 0 8px;
  padding-top: 12px;
  border-top: 1px dashed var(--line-hi);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.6px;
  text-transform: uppercase;
  color: var(--muted);
}

.ef-sub i {
  font-style: normal;
  font-weight: 600;
  letter-spacing: 0;
  text-transform: none;
  margin-left: 8px;
  color: var(--blue);
}

.ef-grid.services {
  grid-template-columns: repeat(3, 1fr);
  gap: 8px 10px;
}

.ef-grid.services .ef {
  gap: 4px;
}

.ef-grid.services .ef > span {
  font-size: 10px;
}

.ef-grid.services input {
  padding: 7px 9px;
  font-size: 12px;
}

.ef input.mono {
  font-size: 12.5px;
}

@media (max-width: 760px) {
  .ef-row,
  .ef-grid {
    grid-template-columns: 1fr;
  }

  .ef-grid.two {
    grid-template-columns: 1fr;
  }

  .ef-grid.services {
    grid-template-columns: 1fr 1fr;
  }
}

/* ----------------------------------------------------------------------
   Utilities
   ------------------------------------------------------------------- */

.empty {
  grid-column: 1/-1;
  text-align: center;
  color: var(--muted);
  padding: 60px 0;
}

.foot {
  margin: 14px 4px 0;
  color: var(--muted);
  font-size: 12.5px;
  line-height: 1.55;
}

.mono {
  font-family: 'JetBrains Mono', 'SF Mono', Consolas, monospace;
  font-size: 13px !important;
}

.danger-text {
  color: var(--red) !important;
  border-color: rgba(255, 77, 67, 0.4) !important;
}
