.cookie-widget {
  position: fixed;
  left: 24px;
  bottom: 24px;
  z-index: 1100;
  display: inline-flex;
  align-items: center;
  gap: 0;
  cursor: pointer;
  border: none;
  background: transparent;
  padding: 0;
}

.cookie-widget:hover {
  transform: translateY(-1px);
}

.cookie-widget .cookie-icon {
  width: 48px;
  height: 48px;
  border-radius: 999px;
  background: rgba(32, 46, 84, 0.9);
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #f7f9ff;
  font-size: 18px;
  transition: all 0.3s ease;
}

.cookie-widget .cookie-label {
  height: 48px;
  display: inline-flex;
  align-items: center;
  padding: 0 16px 0 12px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-left: none;
  color: #f3f6ff;
  font-weight: 600;
  font-size: 13px;
  letter-spacing: 0.1px;
  border-radius: 0 999px 999px 0;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  opacity: 0;
  transform: translateX(-8px);
  transition: all 0.3s ease;
}

.cookie-widget:hover .cookie-label {
  opacity: 1;
  transform: translateX(0);
}

.cookie-widget:hover .cookie-icon {
  background: rgba(255, 255, 255, 0.12);
  border-top-right-radius: 0;
  border-bottom-right-radius: 0;
  transform: scale(1.03);
}
.dashboard-layout .cookie-widget:hover .cookie-icon {
  background: rgba(32, 46, 84, 0.9);
  border-color: rgba(255, 255, 255, 0.12);
}
.dashboard-layout .cookie-widget:hover .cookie-label {
  background: rgba(32, 46, 84, 0.9);
  border-color: rgba(255, 255, 255, 0.12);
}

/* Keep positioning sensible when sidebar is collapsed */
body.sidebar-collapsed .cookie-widget {
  left: calc(var(--sidebar-collapsed-width, 72px) + 16px);
}
/* On narrow/mobile, just pin to default left padding */
body.narrow .cookie-widget {
  left: 16px;
}

.cookie-widget:focus {
  outline: none;
  box-shadow: none;
}

.cookie-widget:focus-visible {
  outline: none;
  box-shadow: 0 0 0 2px rgba(77, 163, 255, 0.6);
  border-radius: 999px;
}

/* Dashboard positioning offsets to avoid overlapping the sidebar */
.dashboard-layout .cookie-widget {
  left: calc(var(--sidebar-width, 256px) + 16px);
}
.dashboard-layout.sidebar-collapsed .cookie-widget {
  left: calc(var(--sidebar-collapsed-width, 72px) + 16px);
}
.dashboard-layout.narrow .cookie-widget {
  left: 16px;
}

.cookie-modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(8, 12, 26, 0.65);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 1200;
  padding: 16px;
}

.cookie-modal-backdrop.show {
  display: flex;
}

.cookie-modal {
  width: min(520px, 95vw);
  background: linear-gradient(180deg, #1f2f5c 0%, #121b36 100%);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 18px;
  color: #e9efff;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.45);
  overflow: hidden;
}

.cookie-modal__header {
  background: linear-gradient(135deg, #2c3f7b 0%, #1d2c57 100%);
  padding: 18px 22px;
  display: flex;
  align-items: center;
  gap: 12px;
}

.cookie-modal__icon {
  width: 38px;
  height: 38px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.1);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 17px;
}

.cookie-modal__title {
  font-size: 18px;
  font-weight: 700;
  margin: 0;
}

.cookie-modal__body {
  padding: 20px 22px 8px;
  font-size: 14px;
  color: #c7d6ff;
}

.cookie-modal__section {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 14px;
  padding: 14px 16px;
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.cookie-modal__section .info {
  flex: 1;
}

.cookie-modal__section h4 {
  margin: 0 0 4px;
  font-size: 15px;
  color: #e9efff;
}

.cookie-modal__section p {
  margin: 0;
  font-size: 13px;
  color: #9eb3e0;
}

.cookie-toggle {
  position: relative;
  width: 48px;
  height: 26px;
  flex-shrink: 0;
}

.cookie-toggle input {
  opacity: 0;
  width: 0;
  height: 0;
}

.cookie-toggle__slider {
  position: absolute;
  cursor: pointer;
  inset: 0;
  background: #324467;
  border-radius: 999px;
  transition: all 0.25s ease;
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.cookie-toggle__slider::before {
  position: absolute;
  content: '';
  height: 18px;
  width: 18px;
  left: 4px;
  bottom: 3px;
  background-color: #d7e3ff;
  border-radius: 50%;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
  transition: all 0.25s ease;
}

.cookie-toggle input:checked + .cookie-toggle__slider {
  background: linear-gradient(135deg, #4da3ff 0%, #1d7bf0 100%);
  border-color: rgba(77, 163, 255, 0.4);
}
.cookie-toggle input:checked:disabled + .cookie-toggle__slider {
  background: linear-gradient(135deg, #4da3ff 0%, #1d7bf0 100%);
  border-color: rgba(77, 163, 255, 0.25);
  cursor: not-allowed;
  opacity: 0.85;
}

.cookie-toggle input:checked + .cookie-toggle__slider::before {
  transform: translateX(20px);
  background-color: #f8fbff;
}

.cookie-toggle input:disabled + .cookie-toggle__slider {
  background: #2a3552;
  cursor: not-allowed;
  opacity: 0.7;
}

.cookie-modal__actions {
  padding: 14px 22px 20px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.cookie-modal__btn {
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.06);
  color: #e9efff;
  font-weight: 700;
  font-size: 14px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.cookie-modal__btn:hover {
  border-color: rgba(255, 255, 255, 0.2);
  background: rgba(255, 255, 255, 0.1);
}

.cookie-modal__btn--primary {
  background: linear-gradient(135deg, #4da3ff 0%, #1d7bf0 100%);
  color: #0b1329;
  border: 1px solid rgba(77, 163, 255, 0.6);
}

.cookie-modal__btn--primary:hover {
  filter: brightness(1.05);
}

@media (max-width: 640px) {
  .cookie-modal__actions {
    grid-template-columns: 1fr;
  }
  .cookie-widget {
    left: 14px;
    bottom: 14px;
  }
}
