/* Layout */
#app {
  min-height: 100vh;
  width: 100%;
  padding-bottom: 100px;
}

.container {
  max-width: none;
  margin: 0 auto;
  padding: 24px 24px 40px;
}

/* Header */
.app-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
  flex-wrap: wrap;
}

.header-left {
  display: flex;
  align-items: baseline;
  gap: 12px;
  flex-wrap: wrap;
}

.app-header h1 {
  font-size: clamp(22px, 4vw, 28px);
  font-weight: 700;
  letter-spacing: -0.5px;
  margin: 0;
}

.header-stats {
  font-size: 13px;
  color: var(--text-tertiary);
}

.datetime {
  font-size: 13px;
  color: var(--text-secondary);
  font-variant-numeric: tabular-nums;
}

/* Category bar */
.category-bar {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 10px;
  margin-bottom: 14px;
  scrollbar-width: none;
}

.category-bar::-webkit-scrollbar {
  display: none;
}

.category-chip {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border-radius: var(--radius-pill);
  padding: 6px 14px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  border: 1px solid var(--border);
  background: var(--surface);
  color: #555;
  transition: all var(--transition);
}

.category-chip:hover {
  background: var(--surface-2);
}

.category-chip.active {
  border-color: currentColor;
  color: white;
}

.category-chip .count {
  font-size: 11px;
  border-radius: var(--radius-pill);
  padding: 1px 6px;
  background: #f0f0f0;
  color: #888;
}

.category-chip.active .count {
  background: rgba(255, 255, 255, 0.25);
  color: white;
}

.cat-Casa.active { background: var(--casa); border-color: var(--casa); }
.cat-Orwee.active { background: var(--orwee); border-color: var(--orwee); }
.cat-BS.active { background: var(--bs); border-color: var(--bs); }
.cat-Jobs.active { background: var(--jobs); border-color: var(--jobs); }
.cat-Personal.active { background: var(--personal); border-color: var(--personal); }
.cat-Otros.active { background: var(--otros); border-color: var(--otros); }

/* Toolbar */
.view-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 22px;
  overflow-x: auto;
  scrollbar-width: none;
}

.view-toolbar::-webkit-scrollbar {
  display: none;
}

.view-toolbar .category-bar {
  display: flex;
  gap: 8px;
  flex: 1 1 auto;
  justify-content: flex-end;
  min-width: 0;
  margin-bottom: 0;
  padding-bottom: 0;
  overflow-x: auto;
}

.view-tabs {
  display: inline-flex;
  border-radius: var(--radius);
  background: var(--surface);
  border: 1px solid var(--border);
  padding: 3px;
  box-shadow: var(--shadow);
  flex-shrink: 0;
}

.view-tab {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  border-radius: 8px;
  padding: 7px 14px;
  font-size: 13px;
  font-weight: 500;
  border: none;
  background: transparent;
  color: #666;
  cursor: pointer;
  transition: all var(--transition);
}

.view-tab:hover {
  color: var(--text);
}

.view-tab.active {
  background: var(--text);
  color: white;
}

.view-tab .badge {
  font-size: 10px;
  border-radius: var(--radius-pill);
  padding: 0 5px;
  background: #e8e8e8;
  color: #888;
}

.view-tab.active .badge {
  background: rgba(255, 255, 255, 0.25);
  color: white;
}

/* Content */
.content {
  min-height: 200px;
}

/* Cards */
.task-card {
  background: var(--surface);
  border-radius: var(--radius);
  border: 1px solid #e8e8e8;
  box-shadow: var(--shadow);
  overflow: hidden;
  transition: box-shadow var(--transition), transform var(--transition);
  cursor: pointer;
}

.task-card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-1px);
}

.task-card-inner {
  display: flex;
}

.task-card-bar {
  width: 4px;
  flex-shrink: 0;
}

.task-card-body {
  flex: 1;
  padding: 12px 14px;
  min-width: 0;
}

.task-title {
  font-size: 13px;
  font-weight: 600;
  line-height: 1.4;
  margin: 0 0 8px;
  word-break: break-word;
  color: var(--text);
}

.task-card.done .task-title {
  text-decoration: line-through;
  color: var(--text-tertiary);
}

.task-card.archived .task-title {
  text-decoration: line-through;
  color: #999;
}

.task-description {
  font-size: 11px;
  color: var(--text-tertiary);
  line-height: 1.4;
  margin: -4px 0 8px;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.task-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  font-size: 11px;
  color: var(--text-tertiary);
  margin-bottom: 10px;
}

