:root {
  --ros-gsm-bg: #f3f6fb;
  --ros-gsm-surface: #ffffff;
  --ros-gsm-border: #d8e0ec;
  --ros-gsm-shadow: 0 24px 64px rgba(15, 23, 42, 0.2);
  --ros-gsm-text: #0f172a;
  --ros-gsm-muted: #5b6472;
  --ros-gsm-accent: #1865f2;
  --ros-gsm-accent-2: #0ea5a6;
  --ros-gsm-success-bg: #e9f9ef;
  --ros-gsm-success-text: #116149;
}

#ros-gsm-btn {
  position: fixed;
  top: 18px;
  right: 22px;
  z-index: 8000;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 1px solid #1d4ed8;
  border-radius: 999px;
  padding: 8px 16px;
  background: linear-gradient(135deg, #2f76ec, #1d4ed8);
  color: #fff;
  font: 700 13px/1.2 "Segoe UI", "Helvetica Neue", Arial, sans-serif;
  letter-spacing: 0.01em;
  box-shadow: 0 10px 26px rgba(29, 78, 216, 0.38);
  transition: transform 120ms ease, box-shadow 120ms ease;
}

#ros-gsm-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 14px 30px rgba(29, 78, 216, 0.42);
}

#ros-gsm-btn .dashicons {
  font-size: 16px;
  width: 16px;
  height: 16px;
}

#ros-gsm-panel {
  position: fixed;
  top: 72px;
  right: 24px;
  z-index: 99999;
  width: min(1080px, calc(100vw - 48px));
  max-height: calc(100vh - 96px);
  overflow: auto;
  padding: 26px;
  border-radius: 20px;
  border: 1px solid var(--ros-gsm-border);
  background: radial-gradient(circle at 8% 2%, #fbfcff, var(--ros-gsm-bg) 60%);
  box-shadow: var(--ros-gsm-shadow);
  color: var(--ros-gsm-text);
  font: 500 14px/1.38 "Segoe UI", "Helvetica Neue", Arial, sans-serif;
}

#ros-gsm-panel h3 {
  margin: 0 0 18px;
  font-size: 38px;
  line-height: 1.05;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: #0b1220;
}

#ros-gsm-panel .ros-gsm-col-wrap {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
  align-items: stretch;
}

#ros-gsm-panel .ros-gsm-col {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

#ros-gsm-panel .ros-gsm-col strong {
  font-size: 24px;
  line-height: 1.05;
  font-weight: 800;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: #252d3c;
}

#ros-gsm-panel select,
#ros-model-filter,
#ros-gsm-modal select,
#ros-gsm-modal input[type="search"] {
  width: 100%;
  border-radius: 13px;
  border: 1px solid #c8d2e2;
  background: #fff;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.85);
  color: var(--ros-gsm-text);
  transition: border-color 120ms ease, box-shadow 120ms ease;
}

#ros-gsm-panel select,
#ros-gsm-modal select {
  min-height: 320px;
  padding: 10px 12px;
  font-size: 14px;
  line-height: 1.36;
}

#ros-model-filter,
#ros-gsm-modal input[type="search"] {
  min-height: 48px;
  padding: 10px 14px;
  font-size: 14px;
  margin-bottom: 8px;
}

#ros-gsm-panel select:focus,
#ros-model-filter:focus,
#ros-gsm-modal select:focus,
#ros-gsm-modal input[type="search"]:focus {
  outline: none;
  border-color: #82adff;
  box-shadow: 0 0 0 3px rgba(24, 101, 242, 0.18);
}

#ros-gsm-models option,
#ros-gsm-imported option,
#ros-gsm-brands option {
  padding: 4px 7px;
}

#ros-gsm-models option[data-imported="1"] {
  background: var(--ros-gsm-success-bg);
  color: var(--ros-gsm-success-text);
  font-weight: 700;
}

#ros-gsm-models option[data-imported="1"]:checked {
  background: #16a34a;
  color: #fff;
}

#ros-gsm-imported option[data-imported="1"] {
  background: #eefbf3;
  color: #0f5132;
  font-weight: 700;
}

#ros-gsm-imported option[data-imported="1"]:checked {
  background: #16a34a;
  color: #fff;
}

#ros-gsm-imported {
  min-height: 220px;
}

#ros-gsm-panel .ros-gsm-actions,
#ros-gsm-modal .ros-gsm-actions {
  margin-top: 14px;
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
}

#ros-gsm-panel .ros-gsm-actions-toolbar,
#ros-gsm-modal .ros-gsm-actions-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

#ros-gsm-panel .ros-gsm-actions-toolbar .button,
#ros-gsm-modal .ros-gsm-actions-toolbar .button {
  min-height: 38px;
  padding: 8px 14px;
  border-radius: 11px;
  border: 0;
  font: 700 14px/1.2 "Segoe UI", "Helvetica Neue", Arial, sans-serif;
  letter-spacing: 0.01em;
  transition: transform 110ms ease, box-shadow 110ms ease, filter 110ms ease;
}

