@import url('https://fonts.googleapis.com/css2?family=Bricolage+Grotesque:opsz,wght@12..96,300..800&family=Albert+Sans:ital,wght@0,300..800;1,300..800&display=swap');

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg:            #FDFCF9;
  --surface:       #F5F3EE;
  --surface2:      #EDEAE3;
  --border:        #DBD8D0;
  --border-light:  #E8E5DE;
  --text:          #1C1916;
  --text-muted:    #8A857B;
  --accent:        #C95D2E;
  --accent-hover:  #B04E22;
  --accent-subtle: rgba(201, 93, 46, 0.07);
  --accent-glow:   rgba(201, 93, 46, 0.15);
  --danger:        #C43434;
  --danger-subtle: rgba(196, 52, 52, 0.08);
  --radius:        12px;
  --radius-sm:     8px;
  --radius-xs:     6px;
  --hour-height:   52px;
  --shadow-xs:     0 1px 2px rgba(28, 25, 22, 0.04);
  --shadow-sm:     0 1px 3px rgba(28, 25, 22, 0.06), 0 1px 2px rgba(28, 25, 22, 0.04);
  --shadow-md:     0 4px 12px rgba(28, 25, 22, 0.08), 0 2px 4px rgba(28, 25, 22, 0.04);
  --shadow-lg:     0 12px 32px rgba(28, 25, 22, 0.12), 0 4px 8px rgba(28, 25, 22, 0.04);
  --transition:    0.2s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: 'Albert Sans', -apple-system, system-ui, sans-serif;
  font-size: 14px;
  font-weight: 400;
  line-height: 1.5;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ── NAV ── */
nav {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 0 28px;
  height: 52px;
  background: var(--bg);
  border-bottom: 1px solid var(--border-light);
  position: sticky;
  top: 0;
  z-index: 100;
  backdrop-filter: blur(12px);
  background: rgba(253, 252, 249, 0.92);
}

nav .logo {
  font-family: 'Bricolage Grotesque', Georgia, serif;
  font-optical-sizing: auto;
  font-weight: 700;
  font-size: 19px;
  letter-spacing: -0.3px;
  color: var(--text);
  cursor: pointer;
  transition: color var(--transition);
}

nav .logo:hover { color: var(--accent); }

nav .breadcrumb {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--text-muted);
  font-size: 13px;
  font-weight: 450;
}

nav .breadcrumb .sep {
  opacity: 0.3;
  font-size: 12px;
  user-select: none;
}

nav .breadcrumb .crumb {
  color: var(--text);
  font-weight: 550;
  letter-spacing: -0.01em;
}

/* ── PAGES ── */
#app { min-height: calc(100vh - 52px); }
.page { padding: 36px 32px; max-width: 1200px; }

/* ── HOME ── */
.home-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 32px;
}

.home-header h1 {
  font-family: 'Bricolage Grotesque', Georgia, serif;
  font-optical-sizing: auto;
  font-size: 28px;
  font-weight: 700;
  letter-spacing: -0.5px;
  color: var(--text);
}

.teams-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 16px;
}

.team-card {
  background: var(--surface);
  border: 1px solid var(--border-light);
  border-radius: var(--radius);
  padding: 22px 20px;
  cursor: pointer;
  transition: border-color var(--transition), transform var(--transition), box-shadow var(--transition), background var(--transition);
  position: relative;
  box-shadow: var(--shadow-xs);
  animation: cardReveal 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94) both;
}

.team-card:hover {
  border-color: var(--accent);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
  background: var(--bg);
}

.team-card h2 {
  font-family: 'Bricolage Grotesque', Georgia, serif;
  font-optical-sizing: auto;
  font-size: 16px;
  font-weight: 650;
  letter-spacing: -0.2px;
  margin-bottom: 6px;
}

.team-card .meta {
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 450;
  letter-spacing: 0.01em;
}

.team-card .delete-btn {
  position: absolute;
  top: 10px; right: 10px;
  background: none; border: none;
  color: var(--text-muted); cursor: pointer;
  font-size: 13px; padding: 4px 6px;
  border-radius: var(--radius-xs); line-height: 1;
  opacity: 0; transition: all var(--transition);
}

.team-card:hover .delete-btn { opacity: 0.6; }
.team-card .delete-btn:hover { opacity: 1; color: var(--danger); background: var(--danger-subtle); }

