/* =========================
   ORTEA Dashboard — REDESIGN v8
   Full replacement CSS
   ========================= */

:root{
  --bg:#081028;
  --card:#0B1739;
  --card2:#08183A;
  --text:#FFFFFF;
  --muted:#AEB9E1;
  --muted2:#7E89AC;
  --border:rgba(255,255,255,.12);
  --borderSoft:rgba(255,255,255,.08);
  --borderSofter:rgba(255,255,255,.06);
  --hover:rgba(255,255,255,.04);
  --accent:#0038FF;
  --accent2:#00C2FF;
  --success:#39F2B0;
  --danger:#C94B63;
  --dangerHover:#D45A72;
  --dangerSoft:rgba(201,75,99,.18);
  --dangerGlow:rgba(201,75,99,.28);

  /* Voltage gauge range */
  --v-min:150;
  --v-good-min:207;
  --v-good-max:253;
  --v-max:260;
}

*{ box-sizing:border-box; }
html,body{ max-width:100%; overflow-x:hidden; }
body,.main{ background:var(--bg); }
.hidden{ display:none !important; }

/* =========================
   Header / user
   ========================= */
#ortea-user-name,
.ortea-user-menu__name,
.ortea-user-menu__trigger{
  color:#fff !important;
}

.ortea-user-menu{
  position:relative;
  display:inline-block;
}

.ortea-user-menu__trigger{
  display:inline-flex;
  align-items:center;
  gap:4px;
  padding:0;
  margin:0;
  background:transparent !important;
  border:none !important;
  border-radius:0 !important;
  box-shadow:none !important;
  font:500 14px/1 Roboto,system-ui,-apple-system,Segoe UI,Arial;
  cursor:pointer;
  appearance:none;
  text-decoration:none;
}

.ortea-user-menu__trigger:hover,
.ortea-user-menu__trigger:focus,
.ortea-user-menu__trigger:active{
  color:#fff !important;
  background:transparent !important;
  border:none !important;
  box-shadow:none !important;
  outline:none !important;
  transform:none !important;
}

.ortea-user-menu__caret{
  font-size:10px;
  line-height:1;
}

.ortea-user-menu__dropdown{
  position:absolute;
  top:calc(100% + 8px);
  left:0;
  min-width:140px;
  padding:6px 0;
  background:var(--card);
  border:1px solid rgba(255,255,255,.14);
  border-radius:10px;
  box-shadow:0 12px 30px rgba(0,0,0,.28);
  display:none;
  z-index:1000;
}
.ortea-user-menu.is-open .ortea-user-menu__dropdown{ display:block; }

.ortea-user-menu__item{
  display:block;
  width:100%;
  padding:10px 14px;
  background:none;
  border:none;
  color:#fff;
  text-align:left;
  font:500 14px/1.2 Roboto,system-ui,-apple-system,Segoe UI,Arial;
  cursor:pointer;
}
.ortea-user-menu__item:hover,
.ortea-user-menu__item:focus{
  background:rgba(255,255,255,.08);
  outline:none;
}

/* =========================
   Device buttons
   ========================= */
.devices__title,
.ortea-ui-title{
  color:rgba(255,255,255,.92) !important;
  font:600 16px/20px Roboto,system-ui,-apple-system,Segoe UI,Arial !important;
  letter-spacing:.2px;
}

#devices-list{
  display:flex !important;
  flex-wrap:wrap;
  gap:12px;
  margin:10px 0 16px;
}

.device-card{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  min-height:54px;
  padding:12px 14px;
  background:var(--card) !important;
  border:1px solid var(--border) !important;
  border-radius:16px;
  color:var(--text);
  cursor:pointer;
  box-shadow:0 16px 40px rgba(0,0,0,.22);
  transition:border-color .2s ease, box-shadow .2s ease, transform .2s ease;
}

.device-card:hover{
  border-color:rgba(255,255,255,.22) !important;
  box-shadow:0 18px 46px rgba(0,0,0,.28);
}

.device-card--active{
  border-color:#fff !important;
  box-shadow:0 0 0 1px rgba(255,255,255,.55), 0 18px 46px rgba(0,0,0,.28);
}

.device-card__name{
  color:var(--text);
  font-weight:500;
}

.device-card__statusDot{
  width:10px;
  height:10px;
  border-radius:999px;
  flex:0 0 auto;
  box-shadow:0 0 0 3px rgba(255,255,255,.06);
}
.device-card__statusDot.is-online{ background:var(--success); }
.device-card__statusDot.is-offline{ background:#ff6b6b; }

/* =========================
   Map
   ========================= */
#ortea-map-wrap{
  margin:12px 0 16px;
  background:rgba(255,255,255,.02);
  border:1px solid rgba(255,255,255,.12);
  border-radius:16px;
  overflow:hidden;
  box-shadow:0 16px 40px rgba(0,0,0,.22);
}
#ortea-map{ width:100%; height:320px; }
@media (max-width:600px){
  #ortea-map{ height:240px; }
}

