:root {
  --theme-rgb: 74, 121, 255;
  --theme: rgb(var(--theme-rgb));
  --theme-bg-start: rgba(var(--theme-rgb), 0.68);
  --theme-bg-mid: #0e1635;
  --theme-bg-end: #090f22;
  --custom-bg-image: none;
  --custom-bg-size: clamp(320px, 54vw, 820px) auto;
  --custom-bg-position: right 2% bottom;
  --bg-layer-opacity: 0.38;
  --card-alpha: 0.2;
  --text: #f6f8ff;
  --text-muted: #d5defe;
  --panel: rgba(12, 20, 48, 0.58);
  --card: rgba(255, 255, 255, var(--card-alpha));
  --card-border: rgba(255, 255, 255, 0.35);
  --shadow: 0 18px 34px rgba(5, 10, 28, 0.45);
}

* {
  box-sizing: border-box;
}

* {
  scrollbar-color: rgba(var(--theme-rgb), 0.55) rgba(4, 8, 20, 0.28);
  scrollbar-width: thin;
}

*::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

*::-webkit-scrollbar-track {
  background: rgba(4, 8, 20, 0.28);
  border-radius: 999px;
}

*::-webkit-scrollbar-thumb {
  background: linear-gradient(90deg, rgba(var(--theme-rgb), 0.72), rgba(255, 255, 255, 0.28));
  border: 2px solid rgba(4, 8, 20, 0.28);
  border-radius: 999px;
}

*::-webkit-scrollbar-thumb:hover {
  background: rgba(var(--theme-rgb), 0.86);
}

html,
body {
  margin: 0;
  width: 100%;
  min-height: 100%;
  font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
  color: var(--text);
  background: radial-gradient(circle at 22% 10%, var(--theme-bg-start), var(--theme-bg-mid) 45%, var(--theme-bg-end) 100%);
}

html {
  min-height: 100%;
  overflow-x: hidden;
  background-color: var(--theme-bg-end);
}

body {
  position: relative;
  min-height: 100vh;
  padding: 1rem 1rem 1.35rem;
  overflow-x: hidden;
}

.bg-layer {
  position: fixed;
  inset: 0;
  background-image:
    linear-gradient(90deg, rgba(5, 8, 20, 0.9) 0%, rgba(var(--theme-rgb), 0.24) 58%, rgba(var(--theme-rgb), 0.1) 100%),
    var(--custom-bg-image);
  background-repeat: no-repeat;
  background-size: cover, var(--custom-bg-size);
  background-position: center, var(--custom-bg-position);
  opacity: var(--bg-layer-opacity);
  pointer-events: none;
  z-index: 0;
}

.app-header,
.layout {
  position: relative;
  z-index: 1;
}

.glass-panel {
  border: 1px solid rgba(255, 255, 255, 0.28);
  background: var(--panel);
  backdrop-filter: blur(12px);
  border-radius: 16px;
  box-shadow: var(--shadow);
}

.app-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  padding: 1rem 1.25rem;
  margin-bottom: 1rem;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.85rem;
}

.brand-logo {
  width: auto;
  height: 86px;
  max-width: min(40vw, 360px);
  object-fit: fill;
  border-radius: 0;
  background: transparent;
  border: 0;
  box-shadow: 0 6px 18px rgba(6, 10, 24, 0.5);
}

h1 {
  margin: 0;
  font-size: 1.45rem;
}

.subtitle {
  margin: 0.25rem 0 0;
  color: var(--text-muted);
  font-size: 0.95rem;
}

.storage-box {
  padding: 0.5rem 0.75rem;
  border-radius: 12px;
  background: rgba(var(--theme-rgb), 0.25);
  border: 1px solid rgba(255, 255, 255, 0.3);
  color: #fff;
  font-size: 0.9rem;
  white-space: nowrap;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.banner-action-btn {
  margin: 0;
  padding: 0.5rem 0.75rem;
  border-radius: 10px;
  font-size: 0.88rem;
}

.premium-only {
  position: relative;
}

.account-notice {
  position: relative;
  z-index: 1;
  margin: 0 0 0.8rem auto;
  max-width: 560px;
  padding: 0.7rem 0.85rem;
  color: #ffffff;
  font-size: 0.9rem;
}

.layout {
  display: block;
}

.stacked-form {
  display: grid;
  gap: 0.5rem;
}

label {
  font-size: 0.88rem;
  color: var(--text-muted);
}

input,
select,
textarea,
button {
  font: inherit;
}

dialog {
  color: var(--text);
  background: transparent;
}

input,
select,
textarea {
  width: 100%;
  padding: 0.58rem 0.68rem;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.3);
  color: #fff;
  background: rgba(11, 24, 58, 0.62);
}

input[type="color"] {
  min-height: 2.75rem;
  padding: 0.25rem;
}

input[type="file"] {
  cursor: pointer;
}

input::placeholder,
textarea::placeholder {
  color: #bbcaf8;
}

button {
  margin-top: 0.2rem;
  border: 0;
  padding: 0.62rem 0.78rem;
  border-radius: 10px;
  color: #fff;
  background: linear-gradient(140deg, rgba(var(--theme-rgb), 1), rgba(116, 159, 255, 0.9));
  cursor: pointer;
  font-weight: 600;
}

button:hover {
  filter: brightness(1.08);
}

.board-wrap {
  max-width: 100%;
  overflow-x: auto;
  padding-bottom: 0.45rem;
  scrollbar-gutter: stable;
}

.board {
  min-height: 70vh;
  display: flex;
  gap: 1rem;
  padding-bottom: 0.6rem;
}