.add-team-card {
  background: transparent;
  border: 1.5px dashed var(--border);
  border-radius: var(--radius);
  padding: 22px 20px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  color: var(--text-muted);
  font-size: 14px;
  font-weight: 500;
  transition: all var(--transition);
  min-height: 92px;
}

.add-team-card:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--accent-subtle);
}

/* ── TEAM LAYOUT ── */
.team-layout {
  display: grid;
  grid-template-columns: 224px 1fr;
  height: calc(100vh - 52px);
  overflow: hidden;
}

.team-layout.no-sidebar {
  grid-template-columns: 1fr;
}

/* ── SIDEBAR ── */
.sidebar {
  background: var(--surface);
  border-right: 1px solid var(--border-light);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.sidebar-header {
  padding: 14px 16px 12px;
  border-bottom: 1px solid var(--border-light);
  font-weight: 650;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.sidebar-check-actions {
  display: flex;
  gap: 4px;
}

.sidebar-check-actions button {
  background: none;
  border: 1px solid transparent;
  border-radius: var(--radius-xs);
  color: var(--text-muted);
  font-size: 10px;
  font-weight: 600;
  padding: 2px 8px;
  cursor: pointer;
  font-family: inherit;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  transition: all var(--transition);
}

.sidebar-check-actions button:hover {
  color: var(--accent);
  border-color: var(--accent-subtle);
  background: var(--accent-subtle);
}

.member-list { flex: 1; overflow-y: auto; padding: 8px; }

.member-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background var(--transition);
  position: relative;
}

.member-item:hover { background: var(--surface2); }
.member-item.selected {
  background: var(--accent-subtle);
  outline: 1.5px solid var(--accent);
  outline-offset: -1.5px;
}

.member-dot {
  width: 10px; height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
  box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.6);
}

.member-name {
  flex: 1; font-size: 13px; font-weight: 500;
  transition: opacity var(--transition);
  letter-spacing: -0.01em;
}

.member-check {
  appearance: none;
  width: 14px; height: 14px;
  border: 1.5px solid var(--border);
  border-radius: 4px;
  cursor: pointer;
  flex-shrink: 0;
  transition: all var(--transition);
  position: relative;
}

.member-check:checked {
  background: var(--accent);
  border-color: var(--accent);
}

.member-check:checked::after {
  content: '';
  position: absolute;
  left: 3px; top: 1px;
  width: 5px; height: 8px;
  border: 1.5px solid #fff;
  border-top: none; border-left: none;
  transform: rotate(42deg);
}

.member-remove {
  background: none; border: none;
  color: var(--text-muted); cursor: pointer;
  font-size: 12px; padding: 2px 4px;
  border-radius: 4px; opacity: 0;
  transition: all var(--transition); line-height: 1;
}

.member-item:hover .member-remove { opacity: 0.6; }
.member-remove:hover { opacity: 1 !important; color: var(--danger); background: var(--danger-subtle); }

.sidebar-footer {
  padding: 12px;
  border-top: 1px solid var(--border-light);
}

/* ── CALENDAR AREA ── */
.calendar-area {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: var(--bg);
}

/* ── TOOLBAR ── */
.calendar-toolbar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 20px;
  border-bottom: 1px solid var(--border-light);
  background: var(--bg);
  flex-shrink: 0;
}

.week-label {
  font-family: 'Bricolage Grotesque', Georgia, serif;
  font-optical-sizing: auto;
  font-weight: 550;
  font-size: 14px;
  min-width: 200px;
  text-align: center;
  letter-spacing: -0.2px;
  color: var(--text);
}

/* ── VIEW TABS ── */
.view-tabs {
  display: flex;
  gap: 2px;
  background: var(--surface);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  padding: 3px;
}

.view-tab {
  padding: 5px 14px;
  border: none;
  border-radius: var(--radius-xs);
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 12.5px;
  font-weight: 550;
  font-family: inherit;
  transition: all var(--transition);
  letter-spacing: -0.01em;
}

.view-tab:hover { color: var(--text); }
.view-tab.active {
  background: var(--bg);
  color: var(--text);
  box-shadow: var(--shadow-sm);
}

/* ── CALENDAR SCROLL ── */
.calendar-scroll { flex: 1; overflow: auto; }

.calendar-grid {
  display: grid;
  grid-template-columns: 52px repeat(7, 1fr);
  min-width: 700px;
}