.ortea-map-attrib{
  background:rgba(11,23,57,.85);
  border:1px solid rgba(255,255,255,.12);
  color:rgba(255,255,255,.75);
  font:400 11px/11px Roboto,system-ui,-apple-system,Segoe UI,Arial;
  padding:6px 8px;
  border-radius:10px;
  margin:0 10px 10px 0;
}

/* =========================
   Main tabs
   ========================= */
.tabs{
  display:grid;
  grid-template-columns:repeat(3,minmax(0,1fr));
  gap:18px;
  margin:12px 0 18px;
}

.tabs__tab{
  min-height:46px;
  display:flex;
  align-items:center;
  justify-content:center;
  text-align:center;
  background:var(--card);
  color:rgba(255,255,255,.88);
  border:1px solid var(--border);
  border-radius:14px;
  padding:10px 12px;
  cursor:pointer;
  font:500 14px/1.2 Roboto,system-ui,-apple-system,Segoe UI,Arial;
  transition:border-color .2s ease, box-shadow .2s ease, background .2s ease;
}
.tabs__tab:hover{ border-color:rgba(255,255,255,.22); }
.tabs__tab--active{
  color:#fff;
  background:#0F245D;
  border-color:#fff;
  box-shadow:0 0 0 1px rgba(255,255,255,.55);
}

@media (max-width:767px){
  .tabs{
    grid-template-columns:repeat(3,minmax(0,1fr));
    gap:10px;
  }
  .tabs__tab{
    justify-content:center;
    padding:12px 10px;
  }
}

/* =========================
   KPI cards
   ========================= */
.ortea-kpi-grid{
  display:grid;
  grid-template-columns:repeat(3,minmax(0,1fr));
  gap:18px;
  margin:18px 0 12px;
}

.ortea-kpi-card{
  background:var(--card);
  border-radius:22px;
  box-shadow:0 16px 40px rgba(0,0,0,.22);
  padding:28px 28px 24px;
  color:var(--text);
  min-height:190px;
  overflow:hidden;
}

.ortea-kpi-title{
  margin:0;
  font:300 clamp(20px,1.6vw,29px)/1.15 Roboto,system-ui,-apple-system,Segoe UI,Arial;
  letter-spacing:.2px;
}

.ortea-kpi-phase{
  margin-top:8px;
  font:400 clamp(11px,.8vw,14px)/1 Roboto,system-ui,-apple-system,Segoe UI,Arial;
  letter-spacing:.9px;
  color:rgba(255,255,255,.58);
  text-transform:uppercase;
}

.ortea-kpi-valueRow{
  margin-top:22px;
  display:inline-flex;
  align-items:flex-end;
  gap:0;
  white-space:nowrap;
  line-height:1;
}

.ortea-kpi-number{
  display:inline-block;
  margin:0;
  padding:0;
  font:700 clamp(34px,3.2vw,60px)/1 "Work Sans",Roboto,system-ui,-apple-system,Segoe UI,Arial;
  letter-spacing:.02em;
  color:#fff;
}

.ortea-kpi-unit{
  display:inline-block;
  margin:0;
  padding:0;
  font:500 clamp(34px,3.2vw,60px)/1 "Work Sans",Roboto,system-ui,-apple-system,Segoe UI,Arial;
  letter-spacing:0;
  color:#fff;
  opacity:.6;
}

/* hide meta */
.ortea-kpi-meta{
  display:none;
}

/* Voltage cards */
.ortea-kpi-card--voltage{
  position:relative;
  display:grid;
  grid-template-rows:auto auto 1fr;
  padding:28px 28px 18px;
  min-height:190px;
}

.ortea-kpi-card--voltage .ortea-kpi-valueRow{
  display:none;
}

.ortea-kpi-card--voltage .ortea-kpi-title{
  margin:0;
}

.ortea-kpi-card--voltage .ortea-kpi-phase{
  margin-top:8px;
  margin-bottom:0;
}

.ortea-vgauge{
  position:relative;
  width:100%;
  aspect-ratio:1 / 1;
  margin-top:8px;
  overflow:visible;
}

.ortea-vgauge canvas{
  display:block;
  margin:0 auto;
  image-rendering:auto;
  backface-visibility:hidden;
  -webkit-font-smoothing:antialiased;
  contain:layout paint;
}

.ortea-vgauge__text{
  position:absolute;
  inset:0;
  display:grid;
  place-items:center;
  text-align:center;
  pointer-events:none;
  white-space:nowrap;
  z-index:2;
}

.ortea-vgauge__value{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  gap:0;
  color:#fff;
  white-space:nowrap;
  line-height:1;
  transform:translateY(6px);
}

.ortea-kpi-card--voltage .ortea-vgauge__value .ortea-kpi-number{
  font-size:clamp(34px,3.2vw,60px);
  font-weight:700;
}

.ortea-kpi-card--voltage .ortea-vgauge__value .ortea-kpi-unit{
  font-size:clamp(34px,3.2vw,60px);
  font-weight:500;
  opacity:.6;
}

/* Lower metric cards */
.ortea-kpi-card:not(.ortea-kpi-card--voltage) .ortea-kpi-title{
  margin-bottom:0;
}

