:root {
  color-scheme: dark;

  --font-sans: "Inter", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;

  --bg-app: #08081f;
  --bg-app-2: #0d0d2f;
  --surface-1: rgba(17, 19, 59, 0.82);
  --surface-2: rgba(25, 25, 76, 0.86);
  --surface-3: rgba(36, 31, 96, 0.72);
  --surface-glass: rgba(23, 20, 70, 0.68);

  --night-950: #08081f;
  --indigo-900: #10113a;
  --violet-800: #201a5b;
  --violet-700: #30247c;
  --neon-violet: #6d5bff;
  --neon-pink: #ff4fc3;
  --cyber-cyan: #22e6d1;
  --coral: #ff7b8a;
  --periwinkle: #a8b6ff;
  --success: #22e6a9;
  --warning: #ffb86b;
  --danger: #ff5c8a;
  --info: #65b7ff;

  --text-primary: #f6f7ff;
  --text-secondary: #c8cef7;
  --text-muted: #99a2d8;
  --text-faint: #6971aa;

  --border-soft: rgba(168, 182, 255, 0.16);
  --border-strong: rgba(168, 182, 255, 0.28);
  --border-hot: rgba(255, 79, 195, 0.44);
  --border-cyan: rgba(34, 230, 209, 0.38);

  --gradient-page: linear-gradient(135deg, #08081f 0%, #10113a 42%, #17124a 100%);
  --gradient-primary: linear-gradient(135deg, #ff4fc3 0%, #6d5bff 55%, #22e6d1 100%);
  --gradient-pink: linear-gradient(135deg, #ff4fc3 0%, #ff7b8a 100%);
  --gradient-blue: linear-gradient(135deg, #6d5bff 0%, #65b7ff 100%);
  --gradient-cyan: linear-gradient(135deg, #22e6d1 0%, #6d5bff 100%);
  --gradient-panel: linear-gradient(180deg, rgba(34, 30, 92, 0.92), rgba(12, 12, 44, 0.94));

  --shadow-panel: 0 24px 80px rgba(0, 0, 0, 0.42), inset 0 1px 0 rgba(255, 255, 255, 0.04);
  --shadow-glow-pink: 0 0 28px rgba(255, 79, 195, 0.36);
  --shadow-glow-cyan: 0 0 28px rgba(34, 230, 209, 0.28);
  --shadow-focus: 0 0 0 4px rgba(109, 91, 255, 0.28);

  --radius-xs: 8px;
  --radius-sm: 12px;
  --radius-md: 16px;
  --radius-lg: 24px;
  --radius-xl: 32px;
  --radius-full: 999px;

  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 24px;
  --space-6: 32px;
  --space-7: 48px;
  --space-8: 64px;

  --sidebar-width: 292px;
  --topbar-height: 76px;

  --transition-fast: 160ms ease;
  --transition-base: 240ms ease;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font-sans);
  background: var(--gradient-page);
  color: var(--text-primary);
  overflow-x: hidden;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image: linear-gradient(rgba(255,255,255,0.025) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,0.025) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: linear-gradient(180deg, black, transparent 88%);
  z-index: -1;
}

a {
  color: inherit;
  text-decoration: none;
}

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

button {
  border: 0;
  cursor: pointer;
}

button.nav-item {
  width: 100%;
  text-align: left;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-sm);
  background: rgba(8, 8, 31, 0.58);
  color: var(--text-primary);
  outline: 0;
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast), background var(--transition-fast);
}

input,
select {
  min-height: 44px;
  padding: 0 13px;
}

textarea {
  resize: vertical;
  min-height: 92px;
  padding: 13px;
}

input:focus,
select:focus,
textarea:focus {
  border-color: rgba(109, 91, 255, 0.74);
  box-shadow: var(--shadow-focus);
  background: rgba(8, 8, 31, 0.76);
}

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

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  max-width: 760px;
  margin-bottom: 4px;
  font-size: clamp(20px, 2vw, 26px);
  line-height: 1.08;
  letter-spacing: 0;
}

h2 {
  margin-bottom: 0;
  font-size: clamp(24px, 3vw, 34px);
  line-height: 1.12;
  letter-spacing: 0;
}

h3 {
  margin-bottom: 8px;
  font-size: 16px;
  letter-spacing: 0;
}

p {
  color: var(--text-muted);
  line-height: 1.65;
}

.app-shell {
  display: grid;
  grid-template-columns: var(--sidebar-width) minmax(0, 1fr);
  min-height: 100vh;
}

.sidebar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  flex-direction: column;
  gap: 26px;
  height: 100vh;
  padding: 28px 20px;
  background: linear-gradient(180deg, rgba(16, 17, 58, 0.95), rgba(13, 10, 45, 0.92));
  border-right: 1px solid var(--border-soft);
  box-shadow: 18px 0 80px rgba(0, 0, 0, 0.26);
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 8px;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 14px;
  background: var(--gradient-primary);
  color: white;
  font-weight: 800;
  box-shadow: var(--shadow-glow-pink);
}

