:root {
  --desktop-bg: linear-gradient(150deg, #12588c 0%, #2480bd 34%, #55b4df 68%, #9be0d6 100%);
  --glass-top: linear-gradient(
    180deg,
    rgba(255, 255, 255, 0.62) 0%,
    rgba(218, 240, 255, 0.42) 48%,
    rgba(162, 212, 246, 0.46) 50%,
    rgba(196, 232, 253, 0.56) 100%
  );
  --glass-border-outer: rgba(24, 78, 126, 0.62);
  --glass-border-inner: rgba(255, 255, 255, 0.78);
  --window-shadow: 0 12px 34px rgba(8, 42, 74, 0.36), 0 2px 6px rgba(8, 42, 74, 0.2);

  --panel: #f4f8fc;
  --surface: #ffffff;
  --border: #b8cde2;
  --border-strong: #8aa7c4;

  --text: #13283d;
  --text-secondary: #395570;
  --text-muted: #5d7892;

  --focus-glow: rgba(60, 164, 236, 0.48);

  --radius-sm: 3px;
  --font: "Segoe UI", Frutiger, "Frutiger Linotype", Calibri, -apple-system, BlinkMacSystemFont, sans-serif;
  --mono: Consolas, "Cascadia Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

.is-hidden {
  display: none !important;
}

.mono {
  font-family: var(--mono);
  font-variant-numeric: tabular-nums;
}

.aero-frame {
  border-radius: 7px;
  padding: 7px;
  background: var(--glass-top);
  backdrop-filter: blur(14px) saturate(145%);
  -webkit-backdrop-filter: blur(14px) saturate(145%);
  border: 1px solid var(--glass-border-outer);
  box-shadow:
    inset 0 1px 0 var(--glass-border-inner),
    inset 0 0 0 1px rgba(255, 255, 255, 0.35),
    var(--window-shadow);
}

.window-body {
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: 4px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.9);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 5px 12px;
  border-radius: var(--radius-sm);
  border: 1px solid #7f9db9;
  background: linear-gradient(180deg, #f8fbfe 0%, #e8f1fa 49%, #d5e4f3 50%, #e7f2fc 100%);
  color: #132c45;
  font-family: var(--font);
  font-size: 12.5px;
  font-weight: 600;
  line-height: 1.3;
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.85);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.88), 0 1px 2px rgba(15, 52, 84, 0.08);
  cursor: pointer;
  white-space: nowrap;
  user-select: none;
}