.cal-header-cell {
  padding: 10px 6px 8px;
  text-align: center;
  background: var(--bg);
  border-bottom: 1px solid var(--border-light);
  font-size: 12px;
  font-weight: 600;
  position: sticky;
  top: 0;
  z-index: 10;
}

.cal-header-cell .day-name {
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 10px;
  font-weight: 650;
}

.cal-header-cell .day-num {
  font-family: 'Bricolage Grotesque', Georgia, serif;
  font-optical-sizing: auto;
  font-size: 22px;
  font-weight: 550;
  margin-top: 2px;
  color: var(--text);
  letter-spacing: -0.3px;
}

.cal-header-cell.today .day-num {
  color: var(--accent);
}

.cal-header-cell.today .day-name {
  color: var(--accent);
}

.cal-header-spacer {
  background: var(--bg);
  border-bottom: 1px solid var(--border-light);
  position: sticky;
  top: 0;
  z-index: 10;
}

.time-cell {
  height: var(--hour-height);
  display: flex;
  align-items: flex-start;
  justify-content: flex-end;
  padding: 3px 8px 0 0;
  font-size: 10px;
  font-weight: 500;
  color: var(--text-muted);
  border-right: 1px solid var(--border-light);
  letter-spacing: 0.02em;
}

.day-col {
  position: relative;
  border-right: 1px solid var(--border-light);
}

.day-col:last-child { border-right: none; }

.hour-slot {
  height: var(--hour-height);
  border-bottom: 1px solid var(--border-light);
  cursor: pointer;
  transition: background 0.12s ease;
  position: relative;
}

.hour-slot:hover { background: var(--accent-subtle); }

.hour-slot.half-hour::after {
  content: '';
  position: absolute;
  left: 0; right: 0; top: 50%;
  border-bottom: 1px dashed var(--border-light);
  pointer-events: none;
  opacity: 0.7;
}

.schedule-block {
  position: absolute;
  border-radius: var(--radius-sm);
  padding: 4px 7px;
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  overflow: hidden;
  z-index: 5;
  transition: filter var(--transition), transform var(--transition);
  display: flex;
  flex-direction: column;
  box-shadow: 0 1px 4px rgba(28, 25, 22, 0.15);
  user-select: none;
  letter-spacing: -0.01em;
}