.ortea-kpi-card:not(.ortea-kpi-card--voltage) .ortea-kpi-unit{
  position:static;
  left:auto;
  color:#fff;
}

/* Optional helper classes if JS/HTML uses them */
.ortea-kpi-card--phase1 .ortea-kpi-phase::before,
.ortea-kpi-card[data-phase="1"] .ortea-kpi-phase::before{ content:"ФАЗА 1"; }
.ortea-kpi-card--phase2 .ortea-kpi-phase::before,
.ortea-kpi-card[data-phase="2"] .ortea-kpi-phase::before{ content:"ФАЗА 2"; }
.ortea-kpi-card--phase3 .ortea-kpi-phase::before,
.ortea-kpi-card[data-phase="3"] .ortea-kpi-phase::before{ content:"ФАЗА 3"; }

/* Hide phase labels on lower rows if markup reused there */
.ortea-kpi-card:not(.ortea-kpi-card--voltage) .ortea-kpi-phase{
  display:none;
}

/* tablet */
@media (max-width:1100px){
  .ortea-kpi-grid{ gap:14px; }
  .ortea-kpi-card{
    padding:22px 22px 20px;
  }
  .ortea-kpi-card--voltage{
    padding:22px 22px 14px;
  }
  .ortea-kpi-card--voltage .ortea-vgauge__value .ortea-kpi-number,
  .ortea-kpi-card--voltage .ortea-vgauge__value .ortea-kpi-unit{
    font-size:clamp(28px,4vw,44px);
  }
}

/* mobile */
@media (max-width:767px){
  .ortea-kpi-grid{
    grid-template-columns:repeat(3,minmax(0,1fr));
    gap:10px;
  }

  .ortea-kpi-card{
    min-height:auto;
    padding:12px 10px 12px;
    border-radius:16px;
  }

  .ortea-kpi-card--voltage{
    padding:12px 10px 10px;
    min-height:auto;
  }

  .ortea-kpi-title{
    font-size:clamp(11px,3.6vw,14px);
    line-height:1.15;
  }

  .ortea-kpi-phase{
    margin-top:4px;
    font-size:10px;
    letter-spacing:.7px;
  }

  .ortea-vgauge{
    margin-top:4px;
  }

  .ortea-vgauge__value{
    transform:translateY(4px);
  }

  .ortea-kpi-card--voltage .ortea-vgauge__value .ortea-kpi-number,
  .ortea-kpi-card--voltage .ortea-vgauge__value .ortea-kpi-unit{
    font-size:clamp(18px,5vw,22px);
  }

  .ortea-kpi-valueRow{
    margin-top:14px;
  }

  .ortea-kpi-valueRow .ortea-kpi-number,
  .ortea-kpi-valueRow .ortea-kpi-unit{
    font-size:clamp(18px,7vw,30px);
  }
}

/* =========================
   History controls
   ========================= */
#ortea_mode_title{ margin:12px 0 !important; }
#ortea_title_current,
#ortea_title_history{ margin:18px 0 12px !important; }

#graph label{
  color:var(--text) !important;
  opacity:.92;
}

#graph input[type="datetime-local"],
#graph input[type="text"],
#graph input[type="date"],
#graph input[type="time"],
#graph select{
  width:100%;
  min-height:44px;
  background:var(--card) !important;
  color:rgba(255,255,255,.92) !important;
  border:1px solid rgba(255,255,255,.12) !important;
  border-radius:12px !important;
  padding:10px 12px !important;
  box-shadow:none !important;
}

#ortea_hist_apply{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  min-height:46px;
  padding:12px 18px !important;
  margin:14px 0 0 !important;
  background:var(--danger) !important;
  color:#fff !important;
  border:1px solid transparent !important;
  border-radius:12px !important;
  box-shadow:0 10px 24px var(--dangerSoft) !important;
  font:600 14px/1 Roboto,system-ui,-apple-system,Segoe UI,Arial !important;
}
#ortea_hist_apply:hover{
  background:var(--dangerHover) !important;
  box-shadow:0 12px 28px var(--dangerGlow) !important;
}

/* Mobile-friendly metric list instead of button cloud */
#graph .ortea-metric-grid{
  display:grid;
  grid-template-columns:1fr;
  gap:10px;
  margin:12px 0 16px;
}

#graph .ortea-metric{
  display:grid;
  grid-template-columns:minmax(0,1fr) auto;
  align-items:center;
  gap:14px;
  min-height:50px;
  padding:12px 14px !important;
  background:var(--card) !important;
  color:#fff !important;
  border:1px solid var(--border) !important;
  border-radius:14px !important;
  box-shadow:0 12px 30px rgba(0,0,0,.22) !important;
  cursor:pointer;
  transition:border-color .2s ease, box-shadow .2s ease, background .2s ease;
}

#graph .ortea-metric:hover{
  border-color:rgba(255,255,255,.22) !important;
}

#graph .ortea-metric__title{
  font:500 14px/1.25 Roboto,system-ui,-apple-system,Segoe UI,Arial;
  color:#fff;
}