.brand strong,
.brand small {
  display: block;
}

.brand strong {
  font-size: 16px;
}

.brand small {
  margin-top: 2px;
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.sidebar-nav {
  display: grid;
  gap: 8px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 44px;
  padding: 0 14px;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  appearance: none;
  background: transparent;
  color: var(--text-muted);
  font-size: 14px;
  font-weight: 700;
  transition: background var(--transition-fast), color var(--transition-fast), border-color var(--transition-fast), transform var(--transition-fast);
}

.nav-item:hover,
.nav-item.active {
  color: var(--text-primary);
  background: rgba(109, 91, 255, 0.16);
  border-color: var(--border-soft);
  transform: translateX(2px);
}

.nav-item:focus-visible {
  outline: 0;
  box-shadow: var(--shadow-focus);
}

.nav-icon {
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  border-radius: 8px;
  background: rgba(168, 182, 255, 0.08);
  color: var(--periwinkle);
  font-size: 13px;
}

.sidebar-card {
  margin-top: auto;
  padding: 20px;
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-lg);
  background: linear-gradient(180deg, rgba(109, 91, 255, 0.18), rgba(255, 79, 195, 0.08));
  box-shadow: var(--shadow-panel);
}

.sidebar-card strong {
  display: block;
  margin-top: 16px;
  font-size: 15px;
}

.sidebar-card p {
  margin: 8px 0 0;
  color: var(--text-muted);
  font-size: 12px;
  line-height: 1.6;
}

.sidebar-kpi {
  display: grid;
  gap: 2px;
  padding: 16px;
  border: 1px solid rgba(34, 230, 209, 0.2);
  border-radius: var(--radius-md);
  background: rgba(8, 8, 31, 0.36);
}

.sidebar-kpi span {
  font-size: 36px;
  font-weight: 800;
  line-height: 1;
}

.sidebar-kpi small {
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.main-content {
  min-width: 0;
  padding: 24px clamp(20px, 4vw, 48px) 56px;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 8;
  min-height: var(--topbar-height);
  display: flex;
  align-items: center;
  gap: 12px;
  margin: -24px calc(clamp(20px, 4vw, 48px) * -1) 24px;
  padding: 14px clamp(20px, 4vw, 48px);
  background: rgba(8, 8, 31, 0.72);
  backdrop-filter: blur(18px);
  border-bottom: 1px solid var(--border-soft);
}

.month-switcher {
  min-width: 190px;
}

.month-switcher strong {
  display: block;
  margin-top: 2px;
  font-size: 20px;
}

.topbar-search {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 190px;
  min-height: 44px;
  padding: 0 14px;
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-full);
  background: rgba(17, 19, 59, 0.78);
  color: var(--text-muted);
}

.topbar-search input {
  min-height: auto;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.icon-button,
.button,
.chip,
.segment,
.mini-action {
  transition: transform var(--transition-fast), box-shadow var(--transition-fast), border-color var(--transition-fast), background var(--transition-fast), opacity var(--transition-fast);
}

.icon-button {
  display: grid;
  flex: 0 0 auto;
  place-items: center;
  width: 44px;
  height: 44px;
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-sm);
  background: rgba(168, 182, 255, 0.08);
  color: var(--text-primary);
  font-size: 22px;
}

.icon-button:hover,
.button:hover,
.chip:hover,
.segment:hover,
.mini-action:hover {
  transform: translateY(-1px);
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 0 18px;
  border: 1px solid transparent;
  border-radius: var(--radius-full);
  color: var(--text-primary);
  font-weight: 800;
  white-space: nowrap;
}

.button.primary {
  background: var(--gradient-primary);
  box-shadow: var(--shadow-glow-pink);
}

.button.ghost {
  background: rgba(168, 182, 255, 0.06);
  border-color: var(--border-soft);
}

.chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 28px;
  padding: 0 10px;
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-full);
  color: var(--text-muted);
  background: rgba(168, 182, 255, 0.08);
  font-size: 12px;
  font-weight: 800;
}