.task-meta span {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.task-category {
  font-weight: 600;
}

.task-controls {
  display: flex;
  align-items: center;
  gap: 6px;
  padding-top: 10px;
  border-top: 1px solid #f0f0f0;
  flex-wrap: wrap;
}

.task-controls select,
.task-controls a {
  font-size: 11px;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: var(--surface-3);
  padding: 4px 7px;
  color: #555;
  cursor: pointer;
  flex: 1;
  min-width: 80px;
  text-decoration: none;
}

.task-controls select.priority-high {
  border-color: var(--priority-high);
  background: rgba(214, 69, 69, 0.08);
  color: var(--priority-high);
  font-weight: 600;
}

.task-controls select.priority-medium {
  border-color: var(--priority-medium);
  background: rgba(216, 154, 43, 0.08);
  color: var(--priority-medium);
  font-weight: 600;
}

.task-controls select.priority-low {
  border-color: var(--priority-low);
  background: rgba(91, 138, 114, 0.08);
  color: var(--priority-low);
  font-weight: 600;
}

/* Category colors */
.cat-Casa { color: var(--casa); }
.cat-Orwee { color: var(--orwee); }
.cat-BS { color: var(--bs); }
.cat-Jobs { color: var(--jobs); }
.cat-Personal { color: var(--personal); }
.cat-Otros { color: var(--otros); }

.bg-Casa { background: var(--casa); }
.bg-Orwee { background: var(--orwee); }
.bg-BS { background: var(--bs); }
.bg-Jobs { background: var(--jobs); }
.bg-Personal { background: var(--personal); }
.bg-Otros { background: var(--otros); }

/* Subtasks inside card */
.card-subtasks {
  margin: 4px 0 0 0;
  padding: 0 0 0 18px;
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.card-subtasks li {
  font-size: 12px;
  color: var(--text-secondary);
  position: relative;
}

.card-subtasks li::before {
  content: "";
  position: absolute;
  left: -14px;
  top: 5px;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--border-strong);
}

.card-subtasks li.done {
  text-decoration: line-through;
  color: var(--text-tertiary);
}

/* Board / Kanban */
.board-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 12px;
}

.board-column {
  background: rgba(255, 255, 255, 0.6);
  border-radius: var(--radius-lg);
  border: 1px solid rgba(0, 0, 0, 0.06);
  padding: 12px;
  min-height: 120px;
}

.board-column-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
  padding: 0 2px;
}

.board-column-title {
  font-size: 13px;
  font-weight: 700;
}

.board-column-count {
  font-size: 11px;
  color: #bbb;
}

.board-add {
  background: none;
  border: none;
  cursor: pointer;
  color: #bbb;
  display: flex;
  padding: 2px;
}

.board-add:hover {
  color: var(--text-secondary);
}

.board-cards {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

/* Today view */
.today-view {
  width: 100%;
}

.today-columns {
  display: grid;
  grid-template-columns: 1fr minmax(200px, 0.65fr) 1fr;
  gap: 24px;
  align-items: start;
}

.today-section {
  margin-bottom: 0;
  min-width: 0;
}

.today-section .today-grid {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.section-label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.07em;
  color: #aaa;
  text-transform: uppercase;
  margin-bottom: 12px;
}

.today-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
}

.today-agenda {
  background: var(--surface);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  padding: 12px;
  margin-top: 0;
  max-height: calc(100vh - 210px);
  overflow-y: auto;
}

.agenda-slot {
  display: flex;
  align-items: center;
  min-height: 32px;
  border-bottom: 1px solid #f0f0f0;
}

.agenda-slot:last-child {
  border-bottom: none;
}

.agenda-time {
  width: 38px;
  flex-shrink: 0;
  font-size: 10px;
  color: var(--text-tertiary);
  text-align: right;
  padding-right: 8px;
  font-variant-numeric: tabular-nums;
}

.agenda-content {
  flex: 1;
  padding: 3px 0;
}

.agenda-event {
  display: flex;
  align-items: center;
  gap: 6px;
  background: var(--surface-2);
  border-left: 3px solid var(--accent);
  border-radius: 5px;
  padding: 4px 8px;
  font-size: 11px;
  font-weight: 500;
  cursor: pointer;
}

.agenda-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  flex-shrink: 0;
}

/* Orwee view */
.orwee-view {
  display: grid;
  grid-template-columns: 320px 1fr;
  gap: 20px;
  align-items: start;
}

.client-list-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.client-form {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 14px;
}

.client-form input {
  padding: 8px 10px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--surface);
  font-size: 12px;
  outline: none;
}

.client-form input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.client-form-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

.client-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px;
  cursor: pointer;
  transition: border-color var(--transition), box-shadow var(--transition);
}

.client-card:hover,
.client-card.active {
  border-color: var(--accent);
  box-shadow: var(--shadow-md);
}

.client-card h4 {
  margin: 0 0 4px;
  font-size: 14px;
  font-weight: 600;
}

.client-card p {
  margin: 0;
  font-size: 12px;
  color: var(--text-secondary);
}

.client-detail {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px;
  min-height: 0;
  overflow-y: auto;
}

.client-detail-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 20px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border);
}

.client-detail-header > div {
  flex: 1;
  min-width: 0;
}

.client-title-input {
  width: 100%;
  font-size: 18px;
  font-weight: 700;
  background: transparent;
  border: none;
  border-bottom: 2px solid var(--border);
  padding-bottom: 6px;
  outline: none;
  color: var(--text);
  margin-bottom: 10px;
}

.client-title-input:focus {
  border-color: var(--accent);
}

.client-contact-fields {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.client-contact-fields input {
  padding: 7px 9px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--surface);
  font-size: 12px;
  outline: none;
}

.client-contact-fields input:focus {
  border-color: var(--accent);
}

.client-detail-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.client-tasks-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.client-tasks-header h4 {
  margin: 0;
  font-size: 14px;
  font-weight: 600;
}

.client-tasks {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

/* Ideas view */
.ideas-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 10px;
}

.idea-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 16px;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
}

.idea-card p {
  margin: 0;
  font-size: 13px;
  font-weight: 500;
}

.idea-actions {
  display: flex;
  gap: 6px;
  flex-shrink: 0;
}

/* Config / Command center */
.config-description {
  color: var(--text-secondary);
  margin: -12px 0 24px;
  font-size: 14px;
}

