/* ============================ Devices Switch Toggle Start ============================ */
.switch {
  display: inline-flex;
  align-items: center;
  justify-content: flex-start;
  width: 40px;
  height: 20px;
  padding: 2px;
  border: 0;
  border-radius: 999px;
  background: #4b4b4b;
  cursor: pointer;
}

.switch span {
  width: 16px;
  height: 16px;
  border-radius: 999px;
  background: var(--white);
  transition: transform 120ms ease;
}

.device-edit-status .switch.is-on {
  margin-top: 10px;
}
.switch.is-on {
  background: #48e6cf;
}

.switch.is-on span {
  transform: translateX(20px);
}
/* ============================ Devices Switch Toggle End ============================ */


/* ============================ Devices Page Shell Start ============================ */
.app-shell[data-page="devices"] .content-shell {
  overflow: hidden;
}

.list-page {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  gap: 18px;
  height: 100%;
  min-height: 0;
}
/* ============================ Devices Page Shell End ============================ */


/* ============================ Devices Toolbar Start ============================ */
.list-toolbar {
      display: grid;
    grid-template-columns: 400px minmax(284px, 424px) 144px minmax(0, 1fr) auto;
    align-items: center;
    gap: 16px;
}

.list-toolbar h1 {
  margin: 0;
  color: var(--dark4txt);
  font-family: var(--font-heading);
  font-size: 20px;
  font-weight: 500;
  line-height: 26px;
}

.search-box {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 24px;
  align-items: center;
  height: 42px;
  padding: 0 12px 0 16px;
  border-radius: var(--radius-sm);
  background: var(--white);
}

.search-box input {
  min-width: 0;
  border: 0;
  outline: 0;
  color: var(--grey4txt);
  background: transparent;
  font: inherit;
}

.search-box img {
  width: 24px;
  height: 24px;
}

.new-devices-button img {
  width: 18px;
  height: 18px;
}
/* ============================ Devices Toolbar End ============================ */


/* ============================ Filter Dropdown Start ============================ */
.filter-dropdown {
  position: relative;
  display: inline-flex;
  min-width: 0;
}

.filter-dropdown .detail-button {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  width: 190px;
  color: var(--grey4txt);
}

.detail-button img {
  width: 16px;
  height: 16px;
}

.detail-button .detail-button-filter-icon {
  display: none;
  width: 20px;
  height: 20px;
}

.detail-button-chevron {
  transition: transform 0.18s ease;
}

.filter-dropdown.is-open .detail-button-chevron {
  transform: rotate(180deg);
}

.filter-dropdown-menu {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  z-index: 20;
  display: none;
  min-width: 220px;
  margin: 0;
  padding: 6px;
  list-style: none;
  border-radius: 10px;
  background: var(--white);
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.18);
}

.filter-dropdown.is-open .filter-dropdown-menu {
  display: block;
}

.filter-dropdown-menu li {
  margin: 0;
}