.panel {
  position: relative;
  overflow: hidden;
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-lg);
  background: var(--gradient-panel);
  box-shadow: var(--shadow-panel);
}

.panel::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(135deg, rgba(255,255,255,0.07), transparent 28%, rgba(34,230,209,0.03));
}

.panel > * {
  position: relative;
  z-index: 1;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--cyber-cyan);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.eyebrow::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--gradient-primary);
  box-shadow: 0 0 16px rgba(255, 79, 195, 0.72);
}

.planner-hero {
  display: grid;
  grid-template-columns: minmax(220px, 0.7fr) minmax(340px, 1fr);
  gap: 14px;
  align-items: center;
  margin-bottom: 14px;
  padding: 14px;
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-md);
  background: rgba(17, 19, 59, 0.42);
}

.hero-copy p {
  max-width: 420px;
  margin-bottom: 0;
  font-size: 13px;
  line-height: 1.45;
}

.metrics-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.metric-card {
  min-width: 0;
  min-height: 70px;
  padding: 10px 12px;
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-sm);
  background: rgba(25, 25, 76, 0.72);
}

.metric-card span,
.metric-card strong,
.metric-card small {
  display: block;
}

.metric-card span {
  color: var(--text-muted);
  overflow-wrap: anywhere;
  font-size: 10px;
  font-weight: 800;
  line-height: 1.25;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.metric-card strong {
  margin-top: 4px;
  font-size: 24px;
  line-height: 1;
}

.metric-card small {
  margin-top: 4px;
  color: var(--text-faint);
  font-size: 11px;
  font-weight: 700;
}

.accent-pink {
  border-color: rgba(255, 79, 195, 0.34);
  box-shadow: inset 0 0 32px rgba(255, 79, 195, 0.08);
}

.accent-cyan {
  border-color: rgba(34, 230, 209, 0.32);
  box-shadow: inset 0 0 32px rgba(34, 230, 209, 0.08);
}

.accent-violet {
  border-color: rgba(109, 91, 255, 0.34);
  box-shadow: inset 0 0 32px rgba(109, 91, 255, 0.10);
}

.planning-strip {
  margin-top: var(--space-5);
}

.form-card,
.inbox-panel {
  padding: var(--space-5);
}

.modal-card {
  width: min(480px, calc(100vw - 32px));
  max-height: calc(100vh - 48px);
  overflow-y: auto;
  padding: 20px;
  border-radius: var(--radius-md);
}

.task-modal[hidden] {
  display: none;
}

.task-modal {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: grid;
  place-items: center;
  padding: 16px;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(3, 4, 18, 0.68);
  backdrop-filter: blur(12px);
}

.panel-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: var(--space-4);
}

.field-group {
  display: grid;
  gap: 8px;
  margin-bottom: var(--space-4);
}

.field-group label {
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 800;
}

.form-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.toggle-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 48px;
  margin-bottom: var(--space-4);
  padding: 0 2px;
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 800;
}

.switch {
  position: relative;
  display: inline-flex;
}

.switch input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.switch span {
  position: relative;
  width: 48px;
  height: 28px;
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-full);
  background: rgba(168, 182, 255, 0.12);
}

.switch span::after {
  content: "";
  position: absolute;
  top: 4px;
  left: 4px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--text-muted);
  transition: transform var(--transition-fast), background var(--transition-fast);
}

.switch input:checked + span {
  background: rgba(34, 230, 209, 0.22);
  border-color: var(--border-cyan);
}

.switch input:checked + span::after {
  transform: translateX(20px);
  background: var(--cyber-cyan);
}

.stack-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.inbox-panel {
  min-height: 100%;
}

.floating-zone {
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  min-height: 118px;
}

.board-shell {
  position: relative;
  min-width: 0;
  overflow-x: auto;
  padding-bottom: 14px;
  scrollbar-color: rgba(168, 182, 255, 0.42) rgba(8, 8, 31, 0.42);
  scrollbar-width: thin;
  -webkit-mask-image: linear-gradient(90deg, transparent 0, black 26px, black calc(100% - 26px), transparent 100%);
  mask-image: linear-gradient(90deg, transparent 0, black 26px, black calc(100% - 26px), transparent 100%);
}

.board-shell::-webkit-scrollbar {
  height: 10px;
}

.board-shell::-webkit-scrollbar-track {
  border-radius: var(--radius-full);
  background: rgba(8, 8, 31, 0.42);
}