.config-section {
  margin-bottom: 32px;
}

.config-section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 14px;
}

.config-section-title {
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-secondary);
  margin: 0;
  font-weight: 700;
}

.category-boards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 14px;
}

.category-board {
  background: rgba(255, 255, 255, 0.6);
  border: 1px solid rgba(0, 0, 0, 0.06);
  border-radius: var(--radius-lg);
  padding: 14px;
}

.category-board h4 {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin: 0 0 12px;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  gap: 6px;
}

.category-board h4 .dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
}

.mini-task {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 8px 10px;
  margin-bottom: 6px;
  font-size: 12px;
  cursor: pointer;
  transition: border-color var(--transition);
}

.mini-task:hover {
  border-color: var(--border-strong);
}

.mini-task.done {
  opacity: 0.55;
  text-decoration: line-through;
}

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

.board-inner-column {
  background: var(--surface-2);
  border-radius: 8px;
  padding: 8px;
  min-height: 80px;
}

.board-inner-column h5 {
  margin: 0 0 6px;
  font-size: 10px;
  text-transform: uppercase;
  color: var(--text-tertiary);
  letter-spacing: 0.4px;
}

/* Calendar */
.calendar {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 16px;
}

.calendar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.calendar-header h4 {
  margin: 0;
  font-size: 15px;
  font-weight: 600;
}

.calendar-nav {
  display: flex;
  gap: 6px;
}

.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
}

.calendar-day-label {
  text-align: center;
  font-size: 10px;
  font-weight: 700;
  color: var(--text-tertiary);
  padding: 8px 0;
  text-transform: uppercase;
}

.calendar-day {
  aspect-ratio: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  font-size: 13px;
  cursor: pointer;
  position: relative;
}

.calendar-day:hover {
  background: var(--surface-2);
}

.calendar-day.today {
  background: var(--accent-soft);
  color: var(--accent);
  font-weight: 700;
}

.calendar-day.has-tasks::after {
  content: "";
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--accent);
  position: absolute;
  bottom: 5px;
}

.calendar-day.other-month {
  color: var(--text-tertiary);
}

/* Calendar view */
.calendar-view {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.calendar-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.calendar-nav {
  display: flex;
  gap: 6px;
}

.calendar-mode {
  display: flex;
  align-items: center;
  gap: 6px;
}

.calendar-mode .view-tab {
  padding: 6px 12px;
  font-size: 12px;
}

.calendar-mode input[type="number"] {
  width: 48px;
  padding: 6px 8px;
  border-radius: 8px;
  border: 1px solid var(--border);
  font-size: 12px;
  text-align: center;
}

.calendar-mode-label {
  font-size: 12px;
  color: var(--text-secondary);
}

.calendar-month-header,
.calendar-week-header,
.calendar-custom-header {
  font-size: 16px;
  font-weight: 700;
  margin-bottom: 8px;
}

.calendar-day-cell {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  min-height: 100px;
  padding: 8px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.calendar-day-cell.today {
  background: var(--accent-soft);
  border-color: var(--accent);
}

.calendar-day-cell.other-month {
  opacity: 0.5;
}

.calendar-day-number {
  font-size: 12px;
  font-weight: 700;
  color: var(--text-secondary);
}

.calendar-day-cell.today .calendar-day-number {
  color: var(--accent);
}

.calendar-day-tasks {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.calendar-task {
  font-size: 11px;
  padding: 3px 6px;
  border-radius: 5px;
  background: color-mix(in srgb, var(--task-color) 12%, transparent);
  border-left: 3px solid var(--task-color);
  cursor: pointer;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.calendar-task:hover {
  filter: brightness(0.95);
}

.calendar-week .calendar-day-cell,
.calendar-custom .calendar-day-cell {
  min-height: 140px;
}

/* Overdue section in Today */
.overdue-section {
  margin-bottom: 12px;
}

/* Bottom bar */
.bottom-bar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 40;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(12px);
  border-top: 1px solid var(--border);
  padding: 12px 20px;
  box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.06);
}

.bottom-bar-inner {
  max-width: 1140px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 10px;
}

.ai-badge {
  display: flex;
  align-items: center;
  gap: 5px;
  flex-shrink: 0;
  color: var(--orwee);
}

.ai-badge span {
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}

.ai-badge svg {
  stroke: var(--orwee);
}

.quickadd-input-wrap {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 6px;
  background: var(--surface-2);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  padding: 4px 4px 4px 14px;
  transition: border-color var(--transition);
  min-width: 0;
}

.quickadd-input-wrap:focus-within {
  border-color: var(--orwee);
}

.quickadd-input-wrap input {
  flex: 1;
  font-size: 13px;
  background: transparent;
  border: none;
  outline: none;
  color: var(--text);
  min-width: 0;
  padding: 5px 0;
}

.mic-btn {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: 8px;
  border: none;
  background: #e8e8e8;
  color: #666;
  cursor: pointer;
  transition: all var(--transition);
}

.mic-btn:hover {
  background: #ddd;
}

.mic-btn.listening {
  background: var(--jobs);
  color: white;
  animation: pulse 1.2s infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

.btn-add {
  flex-shrink: 0;
  padding: 9px 18px;
  white-space: nowrap;
}

.btn-add:disabled {
  background: #ccc;
  cursor: not-allowed;
}

.fab-bottom {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: none;
  background: var(--text);
  color: white;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: var(--shadow-md);
  flex-shrink: 0;
  transition: transform var(--transition), background var(--transition);
}

.fab-bottom:hover {
  transform: scale(1.05);
  background: #000;
}

.ai-message {
  position: absolute;
  bottom: 68px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--text);
  color: white;
  border-radius: var(--radius);
  padding: 8px 16px;
  font-size: 13px;
  font-weight: 500;
  white-space: nowrap;
  box-shadow: var(--shadow-md);
  display: none;
}

.ai-message.show {
  display: block;
}

/* Drawers & modals */
.modal-overlay,
.drawer-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.28);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 100;
  opacity: 0;
  transition: opacity var(--transition);
}

