:root{
  --bg:#0b1020;
  --panel:#111a33;
  --panel2:#0f1830;
  --text:#e7ecff;
  --muted:#aab3d6;
  --border:rgba(255,255,255,.10);
  --shadow: 0 18px 60px rgba(0,0,0,.35);
  --primary:#4f46e5;
  --danger:#ef4444;
  --radius:16px;
  --radius2:22px;
  --pad:16px;
  --mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  --sans: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, "Apple Color Emoji","Segoe UI Emoji";
}

html[data-theme="light"]{
  --bg:#f6f7fb;
  --panel:#ffffff;
  --panel2:#ffffff;
  --text:#0b1020;
  --muted:#4b5563;
  --border:rgba(10,20,40,.12);
  --shadow: 0 14px 40px rgba(10,20,40,.12);
}

*{box-sizing:border-box}
html,body{height:100%}
body{
  margin:0;
  font-family:var(--sans);
  background:
    radial-gradient(1200px 800px at 10% 10%, rgba(79,70,229,.18) 0%, transparent 60%),
    radial-gradient(900px 700px at 90% 20%, rgba(14,165,233,.14) 0%, transparent 55%),
    var(--bg);
  color:var(--text);
}

.view{
  min-height:100%;
  display:flex;
  align-items:center;
  justify-content:center;
  padding:24px;
}
.hidden{display:none !important;}

.card{
  width:min(520px, 100%);
  background: linear-gradient(180deg, rgba(255,255,255,.06), rgba(255,255,255,.03));
  border:1px solid var(--border);
  border-radius: var(--radius2);
  box-shadow: var(--shadow);
  padding: 26px;
  backdrop-filter: blur(8px);
}