.board-shell::-webkit-scrollbar-thumb {
  border-radius: var(--radius-full);
  background: linear-gradient(90deg, rgba(109, 91, 255, 0.62), rgba(34, 230, 209, 0.62));
}

.board-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: var(--space-4);
}

.segmented {
  display: inline-flex;
  gap: 4px;
  padding: 4px;
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-full);
  background: rgba(8, 8, 31, 0.34);
}

.segment {
  min-height: 34px;
  padding: 0 14px;
  border-radius: var(--radius-full);
  color: var(--text-muted);
  background: transparent;
  font-size: 13px;
  font-weight: 800;
}

.segment.active {
  color: var(--text-primary);
  background: rgba(109, 91, 255, 0.24);
}

.weeks-board {
  display: grid;
  gap: 14px;
  align-items: start;
  min-width: max-content;
}

.weeks-board.week-count-4 {
  grid-template-columns: repeat(4, minmax(292px, 1fr));
}

.weeks-board.week-count-5 {
  grid-template-columns: repeat(5, minmax(292px, 1fr));
}

.weeks-board.week-count-6 {
  grid-template-columns: repeat(6, minmax(292px, 1fr));
}

.week-column {
  min-width: 0;
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-lg);
  background: linear-gradient(180deg, rgba(17, 19, 59, 0.78), rgba(8, 8, 31, 0.62));
  box-shadow: 0 16px 52px rgba(0, 0, 0, 0.22);
  overflow: hidden;
}

.week-column.is-current {
  border-color: rgba(34, 230, 209, 0.5);
  box-shadow: 0 18px 64px rgba(34, 230, 209, 0.12), 0 16px 52px rgba(0, 0, 0, 0.22);
}

.week-column.is-next-month {
  border-color: rgba(168, 182, 255, 0.24);
  opacity: 0.86;
}

.week-header {
  display: grid;
  width: 100%;
  text-align: left;
  gap: 4px;
  padding: 14px;
  border: 0;
  border-bottom: 1px solid var(--border-soft);
  background: rgba(168, 182, 255, 0.06);
  color: var(--text-primary);
}

.week-header span {
  color: var(--text-faint);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

.week-header strong {
  font-size: 18px;
  line-height: 1.18;
}

.week-indicators {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 4px;
}

.week-indicators i {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: rgba(168, 182, 255, 0.22);
}

.week-indicators i.has-planned {
  background: var(--neon-pink);
  box-shadow: 0 0 14px rgba(255, 79, 195, 0.72);
}

.week-indicators small {
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 800;
}

.week-days {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  padding: 10px 12px 0;
}

.week-days .day-pill {
  appearance: none;
  -webkit-appearance: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  position: relative;
  min-height: 26px;
  padding: 4px 9px;
  border: 1px solid rgba(168, 182, 255, 0.16);
  border-radius: var(--radius-full);
  color: var(--text-secondary);
  background: linear-gradient(180deg, rgba(25, 25, 76, 0.9), rgba(8, 8, 31, 0.58));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
  font-size: 12px;
  font-weight: 800;
  line-height: 1;
  text-transform: lowercase;
  transition: border-color var(--transition-fast), color var(--transition-fast), background var(--transition-fast), box-shadow var(--transition-fast);
}

.week-days .day-pill span {
  display: block;
}

.week-days .day-pill.has-tasks {
  border-color: rgba(34, 230, 209, 0.3);
  color: var(--cyber-cyan);
  background: linear-gradient(180deg, rgba(34, 230, 209, 0.12), rgba(25, 25, 76, 0.86));
}

.week-days .day-pill.has-tasks::after {
  content: "";
  position: absolute;
  top: 4px;
  right: 5px;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--neon-pink);
  box-shadow: 0 0 10px rgba(255, 79, 195, 0.72);
}

.week-days .day-pill:hover,
.week-days .day-pill:focus-visible {
  border-color: var(--border-cyan);
  color: var(--text-primary);
  background: linear-gradient(180deg, rgba(34, 230, 209, 0.16), rgba(25, 25, 76, 0.9));
  box-shadow: var(--shadow-focus);
}

.lane {
  padding: 10px;
}

.done-lane {
  padding-top: 0;
}

.lane-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 800;
}

.lane-title small {
  display: grid;
  place-items: center;
  min-width: 24px;
  height: 24px;
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-full);
  color: var(--text-muted);
  background: rgba(168, 182, 255, 0.08);
}

