:root {
  --bg: #0b0c11;
  --surface: #13151d;
  --surface-2: #1a1d27;
  --surface-3: #232733;
  --border: rgba(255, 255, 255, 0.09);
  --border-soft: rgba(255, 255, 255, 0.055);
  --text: #eef0f5;
  --text-dim: #9299ab;
  --text-mute: #606578;
  --periwinkle: #7c9eff;
  --periwinkle-glow: rgba(124, 158, 255, 0.14);
  --mint: #6dceb8;
  --mint-glow: rgba(109, 206, 184, 0.14);
  --coral: #ff8a80;
  --amber: #ffc857;
  --growth: #dbe4ff;
  --radius: 12px;
  --radius-sm: 8px;
  --radius-xs: 6px;
  --shadow: 0 16px 40px rgba(0, 0, 0, 0.42);
  --shadow-soft: 0 2px 10px rgba(0, 0, 0, 0.16);
  --font: "IRANSans", sans-serif;
  --topbar-bg: rgba(11, 12, 17, 0.6);
  --ease: cubic-bezier(0.4, 0, 0.2, 1);
  --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
}

body {
  font-family: var(--font);
  font-size: 14px;
  background:
    radial-gradient(900px 420px at 85% -12%, rgba(124, 158, 255, 0.05), transparent 60%),
    radial-gradient(700px 380px at 10% 110%, rgba(109, 206, 184, 0.035), transparent 60%),
    var(--bg);
  background-attachment: fixed;
  color: var(--text);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

::selection {
  background: rgba(124, 158, 255, 0.32);
}

::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: var(--surface-3);
  border-radius: 999px;
}

::-webkit-scrollbar-thumb:hover {
  background: #2c3140;
}

button,
input,
select,
textarea {
  font-family: var(--font);
}

a {
  color: var(--periwinkle);
  text-decoration: none;
}

.hidden {
  display: none !important;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 8px 14px;
  font-size: 12.5px;
  font-weight: 500;
  line-height: 1.4;
  color: var(--text-dim);
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  cursor: pointer;
  white-space: nowrap;
  transition: color 0.16s var(--ease), background 0.16s var(--ease), border-color 0.16s var(--ease);
}

.btn:hover {
  color: var(--text);
  background: var(--surface-3);
  border-color: rgba(255, 255, 255, 0.14);
}

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

.btn-primary {
  color: #0b0c11;
  background: var(--periwinkle);
  border-color: transparent;
  font-weight: 600;
}

.btn-primary:hover {
  color: #0b0c11;
  background: #8fadff;
  border-color: transparent;
}

.btn-sm {
  padding: 5px 10px;
  font-size: 11.5px;
  border-radius: 7px;
}

.btn-danger {
  color: var(--coral);
  background: transparent;
  border-color: rgba(255, 138, 128, 0.25);
}

.btn-danger:hover {
  color: var(--coral);
  background: rgba(255, 138, 128, 0.08);
  border-color: rgba(255, 138, 128, 0.4);
}

.btn-ai {
  color: var(--periwinkle);
  background: transparent;
  border-color: rgba(124, 158, 255, 0.25);
}

.btn-ai:hover {
  color: var(--periwinkle);
  background: var(--periwinkle-glow);
  border-color: rgba(124, 158, 255, 0.4);
}

.icon-btn {
  width: 30px;
  height: 30px;
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 7px;
  color: var(--text-dim);
  cursor: pointer;
  transition: color 0.16s var(--ease), background 0.16s var(--ease);
}

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

.icon-btn:hover {
  background: var(--surface-2);
  color: var(--text);
}

.icon-btn.danger:hover {
  background: rgba(255, 138, 128, 0.1);
  color: var(--coral);
}

.field {
  min-width: 0;
}

.field label,
.control label {
  display: block;
  font-size: 12px;
  color: var(--text-dim);
  margin-bottom: 6px;
}

.field input,
.field select,
.field textarea,
.control select,
.control input[type="text"],
.jdp-input {
  width: 100%;
  background: var(--surface-2);
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: var(--radius-sm);
  padding: 9px 12px;
  font-size: 13px;
  outline: none;
  transition: border-color 0.16s var(--ease), box-shadow 0.16s var(--ease);
}

.field input:focus,
.field select:focus,
.field textarea:focus,
.control select:focus,
.control input[type="text"]:focus,
.jdp-input:focus {
  border-color: rgba(124, 158, 255, 0.55);
  box-shadow: 0 0 0 3px var(--periwinkle-glow);
}

input::placeholder,
textarea::placeholder {
  color: var(--text-mute);
}

.switch {
  position: relative;
  width: 34px;
  height: 20px;
  flex: 0 0 auto;
  display: inline-block;
  cursor: pointer;
}

.switch input {
  position: absolute;
  inset: 0;
  margin: 0;
  opacity: 0;
  cursor: pointer;
}

.slider {
  position: absolute;
  inset: 0;
  background: var(--surface-3);
  border: 1px solid var(--border);
  border-radius: 999px;
  transition: background 0.18s var(--ease), border-color 0.18s var(--ease);
  pointer-events: none;
}

.slider::before {
  content: "";
  position: absolute;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--text-dim);
  top: 50%;
  transform: translateY(-50%);
  inset-inline-start: 2px;
  transition: inset-inline-start 0.18s var(--ease), background 0.18s var(--ease);
}

.switch input:checked + .slider {
  background: var(--mint);
  border-color: transparent;
}

.switch input:checked + .slider::before {
  inset-inline-start: calc(100% - 16px);
  background: #0b0c11;
}

.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 32px 20px;
  font-size: 13px;
  color: var(--text-mute);
  text-align: center;
  line-height: 2;
}

.empty-state .empty-icon {
  opacity: 0.45;
}

.spinner {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  border: 3px solid var(--border);
  border-top-color: var(--periwinkle);
  animation: spin 0.7s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.toast {
  position: fixed;
  bottom: 26px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 600;
  max-width: min(90vw, 420px);
  padding: 10px 18px;
  font-size: 12.5px;
  line-height: 1.9;
  color: var(--text);
  background: var(--surface-3);
  border: 1px solid var(--border);
  border-radius: 10px;
  box-shadow: var(--shadow);
  animation: toastIn 0.25s var(--ease-spring);
}

@keyframes toastIn {
  from {
    opacity: 0;
    transform: translate(-50%, 12px);
  }

  to {
    opacity: 1;
    transform: translate(-50%, 0);
  }
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}

@keyframes modalIn {
  from {
    opacity: 0;
    transform: translateY(14px) scale(0.98);
  }

  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.form-error {
  margin-top: 12px;
  padding: 9px 12px;
  font-size: 12px;
  line-height: 1.9;
  color: var(--coral);
  background: rgba(255, 138, 128, 0.07);
  border: 1px solid rgba(255, 138, 128, 0.25);
  border-radius: var(--radius-sm);
}

body.platform-bale #windowHours,
body.platform-bale .window-hours-field,
body.platform-bale #openHeatmapBtn {
  display: none !important;
}

.modal-close {
  width: 30px;
  height: 30px;
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 7px;
  color: var(--text-mute);
  font-size: 13px;
  line-height: 1;
  cursor: pointer;
  transition: background 0.14s var(--ease), color 0.14s var(--ease);
}

.modal-close:hover {
  background: var(--surface-2);
  color: var(--text);
}

.icon-btn.logout:hover {
  background: rgba(255, 138, 128, 0.1);
  border-color: rgba(255, 138, 128, 0.25);
  color: var(--coral);
}