.schedule-block:hover { filter: brightness(1.06); transform: scale(0.98); }
.schedule-block .block-name { line-height: 1.3; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.schedule-block .block-time { opacity: 0.75; font-size: 10px; font-weight: 450; margin-top: 1px; }

.drag-ghost {
  position: absolute;
  left: 2px; right: 2px;
  border-radius: var(--radius-sm);
  background: var(--accent-subtle);
  border: 2px dashed var(--accent);
  z-index: 6;
  pointer-events: none;
  animation: ghostPulse 1.5s ease infinite;
}

@keyframes ghostPulse {
  0%, 100% { opacity: 0.8; }
  50% { opacity: 1; }
}

/* ── GRID VIEW ── */
.grid-view-scroll {
  flex: 1;
  overflow: auto;
}

.schedule-grid {
  width: 100%;
  border-collapse: collapse;
  min-width: 600px;
}

.schedule-grid thead th {
  background: var(--bg);
  border-bottom: 1px solid var(--border);
  border-right: 1px solid var(--border-light);
  padding: 10px 14px;
  text-align: center;
  position: sticky;
  top: 0;
  z-index: 10;
}

.schedule-grid thead th:last-child { border-right: none; }
.schedule-grid thead th.today .grid-day-num { color: var(--accent); }
.schedule-grid thead th.today .grid-day-name { color: var(--accent); }

.grid-name-col { width: 160px; min-width: 140px; }

.grid-day-name {
  font-size: 10px;
  font-weight: 650;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
}

.grid-day-num {
  font-family: 'Bricolage Grotesque', Georgia, serif;
  font-optical-sizing: auto;
  font-size: 22px;
  font-weight: 550;
  margin-top: 2px;
  letter-spacing: -0.3px;
}

.schedule-grid tbody tr { border-bottom: 1px solid var(--border-light); }
.schedule-grid tbody tr:last-child { border-bottom: none; }

.grid-person {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 16px;
  font-weight: 550;
  font-size: 13px;
  white-space: nowrap;
  border-right: 1px solid var(--border-light);
  background: var(--surface);
  position: sticky;
  left: 0;
  z-index: 5;
  letter-spacing: -0.01em;
}

.grid-cell {
  padding: 8px;
  text-align: center;
  border-right: 1px solid var(--border-light);
  cursor: pointer;
  transition: background 0.12s ease;
  vertical-align: middle;
  min-width: 110px;
}

.grid-cell:last-child { border-right: none; }
.grid-cell:hover { background: var(--accent-subtle); }

.grid-hours {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  border-radius: var(--radius-sm);
  padding: 6px 10px;
  min-width: 80px;
  box-shadow: 0 1px 4px rgba(28, 25, 22, 0.12);
  transition: transform var(--transition), box-shadow var(--transition);
}

.grid-cell:hover .grid-hours {
  transform: scale(1.03);
  box-shadow: var(--shadow-md);
}

.grid-time { font-size: 11px; opacity: 0.8; font-weight: 400; white-space: nowrap; }
.grid-dur  { font-size: 16px; font-weight: 700; letter-spacing: -0.3px; }

.grid-empty {
  color: var(--border);
  font-size: 18px;
  line-height: 1;
  transition: color var(--transition);
}

.grid-cell:hover .grid-empty { color: var(--accent); }

/* Totals */
.grid-total-col {
  width: 80px;
  min-width: 70px;
  border-left: 2px solid var(--border-light);
}

.grid-total-cell {
  text-align: center;
  border-left: 2px solid var(--border-light);
  background: var(--surface);
}

.grid-total-val {
  font-size: 13px;
  font-weight: 650;
  color: var(--text);
  letter-spacing: -0.02em;
}

.grid-total-zero {
  color: var(--border);
  font-size: 13px;
}

.grid-totals-row td {
  padding: 10px 8px;
  text-align: center;
  border-top: 2px solid var(--border);
  background: var(--surface);
}

.grid-totals-label {
  padding: 10px 16px !important;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  text-align: left !important;
}

.grid-totals-cell .grid-total-val {
  color: var(--accent);
}

.grid-grand-total {
  font-size: 14px;
  font-weight: 700;
  color: var(--accent);
  border-left: 2px solid var(--border-light);
  letter-spacing: -0.02em;
}

/* ── BUTTONS ── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 16px;
  border-radius: var(--radius-sm);
  border: none;
  cursor: pointer;
  font-size: 13px;
  font-weight: 550;
  transition: all var(--transition);
  font-family: inherit;
  letter-spacing: -0.01em;
}

.btn:active { transform: scale(0.97); }

.btn-primary {
  background: var(--accent);
  color: #fff;
  box-shadow: 0 1px 2px rgba(201, 93, 46, 0.2);
}
.btn-primary:hover {
  background: var(--accent-hover);
  box-shadow: 0 2px 8px rgba(201, 93, 46, 0.25);
}

.btn-ghost {
  background: var(--bg);
  color: var(--text);
  border: 1px solid var(--border);
}
.btn-ghost:hover {
  background: var(--surface);
  border-color: var(--border);
}

.btn-icon { padding: 6px 10px; font-size: 16px; }
.btn-sm { padding: 5px 12px; font-size: 12px; }

/* ── MODAL ── */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(28, 25, 22, 0.3);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: fadeIn 0.2s ease;
}

.modal {
  background: var(--bg);
  border: 1px solid var(--border-light);
  border-radius: 16px;
  padding: 28px;
  min-width: 320px;
  max-width: 400px;
  width: 90%;
  box-shadow: var(--shadow-lg);
  animation: modalUp 0.25s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.modal h3 {
  font-family: 'Bricolage Grotesque', Georgia, serif;
  font-optical-sizing: auto;
  font-size: 18px;
  font-weight: 650;
  margin-bottom: 20px;
  letter-spacing: -0.3px;
}

.form-group { margin-bottom: 16px; }
.form-group label {
  display: block; font-size: 11px; color: var(--text-muted);
  margin-bottom: 6px; font-weight: 650;
  text-transform: uppercase; letter-spacing: 0.08em;
}

.form-group input[type="text"],
.form-group select {
  width: 100%;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  color: var(--text);
  font-size: 14px;
  font-family: inherit;
  outline: none;
  transition: border-color var(--transition), box-shadow var(--transition);
}

.form-group input[type="text"]:focus,
.form-group select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-subtle);
}