.dropzone {
  display: grid;
  align-content: start;
  gap: 8px;
  min-height: 72px;
  padding: 7px;
  border: 1px dashed rgba(168, 182, 255, 0.16);
  border-radius: var(--radius-md);
  background: rgba(8, 8, 31, 0.24);
  transition: border-color var(--transition-fast), background var(--transition-fast), box-shadow var(--transition-fast);
}

.dropzone.is-over,
.week-column.is-over {
  border-color: var(--border-cyan);
  background: rgba(34, 230, 209, 0.08);
  box-shadow: var(--shadow-glow-cyan);
}

.compact-modal .modal-card {
  width: min(420px, calc(100vw - 32px));
}

.day-card,
.drop-choice-card {
  display: grid;
  gap: 14px;
}

.day-task-list {
  display: grid;
  gap: 8px;
}

.day-task-list .task-card {
  cursor: default;
}

.modal-note {
  margin: -6px 0 0;
  color: var(--text-secondary);
  font-size: 14px;
  font-weight: 800;
  line-height: 1.35;
}

.drop-choice-days {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.day-choice-button {
  min-height: 38px;
  padding: 0 10px;
  border: 1px solid rgba(168, 182, 255, 0.16);
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  background: rgba(8, 8, 31, 0.34);
  font-size: 13px;
  font-weight: 800;
  text-transform: lowercase;
}

.day-choice-button:hover,
.day-choice-button:focus-visible {
  border-color: var(--border-cyan);
  color: var(--text-primary);
  background: rgba(34, 230, 209, 0.1);
}

.full-width {
  width: 100%;
  justify-content: center;
}

.task-card {
  display: grid;
  gap: 7px;
  min-width: 0;
  overflow: hidden;
  padding: 10px;
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-md);
  background: rgba(25, 25, 76, 0.86);
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.22);
  cursor: grab;
}

.task-card:active {
  cursor: grabbing;
}

.task-card.is-dragging {
  opacity: 0.55;
  transform: rotate(1deg) scale(0.98);
}

.task-card.priority-focus {
  border-color: rgba(255, 79, 195, 0.42);
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.22), inset 0 0 26px rgba(255, 79, 195, 0.06);
}

.task-card.priority-normal {
  border-color: rgba(101, 183, 255, 0.32);
}

.task-card.priority-light {
  border-color: rgba(255, 184, 107, 0.36);
}

.task-card.is-week-task {
  border-color: rgba(255, 184, 107, 0.5);
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.22), inset 0 0 30px rgba(255, 184, 107, 0.08);
}