.modal-overlay.open,
.drawer-overlay.open {
  display: flex;
  opacity: 1;
}

.modal {
  background: var(--surface);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  width: 100%;
  max-width: 420px;
  max-height: 90vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.modal-sm {
  max-width: 380px;
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 20px 0;
}

.modal-header h3 {
  margin: 0;
  font-size: 17px;
  font-weight: 700;
}

.modal-body {
  padding: 18px 20px;
}

.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  padding: 0 20px 20px;
}

.drawer {
  position: fixed;
  right: 0;
  top: 0;
  bottom: 0;
  width: 460px;
  max-width: 92vw;
  background: var(--surface-2);
  box-shadow: var(--shadow-lg);
  display: flex;
  flex-direction: column;
  transform: translateX(100%);
  transition: transform var(--transition);
}

.drawer-overlay.open .drawer {
  transform: translateX(0);
}

.drawer-wide {
  width: 520px;
}

.drawer-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 20px;
  border-bottom: 1px solid var(--border);
}

.drawer-sticky {
  background: rgba(245, 245, 243, 0.96);
  backdrop-filter: blur(8px);
  position: sticky;
  top: 0;
  z-index: 10;
}

.drawer-header span {
  font-size: 14px;
  font-weight: 700;
}

.drawer-body {
  flex: 1;
  overflow-y: auto;
  padding: 22px 24px;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.drawer-footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  padding: 12px 20px;
  border-top: 1px solid var(--border);
}

/* Forms */
.title-input {
  width: 100%;
  font-size: 18px;
  font-weight: 700;
  background: transparent;
  border: none;
  border-bottom: 2px solid var(--border);
  padding-bottom: 8px;
  outline: none;
  color: var(--text);
}

.title-input:focus {
  border-color: var(--accent);
}

.field label {
  display: block;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-tertiary);
  margin-bottom: 6px;
}

.select-input,
input[type="date"],
input[type="datetime-local"],
textarea,
#task-title {
  width: 100%;
  padding: 8px 10px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  outline: none;
  font-size: 13px;
  transition: border-color var(--transition), box-shadow var(--transition);
}

.select-input:focus,
input[type="date"]:focus,
input[type="datetime-local"]:focus,
textarea:focus,
#task-title:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

textarea {
  resize: vertical;
  font-family: inherit;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

/* Pills */
.category-pills,
.estimate-pills,
.tag-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.category-pills button,
.estimate-pills button,
.tag-pills button {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  border-radius: var(--radius-pill);
  padding: 5px 11px;
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  border: 1px solid var(--border);
  background: var(--surface);
  color: #555;
  transition: all var(--transition);
}

.category-pills button:hover,
.estimate-pills button:hover,
.tag-pills button:hover {
  background: var(--surface-3);
}

.category-pills button.active {
  color: white;
}

.estimate-pills button.active,
.tag-pills button.active {
  background: var(--text);
  color: white;
  border-color: var(--text);
}

.custom-estimate {
  margin-top: 8px;
  font-size: 12px;
  padding: 7px 10px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  outline: none;
  width: 100%;
}

.custom-estimate:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

/* Subtasks in drawer */
.subtask-list {
  display: flex;
  flex-direction: column;
  gap: 5px;
  margin-bottom: 8px;
}

.subtask-item {
  display: flex;
  align-items: center;
  gap: 8px;
}

.subtask-check {
  width: 16px;
  height: 16px;
  border-radius: 4px;
  border: 1px solid #ccc;
  background: white;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
}

.subtask-check.done {
  background: var(--accent);
  border-color: var(--accent);
}

.subtask-check svg {
  color: white;
  width: 11px;
  height: 11px;
}

.subtask-text {
  flex: 1;
  font-size: 13px;
  color: var(--text);
}

.subtask-text.done {
  text-decoration: line-through;
  color: var(--text-tertiary);
}

.subtask-delete {
  background: none;
  border: none;
  cursor: pointer;
  color: #ccc;
  display: flex;
  padding: 2px;
}

.subtask-delete:hover {
  color: var(--priority-high);
}

.subtask-add {
  display: flex;
  gap: 6px;
}

.subtask-add input {
  flex: 1;
  font-size: 12px;
  padding: 6px 10px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--surface);
  outline: none;
}

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

.subtask-add button {
  padding: 5px 10px;
}

/* Validation preview */
.validation-preview {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px;
  margin-bottom: 14px;
}

.validation-preview .row {
  display: flex;
  justify-content: space-between;
  padding: 6px 0;
  border-bottom: 1px solid var(--border);
  font-size: 13px;
}

.validation-preview .row:last-child {
  border-bottom: none;
}

.validation-preview .label {
  color: var(--text-secondary);
}

.validation-preview .value {
  font-weight: 600;
}