.btn:hover:not(:disabled) {
  border-color: #4f88ba;
  background: linear-gradient(180deg, #ffffff 0%, #eaf5ff 49%, #d4e9fb 50%, #e6f4ff 100%);
}

.btn:active:not(:disabled) {
  border-color: #1a5c94;
  background: linear-gradient(180deg, #74c4f7 0%, #3ba0e4 49%, #1a7ec9 50%, #2a97e4 100%);
  color: #ffffff;
  text-shadow: 0 -1px 0 rgba(10, 52, 92, 0.45);
}

.btn-primary {
  border-color: #1a5c94;
  background: linear-gradient(180deg, #74c4f7 0%, #3ba0e4 49%, #1a7ec9 50%, #2a97e4 100%);
  color: #ffffff;
  text-shadow: 0 -1px 0 rgba(10, 52, 92, 0.45);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.55), 0 1px 2px rgba(10, 52, 92, 0.22);
}

.btn-primary:hover:not(:disabled) {
  border-color: #144d7e;
  background: linear-gradient(180deg, #88cff9 0%, #4badea 49%, #238ad4 50%, #38a3ec 100%);
}

.btn-primary:active:not(:disabled) {
  border-color: #12436e;
  background: linear-gradient(180deg, #56b0ee 0%, #2788cf 49%, #136cb2 50%, #2183cc 100%);
  color: #ffffff;
}

.btn-success {
  border-color: #167234;
  background: linear-gradient(180deg, #6de28e 0%, #31ba5a 49%, #1a9740 50%, #33c15d 100%);
  color: #ffffff;
  text-shadow: 0 -1px 0 rgba(10, 62, 28, 0.48);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.52), 0 1px 2px rgba(10, 62, 28, 0.22);
}

.btn-success:hover:not(:disabled) {
  border-color: #115d2a;
  background: linear-gradient(180deg, #7fea9d 0%, #3ec767 49%, #22a54a 50%, #3fcf6a 100%);
}

.btn-success:active:not(:disabled) {
  border-color: #0e4f23;
  background: linear-gradient(180deg, #53cf76 0%, #24a24b 49%, #138034 50%, #24a84c 100%);
  color: #ffffff;
}

.btn-warn {
  border-color: #a86414;
  background: linear-gradient(180deg, #ffe89c 0%, #f7be4a 49%, #df951b 50%, #f3b53b 100%);
  color: #422100;
  text-shadow: 0 1px 0 rgba(255, 246, 214, 0.72);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.72), 0 1px 2px rgba(100, 56, 8, 0.16);
}

.btn-warn:hover:not(:disabled) {
  border-color: #8f530e;
  background: linear-gradient(180deg, #fff0b8 0%, #facc66 49%, #e8a22c 50%, #f7c355 100%);
}

.btn-warn:active:not(:disabled) {
  border-color: #7c460a;
  background: linear-gradient(180deg, #f6d57a 0%, #e5a933 49%, #ca8010 50%, #df9d25 100%);
  color: #422100;
}

.btn-danger {
  border-color: #b86666;
  background: linear-gradient(180deg, #fef5f5 0%, #f8dada 49%, #f1c0c0 50%, #f7dada 100%);
  color: #7d1e1e;
  text-shadow: none;
}

.btn-danger:hover:not(:disabled) {
  border-color: #a14b4b;
  background: linear-gradient(180deg, #fffafa 0%, #fce4e4 49%, #f5cbcb 50%, #fae2e2 100%);
}

.btn-danger:active:not(:disabled) {
  border-color: #8c3b3b;
  background: linear-gradient(180deg, #f3cccc 0%, #ebb4b4 49%, #df9b9b 50%, #e9b2b2 100%);
  color: #6b1515;
  text-shadow: none;
}

.btn-sm {
  padding: 3px 8px;
  font-size: 11.5px;
}

.btn:disabled,
.seg-btn:disabled,
.tab-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

input[type="text"],
input[type="password"],
input[type="number"],
input[type="url"],
select {
  font-family: var(--font);
  font-size: 12.5px;
  color: var(--text);
  background: #ffffff;
  border: 1px solid #96b0ca;
  border-top-color: #7c99b8;
  border-radius: var(--radius-sm);
  padding: 5px 8px;
  box-shadow: inset 0 1px 2px rgba(24, 66, 108, 0.09);
  outline: none;
}

input[type="text"]:focus,
input[type="password"]:focus,
input[type="number"]:focus,
input[type="url"]:focus,
select:focus {
  border-color: #2f8dd6;
  box-shadow: inset 0 1px 2px rgba(24, 66, 108, 0.08), 0 0 0 2px var(--focus-glow);
}

.btn:focus-visible,
.seg-btn:focus-visible,
.tab-btn:focus-visible,
.switch:focus-visible,
input[type="range"]:focus-visible {
  outline: 2px solid var(--focus-glow);
  outline-offset: 1px;
}

input[type="range"] {
  -webkit-appearance: none;
  appearance: none;
  height: 4px;
  border-radius: 2px;
  background: linear-gradient(180deg, #c6d7e8 0%, #e7f0f8 100%);
  border: 1px solid #9db4ca;
  cursor: pointer;
}

input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 12px;
  height: 16px;
  border-radius: 2px;
  border: 1px solid #4c7ba6;
  background: linear-gradient(180deg, #f8fbfe 0%, #dcebf8 49%, #c1dbf2 50%, #dfeefc 100%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.9), 0 1px 2px rgba(15, 52, 84, 0.25);
  margin-top: -1px;
}

.switch {
  -webkit-appearance: none;
  appearance: none;
  position: relative;
  width: 34px;
  height: 18px;
  border-radius: 9px;
  border: 1px solid #7f9db9;
  background: linear-gradient(180deg, #cbd9e6 0%, #e4edf6 100%);
  box-shadow: inset 0 1px 2px rgba(15, 52, 84, 0.2);
  cursor: pointer;
  flex-shrink: 0;
  transition: background 0.15s ease, border-color 0.15s ease;
}

.switch::after {
  content: "";
  position: absolute;
  top: 1px;
  left: 1px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 1px solid #7f9db9;
  background: linear-gradient(180deg, #ffffff 0%, #e6eff8 100%);
  box-shadow: 0 1px 2px rgba(15, 52, 84, 0.3);
  transition: transform 0.15s ease;
}

.switch:checked {
  border-color: #167234;
  background: linear-gradient(180deg, #6de28e 0%, #31ba5a 49%, #1a9740 50%, #33c15d 100%);
}

.switch:checked::after {
  transform: translateX(16px);
  border-color: #14642d;
}

.seg-group {
  display: inline-flex;
  border-radius: var(--radius-sm);
  overflow: hidden;
  border: 1px solid #7f9db9;
}

.seg-btn {
  padding: 4px 10px;
  border: none;
  border-right: 1px solid #8eaac4;
  background: linear-gradient(180deg, #f8fbfe 0%, #e8f1fa 49%, #d5e4f3 50%, #e7f2fc 100%);
  color: #132c45;
  font-family: var(--font);
  font-size: 12px;
  font-weight: 600;
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.85);
  cursor: pointer;
}

.seg-btn:last-child {
  border-right: none;
}

.seg-btn.is-active,
.seg-btn.is-active:hover:not(:disabled),
.seg-btn.is-active:active:not(:disabled) {
  background: linear-gradient(180deg, #74c4f7 0%, #3ba0e4 49%, #1a7ec9 50%, #2a97e4 100%);
  color: #ffffff;
  text-shadow: 0 -1px 0 rgba(10, 52, 92, 0.45);
}

.badge {
  display: inline-flex;
  align-items: center;
  padding: 1px 6px;
  border-radius: var(--radius-sm);
  font-size: 11px;
  font-weight: 600;
  border: 1px solid #7f9db9;
  background: linear-gradient(180deg, #f8fbfe 0%, #e8f1fa 49%, #d5e4f3 50%, #e7f2fc 100%);
  color: #2b4a68;
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.85);
}

.badge-live {
  border-color: #1a5c94;
  background: linear-gradient(180deg, #74c4f7 0%, #3ba0e4 49%, #1a7ec9 50%, #2a97e4 100%);
  color: #ffffff;
  text-shadow: 0 -1px 0 rgba(10, 52, 92, 0.45);
}

.badge-ok {
  border-color: #167234;
  background: linear-gradient(180deg, #6de28e 0%, #31ba5a 49%, #1a9740 50%, #33c15d 100%);
  color: #ffffff;
  text-shadow: 0 -1px 0 rgba(10, 62, 28, 0.48);
}

.badge-warn {
  border-color: #a86414;
  background: linear-gradient(180deg, #ffe89c 0%, #f7be4a 49%, #df951b 50%, #f3b53b 100%);
  color: #422100;
  text-shadow: 0 1px 0 rgba(255, 246, 214, 0.72);
}

.badge-danger {
  border-color: #b86666;
  background: linear-gradient(180deg, #fef5f5 0%, #f8dada 49%, #f1c0c0 50%, #f7dada 100%);
  color: #7d1e1e;
  text-shadow: none;
}

.aero-progress {
  position: relative;
  height: 10px;
  border-radius: var(--radius-sm);
  border: 1px solid #7f9db9;
  background: linear-gradient(180deg, #c8d9e8 0%, #e5eff8 50%, #f1f7fc 100%);
  box-shadow: inset 0 1px 2px rgba(15, 52, 84, 0.2);
  overflow: hidden;
}

.aero-progress-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(180deg, #6de28e 0%, #31ba5a 49%, #1a9740 50%, #33c15d 100%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.65);
  transition: width 0.25s linear;
}