.column {
  min-width: 270px;
  max-width: 310px;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.7rem;
  padding: 0.8rem;
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.22);
  background: rgba(15, 26, 63, 0.55);
  backdrop-filter: blur(6px);
}

.column h2 {
  margin: 0;
  font-size: 1rem;
  letter-spacing: 0.015em;
}

.stage-drag-handle {
  cursor: grab;
  user-select: none;
}

.stage-drag-handle:active {
  cursor: grabbing;
}

.column.stage-dragging {
  opacity: 0.58;
}

.column-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}

.stage-title-wrap {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  min-width: 0;
}

.stage-count-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.5rem;
  height: 1.5rem;
  padding: 0 0.45rem;
  border-radius: 999px;
  font-size: 0.76rem;
  font-weight: 700;
  background: rgba(var(--theme-rgb), 0.45);
  border: 1px solid rgba(255, 255, 255, 0.35);
  color: #ffffff;
}

.stage-delete-btn {
  margin: 0;
  padding: 0.32rem 0.5rem;
  border-radius: 8px;
  font-size: 0.76rem;
  font-weight: 600;
  background: rgba(20, 32, 71, 0.72);
  border: 1px solid rgba(255, 255, 255, 0.3);
}

.dropzone {
  min-height: 120px;
  display: grid;
  gap: 0.6rem;
}

.dropzone.drag-over {
  outline: 2px dashed rgba(var(--theme-rgb), 0.9);
  outline-offset: 6px;
  border-radius: 10px;
}

.task-card {
  border-radius: 14px;
  border: 1px solid var(--card-border);
  background: var(--card);
  backdrop-filter: blur(14px);
  padding: 0.75rem;
  color: #fff;
  box-shadow: 0 8px 18px rgba(5, 10, 28, 0.3);
}

.task-card.dragging {
  opacity: 0.55;
}

.task-title {
  margin: 0 0 0.45rem;
  font-size: 1rem;
}

.task-description {
  margin: 0 0 0.6rem;
  color: #edf1ff;
  font-size: 0.9rem;
  line-height: 1.4;
  white-space: pre-wrap;
}

.meta-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.4rem 0.8rem;
  margin: 0 0 0.6rem;
}

.meta-grid div:nth-child(3) {
  grid-column: 1 / -1;
}

dt {
  font-size: 0.74rem;
  color: #d0dcff;
  text-transform: uppercase;
}

dd {
  margin: 0.15rem 0 0;
  font-size: 0.88rem;
}

.delete-btn {
  width: 100%;
  background: rgba(31, 48, 97, 0.78);
  border: 1px solid rgba(255, 255, 255, 0.25);
  padding: 0.45rem;
  font-size: 0.84rem;
}

.card-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.45rem;
}

.edit-btn {
  margin: 0;
  background: rgba(var(--theme-rgb), 0.55);
  border: 1px solid rgba(255, 255, 255, 0.3);
  padding: 0.45rem;
  font-size: 0.84rem;
}

.edit-modal {
  width: min(560px, 92vw);
  border: 1px solid rgba(255, 255, 255, 0.35);
  padding: 0;
}

.edit-modal::backdrop {
  background: rgba(4, 8, 20, 0.62);
}

.edit-form {
  padding: 1rem;
}

.edit-form h2 {
  margin: 0 0 0.5rem;
  font-size: 1.1rem;
  color: #ffffff;
}

.modal-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.modal-title-row h2 {
  margin: 0;
}

.modal-close-btn {
  width: 2rem;
  height: 2rem;
  margin: 0;
  padding: 0;
  border-radius: 999px;
  background: rgba(20, 32, 71, 0.72);
  border: 1px solid rgba(255, 255, 255, 0.3);
  line-height: 1;
}

.modal-copy {
  margin: -0.1rem 0 0.45rem;
  color: var(--text-muted);
  font-size: 0.92rem;
  line-height: 1.45;
}

.modal-link-row {
  display: flex;
  justify-content: space-between;
  gap: 0.7rem;
}

.account-details {
  display: grid;
  gap: 0.45rem;
  padding: 0.7rem;
  border-radius: 10px;
  background: rgba(11, 24, 58, 0.48);
  border: 1px solid rgba(255, 255, 255, 0.22);
}

.account-details div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.account-details span {
  color: var(--text-muted);
  font-size: 0.84rem;
}

.account-details strong {
  color: #ffffff;
  font-size: 0.9rem;
  text-align: right;
}

.text-btn {
  width: auto;
  margin: 0;
  padding: 0.25rem 0;
  color: #dce5ff;
  background: transparent;
  border-radius: 0;
  text-decoration: underline;
  text-underline-offset: 0.18rem;
}

.text-btn:hover {
  filter: none;
  color: #ffffff;
}

.preview-strip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.7rem;
}

.range-field {
  display: grid;
  gap: 0.35rem;
}

.range-field label {
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
}

input[type="range"] {
  accent-color: var(--theme);
}

.theme-preview {
  width: 3rem;
  height: 3rem;
  flex: 0 0 auto;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.35);
  background: var(--theme);
  box-shadow: 0 8px 20px rgba(4, 8, 20, 0.35);
}

.single-action {
  grid-template-columns: 1fr;
}

.under-banner-actions {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.5rem;
  margin: 0 0 0.8rem;
  flex-wrap: wrap;
}

@media (max-width: 980px) {
  .app-header {
    flex-direction: column;
    align-items: flex-start;
  }

  .header-actions {
    width: 100%;
    justify-content: flex-start;
  }

  .under-banner-actions {
    justify-content: flex-start;
  }
}