.color-row { display: flex; gap: 8px; flex-wrap: wrap; }

.color-swatch {
  width: 28px; height: 28px;
  border-radius: 50%;
  cursor: pointer;
  border: 3px solid transparent;
  transition: transform var(--transition), border-color var(--transition);
  box-shadow: 0 1px 3px rgba(28, 25, 22, 0.15);
}

.color-swatch:hover { transform: scale(1.15); }
.color-swatch.selected { border-color: var(--text); }

.modal-actions { display: flex; gap: 8px; justify-content: flex-end; margin-top: 22px; }

/* ── EMPTY STATE ── */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  height: 300px;
  color: var(--text-muted);
  text-align: center;
}

.empty-state .icon { font-size: 36px; opacity: 0.3; }

/* ── HINT ── */
.hint {
  padding: 8px 14px;
  background: var(--accent-subtle);
  border: 1px solid rgba(201, 93, 46, 0.12);
  border-radius: var(--radius-sm);
  font-size: 12px;
  font-weight: 450;
  color: var(--text-muted);
  margin: 12px 20px 0;
}

.hint b { color: var(--text); font-weight: 600; }

/* ── ANIMATIONS ── */
@keyframes cardReveal {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: translateY(0); }
}

@keyframes fadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

@keyframes modalUp {
  from { opacity: 0; transform: translateY(8px) scale(0.98); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

/* ── WEEKLY GRID ── */
.weekly-grid { table-layout: auto; }

.wg-quarter-header {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  border-right: 2px solid var(--border-light);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-muted);
  text-align: center;
  padding: 6px 4px;
}

.wg-week-th {
  min-width: 44px;
  width: 44px;
  padding: 4px 2px;
  text-align: center;
  background: var(--bg);
  border-bottom: 1px solid var(--border-light);
  border-right: 1px solid var(--border-light);
}

.wg-week-th.today { background: var(--accent-subtle); }
.wg-week-th.today .wg-week-num { color: var(--accent); font-weight: 700; }

.wg-week-num {
  font-size: 10px;
  font-weight: 550;
  color: var(--text-muted);
  letter-spacing: 0.01em;
}

.wg-cell {
  min-width: 44px;
  width: 44px;
  padding: 4px 3px;
  text-align: center;
  border-right: 1px solid var(--border-light);
  cursor: pointer;
  transition: background 0.12s ease;
  vertical-align: middle;
}

.wg-cell:hover { background: var(--accent-subtle); }
.wg-cell.current-week { background: rgba(201, 93, 46, 0.03); }

.wg-pill {
  display: inline-block;
  border-radius: 4px;
  padding: 2px 4px;
  font-size: 10px;
  font-weight: 650;
  line-height: 1.4;
  min-width: 28px;
  letter-spacing: -0.02em;
}

/* ── TASK PLANNER VIEW ── */
.task-grid-scroll {
  flex: 1;
  overflow: auto;
}

.task-grid {
  display: grid;
  min-width: max-content;
}

.tg-corner {
  background: var(--bg);
  border-bottom: 1px solid var(--border-light);
  border-right: 1px solid var(--border-light);
  position: sticky;
  left: 0;
  z-index: 12;
}

.tg-day-header {
  background: var(--surface);
  border-bottom: 1px solid var(--border-light);
  border-right: 1px solid var(--border-light);
  padding: 6px 4px;
  text-align: center;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--accent);
  position: sticky;
  top: 0;
  z-index: 11;
}

.tg-member-header {
  background: var(--bg);
  border-bottom: 1px solid var(--border-light);
  border-right: 1px solid var(--border-light);
  display: flex;
  align-items: flex-end;
  justify-content: center;
  height: 40px;
  overflow: hidden;
  position: sticky;
  top: 32px;
  z-index: 11;
}

.tg-member-name {
  writing-mode: vertical-lr;
  transform: rotate(180deg);
  font-size: 10px;
  color: var(--text-muted);
  font-weight: 550;
  white-space: nowrap;
  padding: 3px 0;
}

.tg-time {
  padding: 0 6px;
  font-size: 10px;
  font-weight: 500;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: flex-end;
  border-right: 1px solid var(--border-light);
  border-bottom: 1px solid var(--border-light);
  background: var(--bg);
  position: sticky;
  left: 0;
  z-index: 10;
  min-width: 48px;
  height: 24px;
  letter-spacing: 0.02em;
}