#graph .ortea-metric__check{
  width:20px;
  height:20px;
  border-radius:6px;
  border:2px solid rgba(255,255,255,.28);
  display:inline-flex;
  align-items:center;
  justify-content:center;
  background:transparent;
  flex:0 0 auto;
}

#graph .ortea-metric--on{
  border-color:rgba(255,255,255,.86) !important;
  box-shadow:0 0 0 1px rgba(255,255,255,.22), 0 12px 30px rgba(0,0,0,.25) !important;
  background:#10204A !important;
}
#graph .ortea-metric--on .ortea-metric__check{
  border-color:var(--danger);
  background:var(--dangerSoft);
  box-shadow:0 0 0 2px rgba(201,75,99,.10);
}
#graph .ortea-metric--on .ortea-metric__check::after{
  content:"";
  width:8px;
  height:8px;
  border-radius:2px;
  background:var(--danger);
}

#graph canvas{
  width:100% !important;
  max-width:100%;
  background:transparent !important;
  border:none !important;
  box-shadow:none !important;
}

/* =========================
   Messages
   ========================= */
#messages{ margin-top:16px; }

.messages-head{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  margin-bottom:14px;
}

.messages-title{
  color:#fff;
  font-size:18px;
  font-weight:700;
}

.messages-head__actions{
  display:flex;
  align-items:center;
  gap:10px;
}

.messages-refresh-btn,
.messages-secondary-btn{
  appearance:none;
  border:1px solid rgba(255,255,255,.12);
  background:#0B1739;
  color:#fff;
  border-radius:10px;
  padding:10px 14px;
  cursor:pointer;
  transition:.2s ease;
}

.messages-refresh-btn:hover,
.messages-secondary-btn:hover{
  border-color:rgba(255,255,255,.22);
  background:#10204A;
}

.messages-secondary-btn:disabled,
.messages-refresh-btn:disabled{
  opacity:.55;
  cursor:default;
}

.messages-empty{
  padding:16px;
  border-radius:14px;
  background:#0B1739;
  border:1px solid rgba(255,255,255,.08);
  color:#AEB9E1;
}

.messages-list{
  display:grid;
  gap:12px;
}

.message-card{
  background:#0B1739;
  border:1px solid rgba(255,255,255,.08);
  border-radius:14px;
  padding:14px 16px;
}

.message-card--critical{
  border-color:rgba(201,75,99,.55);
  box-shadow:inset 0 0 0 1px rgba(201,75,99,.10);
}

.message-card__top{
  display:flex;
  justify-content:space-between;
  align-items:flex-start;
  gap:12px;
  margin-bottom:10px;
}

.message-card__title{
  color:#fff;
  font-size:15px;
  line-height:1.4;
  font-weight:700;
}

.message-card__badges{
  display:flex;
  flex-wrap:wrap;
  gap:8px;
}

.message-badge{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  min-height:26px;
  padding:4px 10px;
  border-radius:999px;
  background:rgba(255,255,255,.08);
  color:#AEB9E1;
  font-size:12px;
  line-height:1;
  white-space:nowrap;
}

.message-badge--active{
  background:rgba(201,75,99,.16);
  color:#ffb4c0;
}

.message-badge--new{
  background:rgba(201,75,99,.16);
  color:#ffd2da;
}

.message-badge--read{
  background:rgba(255,255,255,.08);
  color:#d6defb;
}

.message-card__meta{
  display:flex;
  flex-wrap:wrap;
  gap:14px;
  color:#AEB9E1;
  font-size:13px;
  line-height:1.5;
}

.message-card__data{
  display:flex;
  flex-wrap:wrap;
  gap:8px;
  margin-top:10px;
}

.message-param{
  display:inline-flex;
  align-items:center;
  min-height:28px;
  padding:6px 10px;
  border-radius:10px;
  background:rgba(255,255,255,.05);
  color:#fff;
  font-size:12px;
  line-height:1;
}

.message-card__readinfo{
  margin-top:10px;
  color:#AEB9E1;
  font-size:12px;
  line-height:1.4;
}

/* =========================
   Flatpickr / date UI
   ========================= */
.flatpickr-calendar{
  background:var(--card) !important;
  border:1px solid var(--border) !important;
  box-shadow:0 20px 55px rgba(0,0,0,.55) !important;
  border-radius:16px !important;
}
.flatpickr-months,.flatpickr-weekdays{
  background:var(--card2) !important;
  border-top-left-radius:16px;
  border-top-right-radius:16px;
}
.flatpickr-current-month,
.flatpickr-monthDropdown-months,
.flatpickr-weekday,
.flatpickr-day{
  color:#fff !important;
}
.flatpickr-day:hover{
  background:rgba(0,56,255,.18) !important;
  border-color:transparent !important;
}
.flatpickr-day.selected,
.flatpickr-day.startRange,
.flatpickr-day.endRange{
  background:var(--accent) !important;
  border-color:var(--accent) !important;
  color:#fff !important;
}
.flatpickr-time{
  background:var(--card) !important;
  border-top:1px solid rgba(255,255,255,.10) !important;
}
.flatpickr-time input,
.flatpickr-time .flatpickr-am-pm,
.flatpickr-hour,
.flatpickr-minute{
  background:var(--card2) !important;
  color:#fff !important;
  border:none !important;
}
.flatpickr-calendar *{
  color:#fff !important;
}
input[type="datetime-local"]::-webkit-calendar-picker-indicator{
  filter:invert(1);
  opacity:.85;
}