.filter-dropdown-menu button {
  display: block;
  width: 100%;
  padding: 8px 12px;
  border: 0;
  border-radius: 6px;
  color: var(--dark4txt);
  background: transparent;
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.filter-dropdown-menu button:hover {
  background: rgba(123, 85, 203, 0.08);
}
/* ============================ Filter Dropdown End ============================ */


/* ============================ Devices Stats Start ============================ */


.devices-stats {
  display: flex;
  justify-content: flex-end;
  gap: 20px;
  color: var(--grey4txt);
  white-space: nowrap;
}

.devices-stats strong {
  font-weight: 800;
}

.devices-stats .pink {
  color: var(--accent-pink);
}
.tiny-dot{
  margin: 0px 8px 0px 0px;
  width: 10px;
  height: 10px;
}
/* ============================ Devices Stats End ============================ */


/* ============================ Devices Table Start ============================ */
.devices-table th:nth-child(1),
.devices-table td:nth-child(1) { width: 200px; }
.devices-table th:nth-child(2),
.devices-table td:nth-child(2) { width: 130px; }
.devices-table th:nth-child(3),
.devices-table td:nth-child(3) { width: 160px; }
.devices-table th:nth-child(4),
.devices-table td:nth-child(4) { width: 160px; }
.devices-table th:nth-child(6),
.devices-table td:nth-child(6) { width: 100px; text-align: center; }
.devices-table th:nth-child(7),
.devices-table td:nth-child(7) { width: 68px; text-align: center; }
/* ============================ Devices Table End ============================ */
/* ============================ Devices Page Filter Panel Start ============================ */
.devices-filter-panel {
  justify-content: center;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 12px 18px;
    border-radius: var(--radius-sm);
}

.devices-filter-panel[hidden] {
  display: none;
}

.devices-filter-panel:not([hidden]) + .devices-table-shell {
  margin-top: 40px;
}

.devices-filter-field {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 14px;
  color: var(--dark4txt);
}

.devices-filter-field .filter-dropdown {
  min-width: 200px;
}

.devices-filter-field .filter-dropdown .detail-button {
  width: 100%;
  height: 40px;
  padding: 0 14px;
  justify-content: space-between;
  border-radius: 8px;
  background: var(--white);
  border: 1px solid var(--line);
  color: var(--dark4txt);
}

.devices-filter-field .filter-dropdown .detail-button-text {
  flex: 1 1 auto;
  text-align: left;
}

.devices-filter-check {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  color: var(--dark4txt);
  cursor: pointer;
}

.devices-filter-check input {
  appearance: none;
  width: 18px;
  height: 18px;
  margin: 0;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: var(--white);
  cursor: pointer;
}

.devices-filter-check input:checked {
  background: var(--accent-green);
  border-color: var(--accent-green);
}

.devices-filter-check input:checked::after {
  content: "✓";
  display: block;
  margin-top: -2px;
  color: var(--white);
  font-size: 14px;
  line-height: 18px;
  text-align: center;
}

.devices-filter-submit {
  height: 40px;
  padding: 0 22px;
  border-radius: 8px;
  background: var(--white);
  border: 1px solid var(--line);
  color: var(--dark4txt);
  cursor: pointer;
}

.devices-count {
  margin-left: 6px;
  color: var(--grey4txt);
  font-weight: 400;
  font-size: 16px;
}

/* ============================ Devices Edit Modal Extras Start ============================ */

.info-modal-accordion-body {
    display: none;
    padding: 18px 22px;
}   
.info-modal[data-device-instance] .device-edit-client-row {
  display: flex;
  gap: 12px;
  align-items: flex-end;
}

.info-modal[data-device-instance] .device-edit-client {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.info-modal[data-device-instance] .device-edit-client input {
  height: 44px;
  padding: 0 14px;
  border: 0;
  border-radius: 10px;
  background: var(--white);
  color: var(--dark4txt);
  font: inherit;
}
.device-edit-client{
  width: 100%;
}
.info-modal-field-wide{
  align-items: end;
}
.device-edit-new{
  height: 58px;
}

.info-modal[data-device-instance] .device-edit-new {
  flex: 0 0 0;
  white-space: normal;
  line-height: 18px;
   background: #FFFFFF59;
   border-color: var(--white);
}
.devices_modalbox_sec_row{
  display: flex;
  justify-content: space-between;
  width: 100%;
  gap: 10px;
}
.info-modal-plus {
    width: 54px;
    height: 44px;
  }

.info-modal-form > .info-modal-field {
    margin-top: 10px;
}
.devices_modalbox_sec_row .info-modal-field {
    flex: none;
    width: 40%;
}
.devices_modalbox_sec_row .device-edit-uuid{
  width: 50%;
}

.info-modal[data-device-instance] .device-edit-status {
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  gap: 12px;
  width: 8%;
}
.info-modal[data-device-instance] .device-edit-status .switch {
  margin-top: 5px;
}

.info-modal[data-device-instance] .device-edit-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 18px;
  font-size: 13px;
  color: var(--dark4txt);
}

.info-modal[data-device-instance] .device-edit-meta span {
  color: var(--grey4txt);
}
.device-edit-comment{
  border: 0px;
    border-radius: 6px;
    padding: 12px;
    width: 100%;
}


.info-modal[data-device-instance] .device-edit-comment {
  width: 100%;
  min-height: 70px;
  padding: 10px 14px;
  border: 0;
  border-radius: 10px;
  background: var(--white);
  color: var(--dark4txt);
  font: inherit;
  resize: vertical;
}

.info-modal[data-device-instance] .device-edit-actions {
  align-items: center;
  gap: 10px;
}

 .device-edit-actions-right {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-left: auto;
}

.info-modal[data-device-instance] .device-edit-refresh {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.device-edit-refresh {
  display: flex;
    align-items: center;
    gap: 5px;
    justify-content: center;
}


/* ============================ Devices Edit Modal Extras End ============================ */

/* ============================ Valdyti Modal Start ============================ */
.valdyti-modal-card {
  width: min(520px, 100vw - 48px) !important;
  max-height: calc(100vh - 48px);
}

.valdyti-section {
  margin-bottom: 18px;
}

.valdyti-section-title {
  margin: 0 0 10px;
  color: var(--dark4txt);
  font-family: var(--font-body);
  font-size: 14px;
  font-weight: 500;
}

.valdyti-input,
.valdyti-textarea {
  width: 100%;
  padding: 10px 14px;
  border: 0;
  border-radius: 10px;
  background: var(--white);
  color: var(--dark4txt);
  font: inherit;
  margin-bottom: 10px;
}

.valdyti-textarea {
  min-height: 90px;
  resize: vertical;
}

.valdyti-send-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.valdyti-send {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.valdyti-commands {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.valdyti-commands .info-modal-save {
  flex: none;
  min-width: 0;
}


/* ============================ Valdyti Modal End ============================ */


/* ============================ Perkelti Modal Extras Start ============================ */
.perkelti-panel {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.perkelti-label {
  font-size: 13px;
  color: var(--grey4txt);
}

.perkelti-search {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 14px;
  height: 44px;
  border-radius: 10px;
  background: var(--white);
}

.perkelti-search input {
  flex: 1 1 auto;
  border: 0;
  outline: 0;
  background: transparent;
  font: inherit;
  color: var(--dark4txt);
}

.perkelti-search img {
  width: 18px;
  height: 18px;
  opacity: 0.6;
}

.perkelti-panel .confirm-modal-actions {
  justify-content: flex-start;
}
/* ============================ Perkelti Modal Extras End ============================ */


/* ============================ Devices Modal Theming Tweaks Start ============================ */
.info-modal[data-device-instance] .info-modal-field--muted input {
  background: #FFFFFF66;
}

.info-modal[data-device-instance] .info-modal-save,
#valdytiModal .info-modal-save,
#valdytiModal .info-modal-plus,
.info-modal[data-device-instance] .info-modal-plus {
  background: #FFFFFF59;
  border: 1px solid var(--white);
  color: var(--dark4txt);
}

.info-modal[data-device-instance] .device-edit-client-row {
  padding-bottom: 30px;
  margin-bottom: 4px;
  border-bottom: 1px solid var(--white);
}
/* ============================ Devices Modal Theming Tweaks End ============================ */

/* ============================ Devices Mobile Card Layout Start ============================ */
@media (max-width: 1770px) {
  .list-toolbar{
        flex-wrap: wrap;
    display: flex;
    justify-content: space-between;
  }
}
@media (max-width: 1600px) {
  .list-toolbar{
    justify-content: flex-start;
  }
}
@media (max-width: 1024px) {
  .app-shell[data-page="devices"] .content-shell {
    padding: 16px;
    overflow: auto;
    border-radius: var(--radius-lg);
    background: var(--panel-bg);
  }

  .list-page {
    display: block;
    height: auto;
    min-height: 100%;
  }

  .list-toolbar {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto 44px;
    gap: 8px;
    margin-bottom: 24px;
  }

  .list-toolbar h1 {
    grid-column: 1 / 2;
    grid-row: 1;
    align-self: center;
    font-size: 20px;
    line-height: 26px;
  }

  .new-devices-button {
    grid-column: 4 / 5;
    grid-row: 1;
    width: 44px;
    height: 38px;
    padding: 0;
  }

  .new-devices-button .new-devices-text {
    display: none;
  }

  .devices-stats {
    display: contents;
    color: var(--grey4txt);
    font-size: 14px;
    line-height: 18px;
    white-space: nowrap;
  }

  .devices-stats span:nth-child(1) {
    grid-column: 2 / 4;
    grid-row: 1;
    align-self: center;
    justify-self: end;
  }

  .devices-stats span:nth-child(2) {
    grid-column: 1 / 2;
    grid-row: 2;
  }

  .devices-stats span:nth-child(3) {
    grid-column: 2 / 3;
    grid-row: 2;
  }

  .devices-stats span:nth-child(4) {
    grid-column: 3 / 5;
    grid-row: 2;
    justify-self: end;
  }

  .search-box {
    grid-column: 1 / 4;
    grid-row: 3;
    height: 41px;
  }

  .filter-dropdown {
    grid-column: 4 / 5;
    grid-row: 3;
  }

  .filter-dropdown .detail-button {
    width: 44px;
    height: 41px;
    padding: 0;
    justify-content: center;
  }

  .filter-dropdown .detail-button-text {
    display: none;
  }

  .filter-dropdown .detail-button img {
    display: none;
  }

  .filter-dropdown .detail-button .detail-button-filter-icon {
    display: block;
    width: 20px;
    height: 20px;
  }

  .filter-dropdown-menu {
    right: 0;
    left: auto;
  }

  .devices-table-shell {
    overflow: visible;
  }

  .devices-table,
  .devices-table tbody,
  .devices-table tr,
  .devices-table th,
  .devices-table td {
    display: block;
    width: auto !important;
    min-width: 0;
    border: 0;
    text-align: left;
  }

  .devices-table {
    margin: 0;
    border-spacing: 0;
    table-layout: auto;
  }

  .devices-table thead,
  .devices-table .devices-table-head,
  thead.devices-table-head {
    display: none;
  }

  .devices-table tbody {
    display: grid;
    gap: 8px;
  }

  .devices-table tbody::before {
    display: none;
  }

  .devices-row {
    display: grid !important;
    grid-template-columns: repeat(6, minmax(0, 1fr)) 48px;
    overflow: hidden;
    border-radius: var(--radius-sm);
    background: rgba(255, 255, 255, 0.6);
  }

  .devices-row.is-alt {
    background: rgba(255, 255, 255, 0.3);
  }

  .devices-row > td {
    min-height: 45px;
    padding: 7px 16px;
    overflow: hidden;
    color: var(--dark4txt);
    background: transparent !important;
    border-top: 2px solid rgba(3, 5, 34, 0.1);
    border-left: 2px solid rgba(3, 5, 34, 0.1);
    border-radius: 0;
    font-size: 14px;
    line-height: 16px;
    text-overflow: ellipsis;
    white-space: normal;
  }

  /* Row 1 — Klientas (email, large heading) + Būsena (switch). No labels. */
  .devices-row > td:nth-child(5) {
    grid-column: 1 / 7 !important;
    grid-row: 1 !important;
    display: flex;
    align-items: center;
    min-height: 46px;
    padding: 8px 16px;
    border-top: 0;
    border-left: 0;
    color: var(--grey4txt);
    font-family: var(--font-heading);
    font-size: 18px;
    font-weight: 400;
    line-height: 24px;
  }

  .devices-row > td:nth-child(6) {
    grid-column: 7 / 8 !important;
    grid-row: 1 !important;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 46px;
    padding: 0;
    border-top: 0;
  }

  /* Row 2 — MAC | Tipas | Modelis (labelled) */
  .devices-row > td:nth-child(1) { grid-column: 1 / 3 !important; grid-row: 2 !important; border-left: 0; }
  .devices-row > td:nth-child(2) { grid-column: 3 / 5 !important; grid-row: 2 !important; text-align: left; }
  .devices-row > td:nth-child(3) { grid-column: 5 / 8 !important; grid-row: 2 !important; text-align: left; }

  /* Row 3 — Versija (labelled) + trash */
  .devices-row > td:nth-child(4) {
    grid-column: 1 / 7 !important;
    grid-row: 3 !important;
    border-left: 0;
  }

  .devices-row > td:nth-child(7) {
    grid-column: 7 / 8 !important;
    grid-row: 3 !important;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 45px;
    padding: 0;
  }

  /* Labels via ::before on the cells that need them. Hide labels on cells 5 (email) and 6 (switch). */
  .devices-row > td:nth-child(1)::before { content: "MAC"; }
  .devices-row > td:nth-child(2)::before { content: "Tipas"; }
  .devices-row > td:nth-child(3)::before { content: "Modelis"; }
  .devices-row > td:nth-child(4)::before { content: "Versija"; }

  .devices-row > td:nth-child(1)::before,
  .devices-row > td:nth-child(2)::before,
  .devices-row > td:nth-child(3)::before,
  .devices-row > td:nth-child(4)::before {
    display: block;
    color: var(--grey4txt);
    font-size: 14px;
    font-weight: 400;
    line-height: 16px;
  }

  .devices-row > td:empty::after,
  .devices-row > td.is-empty::after {
    content: "...";
    color: var(--dark4txt);
  }

  .table-icon {
    width: 34px;
    height: 34px;
  }

  .devices-filter-panel {
    flex-direction: column;
    align-items: stretch;
  }
  .devices-filter-field,
  .devices-filter-check {
    width: 100%;
  }
  .devices-filter-field .filter-dropdown {
    width: 100%;
    min-width: 0;
  }
  .devices-filter-submit {
    margin-left: 0;
    width: 100%;
  }
}

@media (max-width: 768px) {
  .info-modal[data-device-instance] .device-edit-client-row {
    flex-direction: column;
    align-items: stretch;
  }
  .info-modal[data-device-instance] .device-edit-actions {
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
  }
  .info-modal[data-device-instance] .device-edit-actions-right {
    margin-left: 0;
    width: 100%;
  }
  .info-modal[data-device-instance] .device-edit-actions-right .info-modal-save {
    flex: 1 1 auto;
  }
  .devices_modalbox_sec_row{
    flex-direction: column;
    justify-content: flex-start;
  }
  .devices_modalbox_sec_row .info-modal-field {
    flex: none;
    width: 100% !important;}
    .info-modal[data-device-instance] .device-edit-status {
    align-items: flex-start;
  }
  .info-modal-field-wide {
    align-items: normal;
  }
  .device-edit-new {
    height: 45px;
}
}

@media (max-width: 600px) {
  .valdyti-modal-card {
    width: 100vw !important;
    height: 100vh !important;
    max-width: 100vw !important;
    max-height: 100vh !important;
    left: 0 !important;
    top: 0 !important;
    border-radius: 0 !important;
  }
  .valdyti-commands .info-modal-save {
    flex-basis: 100%;
  }
}
@media (max-width: 594px) {
  .devices-table td:nth-child(1) { height: 70px; }
.devices-row > td:nth-child(2) { height: 70px; }
.devices-table td:nth-child(3) { height: 70px;}
}

@media (max-width: 480px) {
   .device-edit-actions{
    flex-direction: column;
    gap: 10px;
   }
   .device-edit-actions-right{
    width: 100%;
    flex-direction: column;
   }
}
@media (max-width: 460px) {
  .app-shell[data-page="devices"] .content-shell {
        padding: 10px;
}
}
@media (max-width: 420px) {
  .list-toolbar {
    grid-template-columns: auto minmax(0, 1fr) 44px;
  }

  .new-devices-button {
    grid-column: 3 / 4;
  }

  .devices-stats span:nth-child(1) {
    grid-column: 2 / 3;
    grid-row: 1;
    justify-self: end;
  }

  .devices-stats span:nth-child(2),
  .devices-stats span:nth-child(3),
  .devices-stats span:nth-child(4) {
    grid-column: 1 / -1;
    justify-self: start;
  }

  .devices-stats span:nth-child(2) {
    grid-row: 2;
  }

  .devices-stats span:nth-child(3) {
    grid-row: 3;
  }

  .devices-stats span:nth-child(4) {
    grid-row: 4;
  }

  .search-box {
    grid-column: 1 / 3;
    grid-row: 5;
  }

  .filter-dropdown {
    grid-column: 3 / 4;
    grid-row: 5;
  }

  .devices-row > td:nth-child(2) {
    font-size: 14px;
  }

  .devices-stats {
    font-size: 13px;
  }
      .devices-row > td {
        padding: 7px 7px;
      min-height: 45px;}
}


/* ============================ Devices Mobile Card Layout End ============================ */