#ros-gsm-start {
  background: linear-gradient(135deg, #2f76ec, #1d4ed8);
  color: #fff;
}

#ros-gsm-stop {
  background: #ffe7a8;
  color: #6d5400;
}

#ros-gsm-clear {
  background: #ff5f3d;
  color: #fff;
}

#ros-gsm-del {
  background: #4f5d70;
  color: #fff;
}

#ros-gsm-panel .ros-gsm-actions-toolbar .button:hover:not(:disabled),
#ros-gsm-modal .ros-gsm-actions-toolbar .button:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 10px 18px rgba(15, 23, 42, 0.18);
}

#ros-gsm-panel .ros-gsm-actions-toolbar .button:disabled,
#ros-gsm-modal .ros-gsm-actions-toolbar .button:disabled {
  opacity: 0.46;
  cursor: not-allowed;
  box-shadow: none;
  transform: none;
}

#ros-gsm-panel .ros-gsm-progress-card,
#ros-gsm-modal .ros-gsm-progress-card {
  border: 1px solid #d8e1ee;
  border-radius: 13px;
  padding: 12px;
  background: linear-gradient(180deg, #f8fbff, #f1f5fb);
}

#ros-gsm-panel .ros-gsm-progress-head,
#ros-gsm-modal .ros-gsm-progress-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 8px;
}

#ros-gsm-status {
  margin: 0;
  color: #2f3a49;
  font-size: 13px;
  font-style: normal;
  font-weight: 700;
}

#ros-gsm-percent {
  margin: 0;
  color: #0f766e;
  font-size: 18px;
  font-weight: 800;
}

#ros-gsm-progress {
  width: 100%;
  height: 14px;
  -webkit-appearance: none;
  appearance: none;
  overflow: hidden;
  border: 0;
  border-radius: 999px;
  background: #dde4ee;
}

#ros-gsm-progress::-webkit-progress-bar {
  background: #dde4ee;
}

#ros-gsm-progress::-webkit-progress-value,
#ros-gsm-progress::-moz-progress-bar {
  background: linear-gradient(90deg, var(--ros-gsm-accent), var(--ros-gsm-accent-2));
  transition: width 120ms ease;
}

#ros-gsm-progress-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 8px;
}

#ros-gsm-progress-meta > span {
  border-radius: 999px;
  padding: 3px 10px;
  font-size: 12px;
  font-weight: 700;
  color: #344256;
  background: #e2e8f2;
  border: 1px solid #cfd8e6;
}

#ros-gsm-progress-detail {
  margin-top: 6px;
  min-height: 18px;
  color: #5c6779;
  font-size: 12px;
}

#ros-gsm-panel.loading #ros-gsm-models {
  opacity: 0.45;
}

#ros-gsm-models.fade-in option {
  animation: rosGsmFade 180ms ease;
}

@keyframes rosGsmFade {
  from { opacity: 0.3; }
  to { opacity: 1; }
}

@media (max-width: 1200px) {
  #ros-gsm-panel {
    width: min(960px, calc(100vw - 30px));
    padding: 18px;
    top: 64px;
    right: 15px;
    max-height: calc(100vh - 80px);
  }

  #ros-gsm-panel h3 {
    font-size: 30px;
  }

  #ros-gsm-panel .ros-gsm-col strong {
    font-size: 20px;
  }

  #ros-gsm-panel select,
  #ros-gsm-modal select {
    font-size: 14px;
    min-height: 230px;
  }

  #ros-model-filter,
  #ros-gsm-modal input[type="search"] {
    font-size: 14px;
    min-height: 44px;
  }
}

@media (max-width: 980px) {
  #ros-gsm-panel {
    inset: 8px;
    width: auto;
    max-height: none;
  }

  #ros-gsm-panel .ros-gsm-col-wrap {
    grid-template-columns: 1fr;
  }

  #ros-gsm-panel h3 {
    font-size: 24px;
  }

  #ros-gsm-panel .ros-gsm-col strong {
    font-size: 18px;
  }

  #ros-gsm-panel select,
  #ros-gsm-modal select {
    font-size: 14px;
  }

  #ros-model-filter,
  #ros-gsm-modal input[type="search"] {
    font-size: 14px;
  }
}

/* Frontend: gleiche Modal-Optik wie Backend */
#ros-gsm-front-overlay {
  position: fixed;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  background: rgba(15, 23, 42, 0.58);
  z-index: 2147483647;
  backdrop-filter: saturate(120%) blur(2px);
}

#ros-gsm-front-overlay.is-open {
  display: flex;
}