/* =========================
   DataTables / wpDataTables
   ========================= */
#table_1_wrapper,
#table_2_wrapper{ color:#fff; }

#table_1_wrapper .dt-buttons,
#table_2_wrapper .dt-buttons{
  display:flex;
  gap:10px;
  flex-wrap:wrap;
  margin:10px 0 14px;
}

#table_1_wrapper .dt-buttons .dt-button,
#table_2_wrapper .dt-buttons .dt-button{
  background:var(--card) !important;
  color:#fff !important;
  border:1px solid var(--border) !important;
  border-radius:12px !important;
  padding:8px 14px !important;
  font:500 14px/14px Roboto,system-ui,-apple-system,Segoe UI,Arial;
  box-shadow:0 10px 25px rgba(0,0,0,.25);
  transition:border-color .2s ease, background .2s ease;
}
#table_1_wrapper .dt-buttons .dt-button:hover,
#table_2_wrapper .dt-buttons .dt-button:hover{
  background:#0F1E4A !important;
  border-color:rgba(255,255,255,.24) !important;
}
#table_1_wrapper .dt-buttons .dt-button span,
#table_2_wrapper .dt-buttons .dt-button span{ color:#fff !important; }

#table_1_wrapper .dataTables_length,
#table_2_wrapper .dataTables_length,
#table_1_wrapper .dataTables_length label,
#table_2_wrapper .dataTables_length label{
  color:rgba(255,255,255,.78) !important;
  font:300 14px/18px Roboto,system-ui,-apple-system,Segoe UI,Arial;
}

#table_1_wrapper .bootstrap-select .btn.dropdown-toggle,
#table_2_wrapper .bootstrap-select .btn.dropdown-toggle{
  background:var(--card) !important;
  color:#fff !important;
  border:1px solid var(--border) !important;
  border-radius:12px !important;
  box-shadow:none !important;
  padding:8px 12px !important;
}
#table_1_wrapper .bootstrap-select .filter-option-inner-inner,
#table_2_wrapper .bootstrap-select .filter-option-inner-inner{ color:#fff !important; }
#table_1_wrapper .bootstrap-select .bs-caret .caret,
#table_2_wrapper .bootstrap-select .bs-caret .caret{ border-top-color:rgba(255,255,255,.75) !important; }

#table_1_wrapper .bootstrap-select .dropdown-menu,
#table_2_wrapper .bootstrap-select .dropdown-menu{
  background:var(--card) !important;
  border:1px solid rgba(255,255,255,.12) !important;
  border-radius:12px !important;
  box-shadow:0 20px 50px rgba(0,0,0,.45) !important;
}
#table_1_wrapper .bootstrap-select .dropdown-menu li a,
#table_2_wrapper .bootstrap-select .dropdown-menu li a{
  color:rgba(255,255,255,.85) !important;
}
#table_1_wrapper .bootstrap-select .dropdown-menu li a:hover,
#table_2_wrapper .bootstrap-select .dropdown-menu li a:hover{
  background:rgba(0,56,255,.18) !important;
  color:#fff !important;
}

#table_1,
#table_2{
  width:100% !important;
  border:none !important;
  border-collapse:collapse !important;
  background:var(--card);
  border-radius:18px;
  overflow:hidden;
  box-shadow:none !important;
}

#table_1 thead th,
#table_2 thead th{
  background:var(--card2) !important;
  color:#fff !important;
  font:500 14px/18px Roboto,system-ui,-apple-system,Segoe UI,Arial;
  letter-spacing:.2px;
  border:none !important;
  padding:14px 16px !important;
}

#table_1 tbody td,
#table_2 tbody td{
  background:transparent !important;
  color:rgba(255,255,255,.85) !important;
  font:300 14px/18px Roboto,system-ui,-apple-system,Segoe UI,Arial;
  border:none !important;
  padding:12px 16px !important;
}

#table_1 tbody tr,
#table_2 tbody tr{
  border-bottom:1px solid rgba(255,255,255,.05) !important;
}

#table_1 tbody tr:nth-child(odd) td,
#table_2 tbody tr:nth-child(odd) td{ background:rgba(255,255,255,.02) !important; }
#table_1 tbody tr:hover td,
#table_2 tbody tr:hover td{ background:var(--hover) !important; }

#table_1 tbody td.numdata,
#table_2 tbody td.numdata{
  color:#fff !important;
  font-weight:500 !important;
}

#table_1 .responsiveExpander,
#table_2 .responsiveExpander{
  filter:brightness(0) invert(1) !important;
  opacity:.85;
}