/* Buttons */
.btn-primary,
.btn-secondary,
.btn-ghost,
.btn-text-danger {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  padding: 8px 16px;
  border-radius: 8px;
  border: 1px solid transparent;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition);
}

.btn-primary {
  background: var(--text);
  color: white;
}

.btn-primary:hover:not(:disabled) {
  background: #000;
}

.btn-secondary {
  background: var(--surface);
  color: var(--text);
  border-color: var(--border);
}

.btn-secondary:hover {
  background: var(--surface-2);
}

.btn-ghost {
  background: transparent;
  color: var(--text-secondary);
  border-color: var(--border);
}

.btn-ghost:hover {
  background: var(--surface-2);
}

.btn-text-danger {
  background: transparent;
  color: var(--priority-high);
  border-color: transparent;
  padding: 6px 9px;
}

.btn-text-danger:hover {
  background: rgba(214, 69, 69, 0.08);
}

.btn-icon {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  border: none;
  background: transparent;
  color: #888;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.btn-icon:hover {
  background: var(--surface-2);
  color: var(--text);
}

/* Utilities */
.hidden {
  display: none !important;
}

.muted {
  color: var(--text-secondary);
  font-size: 14px;
  margin-top: 0;
}

.empty-state {
  background: var(--surface);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  padding: 40px;
  text-align: center;
  font-size: 14px;
  color: var(--text-tertiary);
}

.empty-state svg {
  display: block;
  margin: 0 auto 12px;
  opacity: 0.3;
}

.client-list-panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 16px;
  height: fit-content;
}

.toggle-label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 500;
  color: var(--text-secondary);
  cursor: pointer;
}

.toggle-label input {
  width: 14px;
  height: 14px;
  accent-color: var(--accent);
}