.tg-cell {
  height: 24px;
  border-bottom: 1px solid var(--border-light);
  border-right: 1px solid var(--border-light);
  min-width: 32px;
}

.tg-day-end {
  border-right: 2px solid var(--border);
}

.tg-unscheduled {
  background: repeating-linear-gradient(
    -45deg,
    var(--surface2),
    var(--surface2) 3px,
    var(--border-light) 3px,
    var(--border-light) 4px
  );
  opacity: 0.5;
}

.tg-empty {
  cursor: pointer;
  transition: background 0.1s ease;
}

.tg-empty:hover {
  background: var(--accent-subtle);
}

.tg-assigned {
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: filter var(--transition);
}

.tg-assigned:hover {
  filter: brightness(1.12);
}

.tg-task-label {
  font-size: 9px;
  font-weight: 650;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
  padding: 0 2px;
  line-height: 1;
}

.tg-drag-ghost {
  background: var(--accent-subtle) !important;
  outline: 2px dashed var(--accent);
  outline-offset: -2px;
}

.tg-legend {
  padding: 10px 20px;
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  font-size: 12px;
  border-top: 1px solid var(--border-light);
  background: var(--bg);
  align-items: center;
}

.tg-legend-item {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--text-muted);
  font-weight: 450;
}

.tg-legend-item strong {
  color: var(--text);
  font-weight: 650;
}

.tg-legend-swatch {
  width: 10px;
  height: 10px;
  border-radius: 3px;
  flex-shrink: 0;
}

/* Task popup */
.tg-popup {
  position: fixed;
  background: var(--bg);
  border: 1px solid var(--border-light);
  border-radius: var(--radius);
  padding: 8px;
  min-width: 200px;
  max-width: 280px;
  box-shadow: var(--shadow-lg);
  z-index: 300;
  animation: modalUp 0.15s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.tg-popup-header {
  font-size: 11px;
  font-weight: 650;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 6px 8px 8px;
}

.tg-popup-task {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 8px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 13px;
  font-weight: 500;
  transition: background 0.12s ease;
}

.tg-popup-task:hover {
  background: var(--surface);
}

.tg-popup-delete {
  color: var(--danger);
}
.tg-popup-delete:hover {
  background: var(--danger-subtle);
}

.tg-popup-swatch {
  width: 14px;
  height: 14px;
  border-radius: 4px;
  flex-shrink: 0;
}

.tg-popup-new {
  display: flex;
  gap: 6px;
  padding: 8px 4px 4px;
  border-top: 1px solid var(--border-light);
  margin-top: 4px;
}

.tg-popup-new input {
  flex: 1;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-xs);
  padding: 6px 10px;
  font-size: 12px;
  color: var(--text);
  font-family: inherit;
  outline: none;
  transition: border-color var(--transition);
}

.tg-popup-new input:focus {
  border-color: var(--accent);
}

/* Task library modal */
.task-lib-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 4px;
  border-radius: var(--radius-xs);
}

.task-lib-row:hover {
  background: var(--surface);
}

.task-lib-swatch {
  width: 22px;
  height: 22px;
  cursor: pointer;
  flex-shrink: 0;
}

.task-lib-name {
  flex: 1;
  background: transparent;
  border: 1px solid transparent;
  border-radius: var(--radius-xs);
  padding: 4px 8px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text);
  font-family: inherit;
  outline: none;
  transition: all var(--transition);
}

.task-lib-name:hover,
.task-lib-name:focus {
  background: var(--surface);
  border-color: var(--border);
}

.task-lib-add {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 4px 4px;
  margin-top: 8px;
  border-top: 1px solid var(--border-light);
}

.task-lib-add input {
  flex: 1;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-xs);
  padding: 6px 10px;
  font-size: 13px;
  color: var(--text);
  font-family: inherit;
  outline: none;
  transition: border-color var(--transition);
}

.task-lib-add input:focus {
  border-color: var(--accent);
}

/* ── SCROLLBAR ── */
::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-muted); }

/* ── HUB ── */
.hub {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: calc(100vh - 52px);
  padding: 32px 24px;
}