#table_1_wrapper .dataTables_paginate .paginate_button,
#table_2_wrapper .dataTables_paginate .paginate_button{
  background:var(--card) !important;
  color:#fff !important;
  border:1px solid rgba(255,255,255,.10) !important;
  border-radius:10px !important;
  padding:6px 10px !important;
  margin-left:6px !important;
}
#table_1_wrapper .dataTables_paginate .paginate_button:hover,
#table_2_wrapper .dataTables_paginate .paginate_button:hover{
  background:#0F1E4A !important;
  border-color:rgba(255,255,255,.18) !important;
}
#table_1_wrapper .dataTables_paginate .paginate_button.current,
#table_2_wrapper .dataTables_paginate .paginate_button.current{
  border-color:#fff !important;
  box-shadow:0 0 0 1px rgba(255,255,255,.55);
}

@media (max-width:767px){
  .messages-head,
  .message-card__top{
    flex-direction:column;
    align-items:stretch;
  }

  .message-card__badges,
  .messages-head__actions{
    justify-content:flex-start;
  }

  #table_1_wrapper .dt-buttons .dt-button,
  #table_2_wrapper .dt-buttons .dt-button{
    padding:7px 10px !important;
    font-size:12px !important;
  }

  #table_1 thead th,
  #table_2 thead th,
  #table_1 tbody td,
  #table_2 tbody td{
    padding:10px 12px !important;
    font-size:12px !important;
  }
  
/* ===== iPhone PWA install hint ===== */
.ortea-ios-install-hint{
  position: fixed;
  left: 12px;
  right: 12px;
  bottom: calc(12px + env(safe-area-inset-bottom, 0px));
  z-index: 9999;
  background: rgba(11, 23, 57, .96);
  border: 1px solid rgba(255,255,255,.14);
  border-radius: 16px;
  box-shadow: 0 16px 40px rgba(0,0,0,.28);
  padding: 14px 14px 12px;
  color: #fff;
  backdrop-filter: blur(8px);
}

.ortea-ios-install-hint__title{
  font: 600 15px/1.2 Roboto, system-ui, -apple-system, "Segoe UI", Arial, sans-serif;
  margin-bottom: 8px;
}

.ortea-ios-install-hint__text{
  font: 400 13px/1.45 Roboto, system-ui, -apple-system, "Segoe UI", Arial, sans-serif;
  color: rgba(255,255,255,.88);
  margin-bottom: 12px;
}

.ortea-ios-install-hint__close{
  width: 100%;
  border: 1px solid rgba(255,255,255,.14);
  background: #0F245D;
  color: #fff;
  border-radius: 12px;
  padding: 10px 12px;
  font: 500 14px/1 Roboto, system-ui, -apple-system, "Segoe UI", Arial, sans-serif;
  cursor: pointer;
}

.ortea-ios-install-hint__close:hover{
  border-color: rgba(255,255,255,.22);
}

@media (min-width: 768px){
  .ortea-ios-install-hint{
    max-width: 360px;
    right: auto;
  }
}  
}

/* ===== Header menu must be above Leaflet controls ===== */
.ortea-user-menu{
  position: relative;
  z-index: 5000;
}

.ortea-user-menu__trigger{
  position: relative;
  z-index: 5001;
}

.ortea-user-menu__dropdown{
  position: absolute;
  z-index: 5002;
}

/* Leaflet controls lower than profile dropdown */
.leaflet-top,
.leaflet-bottom,
.leaflet-control,
.leaflet-pane,
.leaflet-container{
  z-index: 1000;
}

.leaflet-control-zoom{
  z-index: 1001;
}

/* iOS install hint */

.ortea-ios-install-hint{
  position: fixed;
  left:0;
  right:0;
  bottom:0;
  display:flex;
  justify-content:center;
  padding:16px;
  z-index:9000;
}

.ortea-ios-install-hint.hidden{
  display:none;
}

.ortea-ios-install-hint__card{
  background:#0B1739;
  border:1px solid rgba(255,255,255,.12);
  border-radius:16px;
  padding:16px;
  max-width:320px;
  color:#fff;
  box-shadow:0 16px 40px rgba(0,0,0,.35);
}

.ortea-ios-install-hint__title{
  font-weight:600;
  margin-bottom:8px;
}

.ortea-ios-install-hint__text{
  font-size:14px;
  margin-bottom:12px;
}

.ortea-ios-install-hint__btn{
  width:100%;
  background:#0F245D;
  border:1px solid rgba(255,255,255,.15);
  border-radius:12px;
  color:#fff;
  padding:10px;
  cursor:pointer;
}

/* =========================
   ORTEA custom current table
   ========================= */