.task-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.task-priority {
  min-width: 0;
  max-width: 108px;
  overflow: hidden;
  padding: 4px 8px;
  border: 1px solid rgba(168, 182, 255, 0.14);
  border-radius: var(--radius-full);
  color: var(--info);
  background: rgba(101, 183, 255, 0.1);
  font-size: 11px;
  font-weight: 800;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.task-card.priority-focus .task-priority {
  color: #ffd4f1;
  border-color: rgba(255, 79, 195, 0.3);
  background: rgba(255, 79, 195, 0.14);
}

.task-card.priority-normal .task-priority {
  color: var(--info);
  border-color: rgba(101, 183, 255, 0.28);
  background: rgba(101, 183, 255, 0.12);
}

.task-card.priority-light .task-priority {
  color: var(--warning);
  border-color: rgba(255, 184, 107, 0.32);
  background: rgba(255, 184, 107, 0.12);
}

.task-card.is-week-task .task-meta span {
  color: var(--warning);
  border-color: rgba(255, 184, 107, 0.26);
  background: rgba(255, 184, 107, 0.1);
}

.task-actions {
  display: inline-flex;
  flex: 0 0 auto;
  gap: 4px;
}

.mini-action {
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  border: 1px solid rgba(168, 182, 255, 0.14);
  border-radius: 8px;
  color: var(--text-secondary);
  background: rgba(168, 182, 255, 0.08);
  font-size: 13px;
  font-weight: 900;
}

.mini-action.danger {
  color: #ffd4df;
  border-color: rgba(255, 92, 138, 0.26);
  background: rgba(255, 92, 138, 0.1);
}

.task-card h3 {
  margin: 0;
  overflow-wrap: anywhere;
  font-size: 14px;
  line-height: 1.35;
}

.task-card p {
  display: -webkit-box;
  overflow: hidden;
  min-height: 21px;
  margin: 0;
  color: var(--text-muted);
  font-size: 12px;
  line-height: 1.55;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.task-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.task-meta span {
  padding: 3px 7px;
  border: 1px solid rgba(168, 182, 255, 0.12);
  border-radius: var(--radius-full);
  color: var(--text-muted);
  background: rgba(8, 8, 31, 0.28);
  font-size: 11px;
  font-weight: 800;
}

.empty-state {
  display: grid;
  place-items: center;
  min-height: 92px;
  border: 1px solid rgba(168, 182, 255, 0.12);
  border-radius: var(--radius-sm);
  color: var(--text-faint);
  font-size: 13px;
  font-weight: 800;
  text-align: center;
}

@media (max-width: 1500px) {
  .weeks-board.week-count-4 {
    grid-template-columns: repeat(4, minmax(268px, 1fr));
  }

  .weeks-board.week-count-5 {
    grid-template-columns: repeat(5, minmax(256px, 1fr));
  }
}

@media (max-width: 1180px) {
  .app-shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: static;
    height: auto;
    padding: 18px clamp(16px, 4vw, 32px);
  }

  .sidebar-nav {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .sidebar-card {
    display: none;
  }

  .main-content {
    padding-top: 18px;
  }

  .planner-hero {
    grid-template-columns: 1fr;
  }

  .weeks-board,
  .weeks-board.week-count-4,
  .weeks-board.week-count-5,
  .weeks-board.week-count-6 {
    display: flex;
    align-items: stretch;
    gap: 12px;
    min-width: max-content;
    overflow: visible;
    scroll-snap-type: x proximity;
  }

  .week-column {
    flex: 0 0 min(82vw, 340px);
    scroll-snap-align: start;
  }
}

@media (max-width: 900px) {
  .topbar {
    position: static;
    flex-wrap: wrap;
    gap: 10px;
  }

  .month-switcher {
    flex: 1;
    min-width: 160px;
  }

  .topbar-search {
    flex-basis: 100%;
    order: 2;
  }

  .planner-hero {
    gap: var(--space-4);
  }

  .metrics-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .sidebar {
    gap: 14px;
  }

  .sidebar-nav {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .board-header {
    align-items: flex-start;
    flex-direction: column;
  }

  .segmented {
    width: 100%;
  }

  .segment {
    flex: 1;
  }

  .weeks-board,
  .weeks-board.week-count-4,
  .weeks-board.week-count-5,
  .weeks-board.week-count-6 {
    display: flex;
    gap: 10px;
    min-width: max-content;
    align-items: stretch;
    overflow: visible;
    scroll-snap-type: x proximity;
    padding-bottom: 8px;
  }

  .week-column {
    flex: 0 0 112px;
    min-height: 260px;
    scroll-snap-align: start;
  }

  .week-column.is-expanded {
    flex-basis: min(82vw, 360px);
  }

  .week-column:not(.is-expanded) .week-days,
  .week-column:not(.is-expanded) .lane {
    display: none;
  }

  .week-column:not(.is-expanded) .week-header {
    min-height: 260px;
    align-content: start;
  }

  .week-column:not(.is-expanded) .week-header strong {
    writing-mode: vertical-rl;
    transform: rotate(180deg);
    margin-top: 14px;
  }

  .week-column:not(.is-expanded) .week-indicators {
    margin-top: auto;
  }
}

@media (max-width: 620px) {
  .week-column {
    flex-basis: 88px;
  }

  .week-column.is-expanded {
    flex-basis: min(84vw, 330px);
  }
}

@media (max-width: 560px) {
  .main-content {
    padding-inline: 12px;
    padding-bottom: 32px;
  }

  .topbar {
    margin-inline: -12px;
    padding-inline: 12px;
  }

  h1 {
    font-size: 22px;
  }

  .topbar .button {
    flex: 1 1 130px;
    width: auto;
  }

  .icon-button {
    width: 40px;
    height: 40px;
  }

  .month-switcher {
    min-width: 128px;
  }

  .month-switcher strong {
    font-size: 18px;
  }

  .planner-hero {
    padding: 12px;
  }

  .metrics-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .metric-card {
    min-height: 66px;
    padding: 9px;
  }

  .metric-card small {
    display: none;
  }

  .form-card,
  .inbox-panel {
    padding: 14px;
  }

  .form-row {
    grid-template-columns: 1fr;
    gap: 0;
  }

  .sidebar-nav {
    grid-template-columns: 1fr 1fr;
  }

  .nav-item {
    min-height: 40px;
    padding: 0 10px;
    font-size: 12px;
  }
}