h1{margin:0 0 10px; font-size:28px; color:var(--text)}
h2{margin:0; font-size:20px; color:var(--text)}
h3{margin:0; font-size:18px; color:var(--text)}
.muted{color:var(--muted)}
.small{font-size:12px}
.error{color:#ff6b6b; margin-top:10px; min-height: 1.2em}
html[data-theme="dark"] .error{color:#ffb4b4;}

.form{display:grid; gap:12px; margin-top:14px}
label{display:grid; gap:6px; font-size:14px; color:var(--text)}
input, select, textarea{
  width:100%;
  padding:10px 12px;
  border-radius:12px;
  border:1px solid var(--border);
  background: rgba(8,12,26,.55);
  color:var(--text);
  outline:none;
}
html[data-theme="light"] input,
html[data-theme="light"] select,
html[data-theme="light"] textarea{
  background: rgba(255,255,255,.9);
}
input:focus, select:focus{
  border-color: rgba(79,70,229,.7);
  box-shadow: 0 0 0 3px rgba(79,70,229,.25);
}
.select{cursor:pointer}

.btn{
  padding:10px 12px;
  border-radius:12px;
  border:1px solid var(--border);
  background: rgba(255,255,255,.06);
  color:var(--text);
  cursor:pointer;
}
html[data-theme="light"] .btn{
  background: rgba(10,20,40,.04);
}
.btn:hover{background: rgba(255,255,255,.10)}
html[data-theme="light"] .btn:hover{background: rgba(10,20,40,.07)}
.btn.primary{background: rgba(79,70,229,.75); border-color: rgba(79,70,229,.9)}
.btn.primary:hover{background: rgba(79,70,229,.9)}
.btn.danger{background: rgba(239,68,68,.75); border-color: rgba(239,68,68,.9)}
.btn.danger:hover{background: rgba(239,68,68,.9)}
.iconBtn{
  border:none;
  background: transparent;
  color: var(--muted);
  font-size: 18px;
  cursor:pointer;
}
.iconBtn:hover{color: var(--text)}

.topbar{
  position: sticky;
  top:0;
  z-index:10;
  display:flex;
  justify-content:space-between;
  align-items:center;
  padding: 14px 18px;
  border-bottom:1px solid var(--border);
  background: rgba(5,8,18,.65);
  backdrop-filter: blur(10px);
}
html[data-theme="light"] .topbar{
  background: rgba(255,255,255,.75);
}

.brand{display:flex; gap:12px; align-items:center}
.logo{font-size:22px}
.title{font-weight:700}
.subtitle{font-size:12px; color:var(--muted); margin-top:2px}
.right{display:flex; gap:10px; align-items:center}

.container{
  width:min(1200px, 100%);
  margin: 18px auto 40px;
  padding: 0 18px;
  display:grid;
  gap: 18px;
}

.panel{
  background: linear-gradient(180deg, rgba(255,255,255,.06), rgba(255,255,255,.03));
  border: 1px solid var(--border);
  border-radius: var(--radius2);
  box-shadow: var(--shadow);
  overflow:hidden;
}
html[data-theme="light"] .panel{
  background: linear-gradient(180deg, rgba(255,255,255,.92), rgba(255,255,255,.86));
}

.panelHeader{
  display:flex;
  justify-content:space-between;
  align-items:center;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
  background: rgba(255,255,255,.03);
}
html[data-theme="light"] .panelHeader{
  background: rgba(10,20,40,.03);
}

.timelineWrap{padding: 14px 16px 18px;}
.timeline{
  border:1px solid var(--border);
  border-radius: 18px;
  overflow:hidden;
  background: rgba(8,12,26,.35);
}
html[data-theme="light"] .timeline{
  background: rgba(10,20,40,.03);
}

.monthRow {
  display: grid;
  grid-template-columns: 210px 1fr;
  gap: 12px;
  border-bottom: 1px solid var(--border);
}
.monthsWrap {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
}
.monthCell{
  padding: 10px 8px;
  text-align:center;
  color: var(--muted);
  font-size: 12px;
  border-right:1px solid var(--border);
}
.monthCell:last-child{border-right:none}

.rows{display:grid; gap: 10px; padding: 12px;}
.taskRow{
  display:grid;
  grid-template-columns: 210px 1fr;
  gap: 12px;
  align-items:center;
}
.taskMeta{
  display:grid;
  gap: 2px;
}
.taskTitle{
  font-weight: 650;
  font-size: 14px;
  line-height: 1.2;
}
.taskDates{
  font-size: 12px;
  color: var(--muted);
  font-family: var(--mono);
}

.barLane{
  position:relative;
  height: 28px;
  border-radius: 999px;
  background: rgba(255,255,255,.04);
  border:1px solid rgba(255,255,255,.08);
  overflow:hidden;
}
html[data-theme="light"] .barLane{
  background: rgba(10,20,40,.04);
  border:1px solid rgba(10,20,40,.10);
}

.bar{
  position:absolute;
  top: 3px;
  bottom: 3px;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,.18);
  box-shadow: 0 8px 18px rgba(0,0,0,.20);
  cursor:pointer;
  min-width: 18px;
  padding: 0;
  display:flex;
  justify-content:flex-end;
  align-items:center;
}
html[data-theme="light"] .bar{
  border: 1px solid rgba(10,20,40,.12);
  box-shadow: 0 10px 18px rgba(10,20,40,.10);
}
.bar:hover{filter: brightness(1.07)}

.ownerPill{
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 999px;
  border:1px solid rgba(255,255,255,.18);
  background: rgba(0,0,0,.18);
  margin-right: 6px;
}
html[data-theme="light"] .ownerPill{
  background: rgba(255,255,255,.55);
  border:1px solid rgba(10,20,40,.10);
}

.dialog{
  width:min(720px, 96vw);
  border: 1px solid var(--border);
  border-radius: 20px;
  background: rgba(12,18,38,.92);
  box-shadow: var(--shadow);
  padding:0;
}
html[data-theme="light"] .dialog{
  background: rgba(255,255,255,.96);
}
.dialog::backdrop{background: rgba(0,0,0,.55)}
.dialogBody{padding: 14px 16px 16px}
.dialogHeader{
  display:flex;
  justify-content:space-between;
  align-items:center;
  padding-bottom: 10px;
  border-bottom:1px solid var(--border);
}

.grid{
  display:grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-top: 12px;
}
.hint{
  grid-column: 1 / -1;
  font-size: 12px;
  color: var(--muted);
  padding: 10px 12px;
  border:1px dashed rgba(255,255,255,.16);
  border-radius: 14px;
  background: rgba(255,255,255,.03);
}
html[data-theme="light"] .hint{
  border:1px dashed rgba(10,20,40,.18);
  background: rgba(10,20,40,.03);
}

.dialogFooter{
  display:flex;
  gap: 10px;
  align-items:center;
  padding-top: 12px;
}
.spacer{flex:1}

.ownerCheckboxes {
  display: grid;
  gap: 8px;
  margin-top: 6px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: rgba(8,12,26,.55);
  max-height: 100px;
  overflow-y: auto;
}
html[data-theme="light"] .ownerCheckboxes {
  background: rgba(255,255,255,.9);
}

.ownerCheckboxes label {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  cursor: pointer;
  font-size: 14px;
  color: var(--text);
}

.ownerCheckboxes input[type="checkbox"] {
  width: auto;
  margin: 0;
  cursor: pointer;
}

.colorPalette {
  display: grid;
  grid-template-columns: repeat(9, 1fr);
  gap: 8px;
  margin-top: 6px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: rgba(8,12,26,.55);
}
html[data-theme="light"] .colorPalette {
  background: rgba(255,255,255,.9);
}

.colorOption {
  width: 100%;
  aspect-ratio: 1;
  border-radius: 12px;
  border: 3px solid transparent;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 4px 12px rgba(0,0,0,.15);
}
html[data-theme="light"] .colorOption {
  box-shadow: 0 4px 12px rgba(10,20,40,.10);
}

.colorOption:hover {
  transform: scale(1.08);
}

.colorOption.selected {
  border-color: rgba(255,255,255,.8);
  box-shadow: 0 0 0 2px rgba(0,0,0,.3), inset 0 0 0 1px rgba(255,255,255,.3);
}
html[data-theme="light"] .colorOption.selected {
  box-shadow: 0 0 0 2px rgba(10,20,40,.2), inset 0 0 0 1px rgba(10,20,40,.1);
}

/* Make title input larger */
#taskTitle {
  font-size: 16px !important;
  padding: 12px 14px !important;
  min-height: 80px !important;
  resize: vertical;
  font-family: var(--sans);
  line-height: 1.4;
  overflow: hidden !important;
  overflow-wrap: break-word !important;
  word-wrap: break-word !important;
  word-break: break-word !important;
  white-space: pre-wrap !important;
  border-radius: 12px !important;
  border-width: 0;
}