.ortea-custom-table-wrap{
  margin-top:18px;
  background:var(--card, #0B1739);
  border:1px solid rgba(255,255,255,.12);
  border-radius:22px;
  box-shadow:0 16px 40px rgba(0,0,0,.22);
  overflow:hidden;
}

.ortea-custom-table-head{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  padding:18px 20px 14px;
  border-bottom:1px solid rgba(255,255,255,.08);
}

.ortea-custom-table-title{
  color:#fff;
  font:400 clamp(18px,1.4vw,24px)/1.2 Roboto, system-ui, sans-serif;
}

.ortea-custom-table-actions{
  display:flex;
  flex-wrap:wrap;
  gap:8px;
}

.ortea-export-btn{
  appearance:none;
  border:1px solid rgba(255,255,255,.14);
  background:#08183A;
  color:#fff;
  border-radius:12px;
  padding:10px 14px;
  font:500 14px/1 Roboto, system-ui, sans-serif;
  cursor:pointer;
  transition:.18s ease;
}

.ortea-export-btn:hover{
  border-color:rgba(255,255,255,.28);
  transform:translateY(-1px);
}

.ortea-custom-table-scroll{
  width:100%;
  overflow:auto;
  padding:0 12px 14px;
  box-sizing:border-box;
}

.ortea-custom-table{
  width:100%;
  border-collapse:collapse;
  min-width:0;
  table-layout:fixed;
}

.ortea-custom-table th,
.ortea-custom-table td{
  padding:12px 8px;
  border-bottom:1px solid rgba(255,255,255,.08);
  color:#fff;
  font:400 13px/1.3 Roboto, system-ui, sans-serif;
  box-sizing:border-box;
}

.ortea-custom-table th{
  background:#08183A;
  text-transform:uppercase;
  letter-spacing:.6px;
  color:rgba(255,255,255,.72);
  font-size:12px;
}

.ortea-custom-table td:not(:first-child),
.ortea-custom-table th:not(:first-child){
  text-align:center;
  width:22%;
}

.ortea-custom-table tbody tr:hover{
  background:rgba(255,255,255,.04);
}

.ortea-custom-label{
  white-space:normal;
  word-break:break-word;
  line-height:1.15;
  font-weight:500;
  display:block;
}

.ortea-custom-empty{
  text-align:center !important;
  color:rgba(255,255,255,.62);
}

.ortea-custom-single{
  text-align:left !important;
  color:#fff;
}

@media (max-width:767px){
  .ortea-custom-table-wrap{
    border-radius:16px;
    margin-top:12px;
  }

  .ortea-custom-table-head{
    flex-direction:column;
    align-items:flex-start;
    padding:14px 14px 12px;
  }

  .ortea-custom-table-scroll{
    padding:0 8px 12px;
  }

  .ortea-custom-table{
    min-width:0;
    table-layout:fixed;
  }

  .ortea-custom-table th,
  .ortea-custom-table td{
    padding:10px 4px;
    font-size:12px;
  }

  .ortea-export-btn{
    padding:9px 12px;
    font-size:13px;
  }
}



/* =========================
   ORTEA custom current table fixes
   ========================= */
.ortea-custom-table-title.ortea-kpi-title{
  margin:0;
}

.ortea-custom-table-head{
  border-bottom:none;
}

.ortea-custom-table th,
.ortea-custom-table td,
.ortea-custom-table thead th,
.ortea-custom-table tbody td{
  border:none !important;
  box-shadow:none !important;
}

.ortea-custom-table tbody tr + tr td{
  border-top:none !important;
}

.ortea-custom-table th{
  background:transparent;
}

.ortea-custom-table tbody tr:hover{
  background:rgba(255,255,255,.03);
}


/* =========================
   ORTEA custom table v2 fixes
   ========================= */
.ortea-custom-table-wrap{
  border:0 !important;
  outline:0 !important;
  box-shadow:0 16px 40px rgba(0,0,0,.22);
}

.ortea-custom-table-scroll{
  padding:0 18px 18px;
}

.ortea-custom-table{
  border:0 !important;
  outline:0 !important;
  box-shadow:none !important;
  border-collapse:separate !important;
  border-spacing:0 !important;
  background:transparent;
}

.ortea-custom-table thead th{
  background:#08183A !important;
  color:rgba(255,255,255,.78) !important;
  border:0 !important;
  box-shadow:none !important;
}

.ortea-custom-table thead th:first-child{
  border-top-left-radius:14px;
  border-bottom-left-radius:14px;
}

.ortea-custom-table thead th:last-child{
  border-top-right-radius:14px;
  border-bottom-right-radius:14px;
}

.ortea-custom-table tbody td{
  border:0 !important;
  outline:0 !important;
  box-shadow:none !important;
  background:transparent !important;
}

.ortea-custom-table tbody tr{
  border:0 !important;
}

.ortea-custom-table tbody tr:hover td{
  background:rgba(255,255,255,.03) !important;
}

@media (max-width:767px){
  .ortea-custom-table-scroll{
    padding:0 14px 14px;
  }
}


/* =========================
   ORTEA alignment + mobile width fixes
   ========================= */
.ortea-custom-table-head{
  padding:18px 20px 12px;
}

.ortea-custom-table-title,
.ortea-custom-table-head .ortea-kpi-title{
  margin:0;
  text-align:left;
}

.ortea-custom-table th:first-child,
.ortea-custom-table td:first-child,
.ortea-custom-table thead th:first-child,
.ortea-custom-table tbody td:first-child{
  width:34%;
  min-width:104px;
  max-width:132px;
  text-align:left !important;
  padding-left:0 !important;
}

.ortea-custom-table thead th:not(:first-child),
.ortea-custom-table tbody td:not(:first-child){
  width:22%;
}

@media (max-width:767px){
  .ortea-custom-table-head{
    padding:14px 12px 10px;
  }

  .ortea-custom-table th:first-child,
  .ortea-custom-table td:first-child,
  .ortea-custom-table thead th:first-child,
  .ortea-custom-table tbody td:first-child{
    width:38%;
    min-width:96px;
    max-width:116px;
  }

  .ortea-custom-table thead th:not(:first-child),
  .ortea-custom-table tbody td:not(:first-child){
    width:20.666%;
  }

  .ortea-custom-label{
    max-width:100%;
  }
}
/* =========================
   HISTORY JS TABLE — align to "Онлайн"
   Только для вкладки "Графики"
   ========================= */

#ortea-history-custom-wrap{
  margin-top: 14px;
  padding: 18px 20px 22px;
  border-radius: 22px;
  background: var(--card, #0B1739);
  border: 1px solid rgba(255,255,255,.08);
  box-shadow: 0 16px 40px rgba(0,0,0,.22);
}

#ortea-history-custom-wrap .ortea-custom-table-head{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:14px;
  margin-bottom: 12px;
}