/* Archive */
.archive-grid {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.archive-group h3 {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin: 0 0 10px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.archive-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 8px;
}

/* Responsive */
@media (max-width: 900px) {
  .orwee-view {
    grid-template-columns: 1fr;
  }

  .board-inner-columns {
    grid-template-columns: 1fr;
  }

  .category-boards {
    grid-template-columns: 1fr;
  }

  .today-columns {
    grid-template-columns: 1fr;
  }

  .today-agenda {
    max-height: none;
  }

  .agenda-timeline { padding-left: 34px; }
  .agenda-blocks { left: 34px; }
  .agenda-hlabel { width: 28px; font-size: 9px; padding-right: 4px; }
  .agenda-now { left: 28px; }
  .agenda-block { padding: 3px 6px; font-size: 10px; }
  .agenda-block-title { font-size: 10px; }
  .agenda-block-time { font-size: 8px; }
  .agenda-block-dur { font-size: 8px; }
}

@media (max-width: 600px) {
  .container {
    padding: 16px 12px 100px;
  }

  .view-toolbar {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
  }

  .view-tabs,
  .view-toolbar .category-bar {
    width: 100%;
    justify-content: flex-start;
    overflow-x: auto;
  }

  .view-tabs {
    overflow-x: auto;
  }

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

  .bottom-bar-inner {
    padding: 0;
  }

  .ai-badge span {
    display: none;
  }

  .today-agenda { padding: 8px; }
  .agenda-timeline { padding-left: 28px; }
  .agenda-blocks { left: 28px; }
  .agenda-hlabel { width: 24px; font-size: 8px; padding-right: 3px; }
  .agenda-now { left: 24px; }
  .agenda-block { padding: 2px 5px; font-size: 9px; border-radius: 4px; }
  .agenda-block.tight { padding: 1px 4px; }
  .agenda-block-title { font-size: 9px; }
}

/* auth bar */
.auth-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
}
.auth-user {
  font-size: 13px;
  color: var(--text-muted, #888);
  margin-right: 4px;
  max-width: 220px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.auth-bar .btn-sm {
  padding: 4px 10px;
  font-size: 12px;
}

/* login modal extras */
.login-providers {
  margin-bottom: 16px;
}
.btn-google {
  width: 100%;
  background: #1a73e8;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 16px;
}
.btn-google:hover:not(:disabled) {
  background: #1557b0;
}
.login-divider {
  text-align: center;
  position: relative;
  margin: 16px 0 8px;
  color: var(--text-muted, #888);
  font-size: 12px;
}
.login-divider::before,
.login-divider::after {
  content: "";
  position: absolute;
  top: 50%;
  width: 38%;
  height: 1px;
  background: var(--border, #e2e2e2);
}
.login-divider::before { left: 0; }
.login-divider::after  { right: 0; }
.login-divider span {
  background: var(--bg-modal, #fff);
  padding: 0 8px;
  position: relative;
  z-index: 1;
}
.login-error {
  min-height: 18px;
  margin: 4px 0 0;
  color: var(--danger, #d33);
  font-size: 12px;
}

/* Reminders badge + drawer */
.reminders-count {
  background: var(--danger, #d33);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  line-height: 1;
  padding: 2px 5px;
  border-radius: 999px;
  margin-left: 4px;
}
.reminder-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border, #eee);
}
.reminder-item:last-child { border-bottom: none; }
.reminder-info { flex: 1; min-width: 0; }
.reminder-title {
  font-weight: 500;
  font-size: 14px;
  margin-bottom: 4px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.reminder-meta {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
}
.reminder-notes {
  color: var(--text-muted, #888);
  font-style: italic;
}
.reminder-actions {
  display: flex;
  gap: 4px;
}
.cat-pill {
  display: inline-block;
  padding: 1px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 500;
  background: var(--chip, #eee);
  color: var(--text, #333);
}

/* Notifications config panel */
.notif-config { padding: 16px; max-width: 480px; margin: 0 auto; }
.notif-intro { margin-bottom: 20px; font-size: 13px; }
.notif-config .field { margin-bottom: 18px; }
.notif-config .day-pills { display: flex; gap: 6px; flex-wrap: wrap; }
.day-pill {
  padding: 6px 12px;
  border: 1px solid var(--border, #e0e0e0);
  background: var(--surface, #fff);
  color: var(--text-muted, #888);
  border-radius: 999px;
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s;
}
.day-pill:hover { background: var(--surface-2, #f6f6f6); }
.day-pill.active {
  background: var(--primary, #1a73e8);
  color: #fff;
  border-color: transparent;
}
.notif-tz-note { font-size: 11px; opacity: 0.7; margin-top: -8px; }
.notif-actions { display: flex; gap: 8px; margin-top: 20px; }
.notif-actions button { flex: 1; }
.notif-status { min-height: 18px; margin-top: 10px; font-size: 12px; color: var(--text-muted, #888); }

/* ===== Reminders / follow-ups panel ===== */
.reminders-btn { position: relative; }
.reminders-badge {
  position: absolute;
  top: -6px;
  right: -6px;
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  border-radius: 999px;
  background: var(--danger, #e5484d);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  line-height: 16px;
  text-align: center;
}
.reminders-panel { padding: 4px 0 24px; }
.rp-section { padding: 8px 16px 20px; }
.rp-section + .rp-section { border-top: 1px solid var(--border, #eee); padding-top: 18px; }
.rp-section-head { margin-bottom: 12px; }
.rp-section-head h4 {
  display: flex;
  align-items: center;
  gap: 7px;
  margin: 0;
  font-size: 13px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted, #888);
}

.followup-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 0;
  border-bottom: 1px solid var(--border, #eee);
}
.followup-item:last-child { border-bottom: none; }
.followup-main { flex: 1; min-width: 0; }
.followup-title { font-weight: 600; font-size: 14px; margin-bottom: 5px; }
.followup-meta { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 4px; }
.followup-sched { font-size: 11px; color: var(--text-muted, #888); font-weight: 500; }
.followup-notes { font-size: 12px; color: var(--text-muted, #888); font-style: italic; margin-bottom: 8px; }
.followup-edit {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
  margin-top: 6px;
  font-size: 12px;
  color: var(--text-muted, #888);
}
.followup-edit label { display: flex; align-items: center; gap: 5px; }
.followup-edit select {
  padding: 3px 6px;
  border: 1px solid var(--border, #e0e0e0);
  border-radius: 6px;
  background: var(--surface, #fff);
  color: var(--text, #333);
  font-size: 12px;
}
.followup-actions { display: flex; flex-direction: column; gap: 4px; }

/* Collapsible notification settings */
.rp-collapsible { padding-top: 14px; }
.rp-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  background: none;
  border: none;
  padding: 4px 0;
  cursor: pointer;
  color: inherit;
}
.rp-toggle .rp-section-head { margin-bottom: 0; }
.rp-chevron { transition: transform 0.2s; color: var(--text-muted, #888); }
.rp-toggle.open .rp-chevron { transform: rotate(180deg); }
.rp-collapsed { display: none; }

/* ===== Follow-up view (main tab) ===== */
.followup-view { max-width: 760px; margin: 0 auto; padding: 8px 4px 40px; }
.followup-view-head { margin-bottom: 14px; }
.followup-view-intro { font-size: 13px; margin: 6px 0 0; }
.followup-view-list .followup-item {
  background: var(--surface, #fff);
  border: 1px solid var(--border, #eee);
  border-radius: 12px;
  padding: 14px 16px;
  margin-bottom: 10px;
}
.followup-view-list .followup-item:last-child { margin-bottom: 0; }

/* Google Calendar connect block */
.gcal-block { margin-top: 22px; padding-top: 18px; border-top: 1px solid var(--border, #eee); }
.gcal-block label { display: block; font-weight: 600; font-size: 13px; margin-bottom: 4px; }
.gcal-block p { font-size: 12px; margin: 0 0 10px; }
.gcal-block button { display: inline-flex; align-items: center; gap: 6px; }

/* ===== Google Calendar events (read-only) — distinct from tasks ===== */
/* Tasks are solid/colored; events are dashed + neutral blue with a calendar icon. */
.gcal-event {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 12px;
  padding: 5px 9px;
  margin: 3px 0;
  border: 1px dashed var(--gcal, #5b8def);
  border-radius: 7px;
  background: color-mix(in srgb, var(--gcal, #5b8def) 8%, transparent);
  color: var(--gcal-text, #3a63b8);
  font-weight: 500;
}
.gcal-event i { opacity: 0.8; flex-shrink: 0; }
.gcal-time { font-variant-numeric: tabular-nums; opacity: 0.85; }
.agenda-allday {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 10px;
  padding-bottom: 8px;
  border-bottom: 1px dashed var(--border, #eee);
}
.agenda-allday .gcal-event { margin: 0; }
.calendar-gcal-event {
  display: flex;
  align-items: center;
  gap: 3px;
  font-size: 10px;
  line-height: 1.3;
  padding: 1px 5px;
  margin-top: 2px;
  border-left: 2px dashed var(--gcal, #5b8def);
  background: color-mix(in srgb, var(--gcal, #5b8def) 9%, transparent);
  color: var(--gcal-text, #3a63b8);
  border-radius: 3px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.calendar-gcal-event i { flex-shrink: 0; opacity: 0.75; }

/* ===== Client contact fields ===== */
.client-field-group { margin-bottom: 10px; }
.client-field-label {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 11px; color: var(--text-muted, #888); margin-bottom: 4px;
}
.client-field-row { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.client-field-row input { flex: 1; }
.client-email-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
  padding: 4px 6px 4px 10px;
  border: 1px solid var(--border, #e6e6e6);
  border-radius: 8px;
  background: var(--surface, #fff);
}
.client-email-row:focus-within { border-color: var(--delfrog, #7c5cff); }
.client-email-icon { color: var(--text-muted, #999); flex-shrink: 0; }
.client-email-row input {
  flex: 1;
  border: none;
  background: none;
  padding: 4px 0;
  outline: none;
  font-size: 13px;
}
.client-email-remove { flex-shrink: 0; opacity: 0.5; }
.client-email-remove:hover { opacity: 1; color: var(--priority-high, #e5484d); }
#client-add-email {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 12px;
  color: var(--delfrog, #7c5cff);
  font-weight: 600;
  margin-top: 2px;
}

/* ===== Delfrog tasks = PURPLE in calendar/agenda; personal Google events = neutral gray =====
   Lets you tell Delfrog tasks apart from your personal calendar at a glance. */
:root {
  --delfrog: #7c5cff;
  --delfrog-text: #4b32c3;
  --delfrog-tint: color-mix(in srgb, #7c5cff 14%, transparent);
}
.calendar-task {
  background: var(--delfrog-tint);
  color: var(--delfrog-text);
  border-left: 3px solid var(--task-color, var(--delfrog)); /* category hint on the left bar */
}
.agenda-event[data-id] {
  background: var(--delfrog-tint);
  color: var(--delfrog-text);
  border-left-color: var(--delfrog);
}
/* personal calendar events -> neutral gray so the purple Delfrog items pop */
.gcal-event, .calendar-gcal-event {
  --gcal: #9aa0a6;
  --gcal-text: #5f6368;
}

/* ===== Reminders (read-only) list ===== */
.reminders-ro-list .reminder-ro-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 12px;
  margin-bottom: 8px;
  border: 1px solid var(--border, #eee);
  border-left: 3px solid var(--delfrog, #7c5cff);
  border-radius: 10px;
  background: var(--surface, #fff);
  cursor: pointer;
  transition: background 0.12s;
}
.reminders-ro-list .reminder-ro-item:hover { background: color-mix(in srgb, var(--delfrog, #7c5cff) 6%, var(--surface, #fff)); }
.reminders-ro-list .reminder-ro-item.past { opacity: 0.55; border-left-color: #bbb; }
.reminder-ro-main { flex: 1; min-width: 0; }
.reminder-ro-title { font-weight: 600; font-size: 14px; margin-bottom: 5px; }
.reminder-ro-meta { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.reminder-ro-when {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 11px; color: var(--delfrog-text, #4b32c3); font-weight: 500;
  font-variant-numeric: tabular-nums;
}
.reminder-ro-arrow { color: var(--text-muted, #aaa); flex-shrink: 0; }

/* ===== Proportional agenda timeline ===== */
.agenda-timeline {
  position: relative;
  margin-top: 6px;
  padding-left: 46px;
}
.agenda-blocks {
  position: absolute;
  left: 46px;
  right: 0;
  top: 0;
  bottom: 0;
}
.agenda-hour {
  position: absolute;
  left: 0;
  right: 0;
  border-top: 1px solid var(--border, #eee);
  height: 0;
}
.agenda-hlabel {
  position: absolute;
  left: 0;
  top: -6px;
  width: 40px;
  text-align: right;
  padding-right: 6px;
  font-size: 10px;
  color: var(--text-tertiary, #aaa);
  font-variant-numeric: tabular-nums;
}
.agenda-block {
  position: absolute;
  overflow: hidden;
  border-radius: 6px;
  padding: 4px 8px;
  font-size: 11px;
  line-height: 1.3;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  gap: 2px;
  cursor: default;
  transition: opacity 0.15s;
}
.agenda-block:hover {
  opacity: 0.85;
}
/* tasks (purple) on the left half, personal events (gray) on the right half */
.agenda-block.task {
  background: var(--delfrog-tint, color-mix(in srgb, #7c5cff 14%, transparent));
  border-left: 3px solid var(--delfrog, #7c5cff);
  color: var(--delfrog-text, #4b32c3);
  cursor: pointer;
}
.agenda-block.reminder {
  background: color-mix(in srgb, #7c5cff 9%, transparent);
  border-left: 3px dashed var(--delfrog, #7c5cff);
  color: var(--delfrog-text, #4b32c3);
  cursor: pointer;
}
.agenda-block.gcal {
  background: color-mix(in srgb, #4285f4 12%, transparent);
  border-left: 3px solid #4285f4;
  color: #1a56c4;
}
/* Calendar event that matches one of our tasks (synced) -> purple, not gray */
.agenda-block.gcal.synced {
  background: var(--delfrog-tint, color-mix(in srgb, #7c5cff 14%, transparent));
  border-left: 3px solid var(--delfrog, #7c5cff);
  color: var(--delfrog-text, #4b32c3);
}
/* Short blocks (≈5–25 min): single line, no duration, so they stay readable */
.agenda-block.tight {
  flex-direction: row;
  align-items: center;
  gap: 4px;
  padding-top: 1px;
  padding-bottom: 1px;
}
.agenda-block.tight .agenda-block-dur { display: none; }
.agenda-block.tight .agenda-block-title { font-size: 10px; }
.agenda-block-time { font-size: 9px; opacity: 0.75; font-variant-numeric: tabular-nums; }
.agenda-block-title { font-weight: 600; overflow: hidden; text-overflow: ellipsis; display: flex; align-items: center; gap: 3px; min-width: 0; }
.agenda-block-dur { font-size: 9px; opacity: 0.7; }
.agenda-block.tight .agenda-block-title { white-space: nowrap; }
.agenda-now {
  position: absolute;
  left: 40px;
  right: 0;
  border-top: 2px solid var(--priority-high, #e5484d);
  z-index: 5;
}
.agenda-now-dot {
  position: absolute;
  left: 0;
  top: -4px;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--priority-high, #e5484d);
}

/* ===== Table view (Excel-like) ===== */
.table-view {
  width: 100%;
}
.table-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}
.table-wrap {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}
.task-table {
  width: 100%;
  min-width: 820px;
  border-collapse: collapse;
  font-size: 12px;
  table-layout: fixed;
}
.task-table thead th {
  text-align: left;
  padding: 8px 10px;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-tertiary);
  background: var(--surface-2, #f8f8f8);
  border-bottom: 2px solid var(--border);
  border-right: 1px solid var(--border);
  white-space: nowrap;
  position: sticky;
  top: 0;
  z-index: 2;
}
.task-table thead th:last-child { border-right: none; }
.task-table thead th.sortable {
  cursor: pointer;
  user-select: none;
}
.task-table thead th.sortable:hover {
  background: var(--surface-3, #f0f0f0);
  color: var(--text-primary, #333);
}
/* Column widths */
.task-table th:nth-child(1) { width: 22%; }
.task-table th:nth-child(2) { width: 9%; }
.task-table th:nth-child(3) { width: 10%; }
.task-table th:nth-child(4) { width: 9%; }
.task-table th:nth-child(5) { width: 7%; }
.task-table th:nth-child(6) { width: 7%; }
.task-table th:nth-child(7) { width: 8%; }
.task-table th:nth-child(8) { width: 9%; }
.task-table th:nth-child(9) { width: 7%; }
.task-table th:nth-child(10) { width: 12%; }

.task-table tbody tr {
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  transition: background 0.1s;
}
.task-table tbody tr.alt {
  background: rgba(0, 0, 0, 0.015);
}
.task-table tbody tr:hover {
  background: rgba(99, 102, 241, 0.06);
}
.task-table tbody tr.done {
  opacity: 0.5;
}
.task-table tbody tr.done .table-title-text {
  text-decoration: line-through;
}
.table-cell {
  padding: 7px 10px;
  vertical-align: middle;
  white-space: nowrap;
  border-right: 1px solid var(--border);
  overflow: hidden;
  text-overflow: ellipsis;
  font-size: 12px;
  color: var(--text-secondary, #555);
}
.table-cell:last-child { border-right: none; }
.table-cell-title {
  white-space: normal;
  overflow: visible;
}
.table-title-inner {
  display: flex;
  align-items: center;
  gap: 8px;
}
.table-title-bar {
  width: 4px;
  min-height: 20px;
  border-radius: 2px;
  flex-shrink: 0;
  align-self: stretch;
}
.table-title-text {
  font-weight: 600;
  color: var(--text-primary, #222);
  line-height: 1.35;
}
.table-category {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-weight: 600;
  font-size: 11px;
}
.table-select {
  font-size: 11px;
  border-radius: 5px;
  border: 1px solid var(--border);
  background: var(--surface);
  padding: 3px 6px;
  color: #555;
  cursor: pointer;
  width: 100%;
  max-width: 110px;
}
.table-select.priority-high {
  border-color: var(--priority-high);
  background: rgba(214, 69, 69, 0.08);
  color: var(--priority-high);
  font-weight: 600;
}
.table-select.priority-medium {
  border-color: var(--priority-medium);
  background: rgba(216, 154, 43, 0.08);
  color: var(--priority-medium);
  font-weight: 600;
}
.table-select.priority-low {
  border-color: var(--priority-low);
  background: rgba(91, 138, 114, 0.08);
  color: var(--priority-low);
  font-weight: 600;
}
.table-due {
  font-variant-numeric: tabular-nums;
}
.table-due.overdue {
  color: var(--priority-high, #e5484d);
  font-weight: 600;
}
.table-tag {
  display: inline-block;
  font-size: 10px;
  font-weight: 600;
  padding: 2px 7px;
  border-radius: 10px;
  background: rgba(124, 92, 255, 0.1);
  color: var(--delfrog, #7c5cff);
}
.table-notes-cell {
  font-size: 11px;
  color: var(--text-tertiary, #999);
  max-width: 0;
}
.table-subtasks span {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: var(--text-tertiary);
}

@media (max-width: 900px) {
  .task-table {
    min-width: 700px;
  }
}
@media (max-width: 600px) {
  .task-table {
    min-width: 600px;
    font-size: 11px;
  }
  .task-table thead th { padding: 6px 8px; font-size: 9px; }
  .table-cell { padding: 6px 8px; }
}