.hub-title {
  font-family: 'Bricolage Grotesque', Georgia, serif;
  font-optical-sizing: auto;
  font-size: 36px;
  font-weight: 750;
  color: var(--text);
  letter-spacing: -0.8px;
  margin-bottom: 4px;
}

.hub-subtitle {
  color: var(--text-muted);
  font-size: 15px;
  font-weight: 400;
  margin-bottom: 48px;
  letter-spacing: -0.01em;
}

.hub-tools {
  display: flex;
  gap: 20px;
  justify-content: center;
  flex-wrap: wrap;
}

.tool-card {
  background: var(--surface);
  border: 1px solid var(--border-light);
  border-radius: var(--radius);
  padding: 28px 24px;
  width: 200px;
  text-align: center;
  cursor: pointer;
  transition: all var(--transition);
  box-shadow: var(--shadow-xs);
  animation: cardReveal 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94) both;
}

.tool-card:nth-child(2) { animation-delay: 0.06s; }
.tool-card:nth-child(3) { animation-delay: 0.12s; }

.tool-card:hover {
  border-color: var(--accent);
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
  background: var(--bg);
}

.tool-card .tool-icon {
  font-size: 28px;
  margin-bottom: 14px;
}

.tool-card .tool-name {
  font-family: 'Bricolage Grotesque', Georgia, serif;
  font-optical-sizing: auto;
  font-size: 16px;
  font-weight: 650;
  margin-bottom: 6px;
  letter-spacing: -0.2px;
}

.tool-card .tool-desc {
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 400;
  line-height: 1.4;
}

.tool-card.coming-soon {
  background: transparent;
  border: 1.5px dashed var(--border);
  cursor: default;
  opacity: 0.45;
}

.tool-card.coming-soon:hover {
  border-color: var(--border);
  transform: none;
  box-shadow: none;
  background: transparent;
}

.tool-card.coming-soon .tool-name {
  color: var(--text-muted);
}

/* ── LOGIN ── */
.login-screen {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 32px 24px;
  background: var(--bg);
}

.login-card {
  background: var(--bg);
  border: 1px solid var(--border-light);
  border-radius: 16px;
  padding: 44px 36px;
  width: 100%;
  max-width: 380px;
  text-align: center;
  box-shadow: var(--shadow-lg);
}

.login-card .login-title {
  font-family: 'Bricolage Grotesque', Georgia, serif;
  font-optical-sizing: auto;
  font-size: 28px;
  font-weight: 750;
  color: var(--text);
  letter-spacing: -0.5px;
  margin-bottom: 6px;
}

.login-card .login-subtitle {
  color: var(--text-muted);
  font-size: 14px;
  font-weight: 400;
  margin-bottom: 32px;
}

.login-card .login-input {
  width: 100%;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 11px 14px;
  color: var(--text);
  font-size: 14px;
  font-family: inherit;
  outline: none;
  transition: border-color var(--transition), box-shadow var(--transition);
  margin-bottom: 12px;
}

.login-card .login-input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-subtle);
}

.login-card .login-input::placeholder {
  color: var(--text-muted);
  opacity: 0.6;
}

.login-card .login-btn {
  width: 100%;
  padding: 11px 16px;
  border-radius: var(--radius-sm);
  border: none;
  background: var(--accent);
  color: #fff;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  transition: all var(--transition);
  box-shadow: 0 1px 3px rgba(201, 93, 46, 0.2);
  margin-top: 4px;
}

.login-card .login-btn:hover {
  background: var(--accent-hover);
  box-shadow: 0 2px 8px rgba(201, 93, 46, 0.3);
}

.login-card .login-btn:disabled {
  opacity: 0.5;
  cursor: default;
}

.login-card .login-msg {
  margin-top: 18px;
  font-size: 13px;
  color: var(--text-muted);
}

.login-card .login-error {
  margin-top: 18px;
  font-size: 13px;
  color: var(--danger);
  font-weight: 500;
}

.user-bar {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 12px;
  color: var(--text-muted);
  font-weight: 450;
}

.user-bar .signout-btn {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 12px;
  font-family: inherit;
  text-decoration: none;
  padding: 2px 6px;
  border-radius: var(--radius-xs);
  transition: all var(--transition);
  font-weight: 500;
}

.user-bar .signout-btn:hover {
  color: var(--accent);
  background: var(--accent-subtle);
}

/* ── FORECAST ── */
#forecast-root {
  min-height: 100vh;
}