#ortea-history-custom-wrap .ortea-custom-table-title{
  margin:0;
  color:#fff;
  font: 700 clamp(18px,1.4vw,22px)/1.2 Roboto, system-ui, -apple-system, "Segoe UI", Arial, sans-serif;
}

#ortea-history-custom-wrap .ortea-custom-table-actions{
  display:flex;
  align-items:center;
  gap:10px;
  flex-wrap:wrap;
}

#ortea-history-custom-wrap .ortea-export-btn{
  appearance:none;
  border:1px solid rgba(255,255,255,.12);
  background: transparent;
  color:#fff;
  min-height: 40px;
  padding: 0 16px;
  border-radius: 12px;
  font: 600 14px/1 Roboto, system-ui, -apple-system, "Segoe UI", Arial, sans-serif;
  cursor:pointer;
  transition: border-color .18s ease, background .18s ease, transform .18s ease;
}

#ortea-history-custom-wrap .ortea-export-btn:hover{
  border-color: rgba(255,255,255,.22);
  background: rgba(255,255,255,.04);
}

#ortea-history-custom-wrap .ortea-export-btn:active{
  transform: translateY(1px);
}

#ortea-history-custom-wrap .ortea-custom-table-scroll{
  overflow-x:auto;
  overflow-y:hidden;
  -webkit-overflow-scrolling: touch;
}

#ortea-history-custom-wrap .ortea-custom-table{
  width:100%;
  border-collapse:separate;
  border-spacing:0;
  min-width: 100%;
}

#ortea-history-custom-wrap .ortea-custom-table thead th{
  padding: 12px 18px 10px;
  text-align:left;
  color: rgba(255,255,255,.92);
  font: 500 12px/1.2 Roboto, system-ui, -apple-system, "Segoe UI", Arial, sans-serif;
  letter-spacing: .7px;
  text-transform: uppercase;
  white-space: nowrap;
}

#ortea-history-custom-wrap .ortea-custom-table tbody td{
  padding: 14px 18px;
  color:#fff;
  font: 600 14px/1.3 Roboto, system-ui, -apple-system, "Segoe UI", Arial, sans-serif;
  vertical-align:top;
  white-space: nowrap;
  border:0;
}

#ortea-history-custom-wrap .ortea-custom-table tbody tr + tr td{
  border-top: 1px solid rgba(255,255,255,.04);
}

#ortea-history-custom-wrap .ortea-custom-table tbody tr:hover td{
  background: rgba(255,255,255,.02);
}

#ortea-history-custom-wrap .ortea-custom-table .ortea-custom-label{
  color:#fff;
  font-weight:600;
}

#ortea-history-custom-wrap .ortea-custom-empty{
  color: rgba(255,255,255,.66);
  text-align:left;
}

@media (max-width: 767px){
  #ortea-history-custom-wrap{
    padding: 14px 12px 16px;
    border-radius: 16px;
  }

  #ortea-history-custom-wrap .ortea-custom-table-head{
    align-items:flex-start;
    flex-direction:column;
    gap:10px;
    margin-bottom: 10px;
  }

  #ortea-history-custom-wrap .ortea-custom-table-actions{
    width:100%;
    gap:8px;
  }

  #ortea-history-custom-wrap .ortea-export-btn{
    min-height: 36px;
    padding: 0 12px;
    border-radius: 10px;
    font-size: 13px;
  }

  #ortea-history-custom-wrap .ortea-custom-table thead th{
    padding: 10px 12px 8px;
    font-size: 11px;
  }

  #ortea-history-custom-wrap .ortea-custom-table tbody td{
    padding: 12px;
    font-size: 13px;
  }
}