#ros-gsm-front-modal {
  position: relative;
  isolation: isolate;
  width: min(1400px, 96vw);
  max-height: 92vh;
  border-radius: 14px;
  overflow: hidden;
  border: 1px solid #ced8e8;
  background: linear-gradient(180deg, #f8faff 0%, #edf2fa 100%);
  box-shadow: 0 30px 120px rgba(0, 0, 0, 0.45);
  display: flex;
  flex-direction: column;
}

#ros-gsm-front-modal .ros-gsm-header {
  position: sticky;
  top: 0;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px;
  border-bottom: 1px solid #334155;
  background: linear-gradient(120deg, #0f172a 0%, #1e293b 100%);
}

#ros-gsm-front-modal .ros-gsm-header h2 {
  margin: 0;
  color: #f8fafc;
  font-size: 17px;
  font-weight: 800;
  letter-spacing: 0.01em;
}

#ros-gsm-front-modal .button-close {
  border: 1px solid #cbd5e1;
  border-radius: 10px;
  min-height: 34px;
  padding: 0 12px;
  background: #f8fafc;
  color: #0f172a;
  font-weight: 700;
  cursor: pointer;
}

#ros-gsm-front-modal .ros-gsm-body {
  padding: 14px 16px;
  overflow: auto;
}

#ros-gsm-front-modal #ros-gsm-panel {
  position: static !important;
  top: auto !important;
  right: auto !important;
  width: auto !important;
  max-height: none !important;
  padding: 0 !important;
  border: 0 !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  background: transparent !important;
}

#ros-gsm-front-modal #ros-gsm-panel > h3 {
  display: none !important;
}

#ros-gsm-front-modal #ros-gsm-panel .ros-gsm-grid {
  display: grid !important;
  grid-template-columns: 1.1fr 1.8fr 1.1fr !important;
  gap: 14px !important;
  align-items: start !important;
}

#ros-gsm-front-modal #ros-gsm-panel .ros-gsm-col {
  display: flex !important;
  flex-direction: column !important;
  gap: 8px !important;
  background: #fff !important;
  border: 1px solid #d7e0ec !important;
  border-radius: 12px !important;
  padding: 10px !important;
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.04) !important;
}

#ros-gsm-front-modal #ros-gsm-panel .ros-gsm-col > label {
  margin: 0 !important;
  text-transform: uppercase !important;
  letter-spacing: 0.03em !important;
  font-size: 12px !important;
  font-weight: 800 !important;
  color: #334155 !important;
}

#ros-gsm-front-modal #ros-gsm-panel select,
#ros-gsm-front-modal #ros-gsm-panel input[type="text"],
#ros-gsm-front-modal #ros-gsm-panel input[type="search"] {
  width: 100% !important;
  border: 1px solid #c8d2e2 !important;
  border-radius: 11px !important;
  background: #fff !important;
  font-size: 14px !important;
  transition: border-color 120ms ease, box-shadow 120ms ease !important;
}

#ros-gsm-front-modal #ros-gsm-panel select {
  min-height: 340px !important;
  padding: 8px 10px !important;
}

#ros-gsm-front-modal #ros-gsm-panel input[type="text"],
#ros-gsm-front-modal #ros-gsm-panel input[type="search"] {
  min-height: auto !important;
  margin-bottom: 0 !important;
  padding: 10px 12px !important;
}

#ros-gsm-front-modal #ros-gsm-panel select:focus,
#ros-gsm-front-modal #ros-gsm-panel input[type="text"]:focus,
#ros-gsm-front-modal #ros-gsm-panel input[type="search"]:focus {
  border-color: #7aa2ff !important;
  box-shadow: 0 0 0 3px rgba(24, 101, 242, 0.16) !important;
}

#ros-gsm-front-modal #ros-gsm-panel .ros-gsm-actions {
  position: sticky !important;
  bottom: 0 !important;
  z-index: 2 !important;
  margin-top: 12px !important;
  background: linear-gradient(180deg, rgba(248, 250, 255, 0), #edf2fa 36%) !important;
}

#ros-gsm-front-modal #ros-gsm-models option[data-imported="1"] {
  color: #116149 !important;
  font-weight: 700 !important;
  background: #e9f9ef !important;
}

#ros-gsm-front-modal #ros-gsm-imported option[data-imported="1"] {
  color: #0f5132 !important;
  font-weight: 700 !important;
  background: #eefbf3 !important;
}

body.ros-gsm-open-front {
  overflow: hidden;
}

@media (max-width: 980px) {
  #ros-gsm-front-modal {
    width: 100vw;
    height: 100vh;
    max-height: none;
    border-radius: 0;
  }

  #ros-gsm-front-modal #ros-gsm-panel .ros-gsm-grid {
    grid-template-columns: 1fr !important;
  }

  #ros-gsm-front-modal #ros-gsm-panel select {
    min-height: 220px !important;
  }
}
