:root {
  --bg: #f4f7fb;
  --bg-accent: #eef2ff;
  --surface: #ffffff;
  --surface-muted: #f8fafc;
  --border: #e2e8f0;
  --text: #0f172a;
  --text-muted: #475569;
  --text-light: #64748b;
  --primary: #4f46e5;
  --primary-hover: #4338ca;
  --primary-soft: #eef2ff;
  --emerald: #059669;
  --emerald-soft: #ecfdf5;
  --amber: #d97706;
  --amber-soft: #fffbeb;
  --rose: #dc2626;
  --rose-soft: #fef2f2;
  --shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.05);
  --shadow-md: 0 10px 25px -5px rgba(15, 23, 42, 0.07), 0 4px 10px -4px rgba(15, 23, 42, 0.04);
  --radius-lg: 16px;
  --radius-md: 12px;
  --radius-sm: 8px;
}

[data-theme="dark"] {
  --bg: #0b1120;
  --bg-accent: #1e1b4b;
  --surface: #111827;
  --surface-muted: #1e293b;
  --border: #334155;
  --text: #f1f5f9;
  --text-muted: #cbd5e1;
  --text-light: #94a3b8;
  --primary: #6366f1;
  --primary-hover: #818cf8;
  --primary-soft: rgba(99, 102, 241, 0.16);
  --emerald: #10b981;
  --emerald-soft: rgba(16, 185, 129, 0.16);
  --amber: #f59e0b;
  --amber-soft: rgba(245, 158, 11, 0.16);
  --rose: #f87171;
  --rose-soft: rgba(248, 113, 113, 0.16);
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 14px 28px -6px rgba(0, 0, 0, 0.45);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  background: radial-gradient(circle at top right, var(--bg-accent) 0%, var(--bg) 45%);
  color: var(--text);
  line-height: 1.5;
  min-height: 100vh;
  transition: background-color 0.2s ease, color 0.2s ease;
}

.hidden {
  display: none !important;
}

/* Remote Config Announcement Banner */
.announcement-banner {
  background: linear-gradient(90deg, var(--primary), #7c3aed);
  color: #ffffff;
  padding: 10px 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  font-size: 0.88rem;
  font-weight: 500;
}

.announcement-close {
  border: none;
  background: rgba(255, 255, 255, 0.18);
  color: #ffffff;
  border-radius: 999px;
  width: 24px;
  height: 24px;
  cursor: pointer;
  font-size: 1rem;
  line-height: 1;
}

/* Auth Loading */
.auth-loading {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  color: var(--text-muted);
  font-size: 0.95rem;
  font-weight: 500;
}

.auth-spinner {
  width: 34px;
  height: 34px;
  border: 3px solid var(--border);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.75s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* Auth Screen */
.auth-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px 16px;
}

.auth-card {
  width: 100%;
  max-width: 450px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  padding: 26px;
}

.auth-top-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.auth-brand {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 20px;
}

.auth-brand h1 {
  margin: 0;
  font-size: 1.45rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.auth-tabs {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  background: var(--surface-muted);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 4px;
  gap: 4px;
  margin-bottom: 18px;
}

.auth-tab-btn {
  border: none;
  background: transparent;
  color: var(--text-muted);
  font-family: inherit;
  font-size: 0.9rem;
  font-weight: 600;
  padding: 8px 12px;
  border-radius: 7px;
  cursor: pointer;
  transition: background-color 0.16s ease, color 0.16s ease;
}

.auth-tab-btn.is-active {
  background: var(--surface);
  color: var(--text);
  box-shadow: var(--shadow-sm);
}

.btn-google {
  width: 100%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 11px 16px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  font-family: inherit;
  font-size: 0.94rem;
  font-weight: 600;
  cursor: pointer;
  transition: background-color 0.16s ease, border-color 0.16s ease, box-shadow 0.16s ease;
}

.btn-google:hover:not(:disabled) {
  background: var(--surface-muted);
  border-color: #94a3b8;
  box-shadow: var(--shadow-sm);
}

.btn-google:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.auth-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 18px 0;
  color: var(--text-light);
  font-size: 0.8rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.auth-divider::before,
.auth-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
}

.auth-alert {
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  font-size: 0.86rem;
  font-weight: 500;
  margin-bottom: 14px;
}

.auth-alert.is-error {
  background: var(--rose-soft);
  border: 1px solid rgba(220, 38, 38, 0.35);
  color: var(--rose);
}

.auth-alert.is-success {
  background: var(--emerald-soft);
  border: 1px solid rgba(5, 150, 105, 0.35);
  color: var(--emerald);
}

.auth-submit-btn {
  width: 100%;
  margin-top: 4px;
  padding: 11px 16px;
}

.auth-footer {
  display: flex;
  justify-content: center;
  margin-top: 14px;
}

.auth-link-btn {
  border: none;
  background: transparent;
  color: var(--primary);
  font-family: inherit;
  font-size: 0.86rem;
  font-weight: 600;
  cursor: pointer;
  padding: 4px 8px;
}

.auth-link-btn:hover {
  text-decoration: underline;
}

/* Main App Layout */
.app-shell {
  max-width: 1120px;
  margin: 0 auto;
  padding: 24px 18px 56px;
}

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

.brand-block {
  display: flex;
  align-items: center;
  gap: 14px;
}

.brand-badge {
  width: 46px;
  height: 46px;
  border-radius: 14px;
  background: linear-gradient(135deg, #f97316, #ef4444);
  display: grid;
  place-items: center;
  font-size: 22px;
  flex-shrink: 0;
  box-shadow: 0 8px 18px rgba(249, 115, 22, 0.25);
}

.app-header h1 {
  margin: 0;
  font-size: 1.55rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.subtitle {
  margin: 2px 0 0;
  font-size: 0.86rem;
  color: var(--text-muted);
}

.subtitle code {
  background: var(--primary-soft);
  color: var(--primary);
  padding: 1px 6px;
  border-radius: 6px;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.8rem;
}

.header-right {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.status-pill,
.icon-pill-btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 7px 12px;
  border-radius: 999px;
  font-family: inherit;
  font-size: 0.82rem;
  font-weight: 600;
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
}

.icon-pill-btn {
  cursor: pointer;
  transition: background-color 0.15s ease, border-color 0.15s ease;
}

.icon-pill-btn:hover {
  background: var(--surface-muted);
  border-color: var(--primary);
}

.alert-count {
  background: var(--rose);
  color: #ffffff;
  font-size: 0.72rem;
  padding: 1px 6px;
  border-radius: 999px;
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--amber);
}

.status-pill.is-live {
  background: var(--emerald-soft);
  border-color: rgba(5, 150, 105, 0.35);
  color: var(--emerald);
}

.status-pill.is-live .status-dot {
  background: var(--emerald);
}

.status-pill.is-offline {
  background: var(--amber-soft);
  border-color: rgba(217, 119, 6, 0.35);
  color: var(--amber);
}

.status-pill.is-offline .status-dot {
  background: var(--amber);
}

.status-pill.is-error {
  background: var(--rose-soft);
  border-color: rgba(220, 38, 38, 0.35);
  color: var(--rose);
}

.status-pill.is-error .status-dot {
  background: var(--rose);
}

.user-chip {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 4px 5px 4px 7px;
  box-shadow: var(--shadow-sm);
}

.user-avatar {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
}

.user-avatar-fallback {
  background: var(--primary-soft);
  color: var(--primary);
  display: grid;
  place-items: center;
  font-size: 0.84rem;
  font-weight: 700;
}

.user-meta {
  display: flex;
  flex-direction: column;
  line-height: 1.2;
  max-width: 150px;
}

.user-name {
  font-size: 0.81rem;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.user-email {
  font-size: 0.72rem;
  color: var(--text-light);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.btn-signout {
  background: var(--surface-muted);
  border: 1px solid var(--border);
  color: var(--text-muted);
  border-radius: 999px;
  padding: 5px 11px;
  font-size: 0.78rem;
}

.btn-signout:hover:not(:disabled) {
  background: var(--rose-soft);
  border-color: rgba(220, 38, 38, 0.35);
  color: var(--rose);
}

/* Workspace Bar (Shared Lists) */
.workspace-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 18px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 10px 14px;
  box-shadow: var(--shadow-sm);
}

.workspace-pills {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.workspace-pill {
  border: 1px solid var(--border);
  background: var(--surface-muted);
  color: var(--text-muted);
  font-family: inherit;
  font-size: 0.84rem;
  font-weight: 600;
  padding: 6px 12px;
  border-radius: 999px;
  cursor: pointer;
  transition: background-color 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.workspace-pill:hover {
  border-color: var(--primary);
  color: var(--text);
}

.workspace-pill.is-active {
  background: var(--primary);
  border-color: var(--primary);
  color: #ffffff;
}

.workspace-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

/* KPI Grid */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 18px;
}

.kpi-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 14px 16px;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.kpi-total {
  border-top: 3px solid var(--primary);
}

.kpi-pending {
  border-top: 3px solid var(--amber);
}

.kpi-completed {
  border-top: 3px solid var(--emerald);
}

.kpi-high {
  border-top: 3px solid var(--rose);
}

.kpi-label {
  font-size: 0.84rem;
  color: var(--text-muted);
  font-weight: 500;
}

.kpi-value {
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--text);
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  padding: 20px;
  margin-bottom: 18px;
}

.card-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}

.card-header h2 {
  margin: 0;
  font-size: 1.12rem;
  font-weight: 600;
}

.hint-text {
  font-size: 0.82rem;
  color: var(--text-light);
}

.todo-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.form-row {
  display: flex;
  gap: 12px;
}

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

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

.subbuilder-box {
  background: var(--surface-muted);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.subbuilder-box label {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-muted);
}

.inline-input-row {
  display: flex;
  gap: 8px;
}

.draft-chip-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.draft-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 3px 9px;
  font-size: 0.78rem;
  max-width: 100%;
}

.draft-chip-remove {
  border: none;
  background: transparent;
  color: var(--rose);
  cursor: pointer;
  font-weight: 700;
  padding: 0 2px;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.field-grow {
  flex: 1;
}

.field label {
  font-size: 0.84rem;
  font-weight: 600;
  color: var(--text-muted);
}

.required {
  color: var(--rose);
}

input[type="text"],
input[type="email"],
input[type="password"],
input[type="search"],
input[type="date"],
input[type="time"],
input[type="file"],
textarea,
select {
  width: 100%;
  padding: 9px 11px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-size: 0.92rem;
  color: var(--text);
  background: var(--surface-muted);
  transition: border-color 0.18s ease, box-shadow 0.18s ease, background-color 0.18s ease;
}

input:focus,
textarea:focus,
select:focus {
  outline: none;
  border-color: var(--primary);
  background: var(--surface);
  box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.14);
}

textarea {
  resize: vertical;
}

.form-actions {
  display: flex;
  justify-content: flex-end;
  margin-top: 2px;
}

.btn {
  border: none;
  border-radius: var(--radius-sm);
  padding: 9px 15px;
  font-family: inherit;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: transform 0.12s ease, background-color 0.16s ease, opacity 0.16s ease;
}

.btn-sm {
  padding: 6px 11px;
  font-size: 0.82rem;
}

.btn:active:not(:disabled) {
  transform: translateY(1px);
}

.btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.btn-primary {
  background: var(--primary);
  color: #ffffff;
}

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

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

.btn-secondary:hover:not(:disabled) {
  border-color: var(--primary);
}

.btn-ghost-danger {
  background: transparent;
  color: var(--rose);
  border: 1px solid rgba(220, 38, 38, 0.35);
  padding: 7px 12px;
  font-size: 0.84rem;
}

.btn-ghost-danger:hover:not(:disabled) {
  background: var(--rose-soft);
}

/* Toolbar */
.toolbar-card {
  padding: 15px 18px;
}

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

.toolbar-top {
  margin-bottom: 12px;
}

.view-tabs,
.filter-tabs {
  display: inline-flex;
  background: var(--surface-muted);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 3px;
  gap: 4px;
}

.view-tab-btn,
.tab-btn {
  border: none;
  background: transparent;
  color: var(--text-muted);
  font-family: inherit;
  font-size: 0.84rem;
  font-weight: 600;
  padding: 6px 12px;
  border-radius: 7px;
  cursor: pointer;
  transition: background-color 0.16s ease, color 0.16s ease;
}

.view-tab-btn.is-active,
.tab-btn.is-active {
  background: var(--primary);
  color: #ffffff;
}

.search-wrap {
  flex: 1 1 230px;
}

.filter-selects {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.filter-selects select {
  width: auto;
  min-width: 145px;
  padding: 7px 10px;
  font-size: 0.84rem;
}

.error-banner {
  background: var(--rose-soft);
  border: 1px solid rgba(220, 38, 38, 0.35);
  color: var(--rose);
  padding: 12px 16px;
  border-radius: var(--radius-md);
  margin-bottom: 14px;
  font-size: 0.9rem;
}

/* List View */
.todo-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.todo-item {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 15px 16px;
  box-shadow: var(--shadow-sm);
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  transition: border-color 0.18s ease, box-shadow 0.18s ease, opacity 0.18s ease;
}

.todo-item:hover {
  border-color: var(--primary);
  box-shadow: var(--shadow-md);
}

.todo-item.is-completed {
  opacity: 0.82;
}

.todo-item.is-drag-over {
  border-color: var(--primary);
  box-shadow: 0 0 0 2px rgba(79, 70, 229, 0.25);
}

.drag-handle {
  color: var(--text-light);
  cursor: grab;
  font-size: 1rem;
  user-select: none;
  padding-top: 2px;
}

.todo-main {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  flex: 1;
  min-width: 0;
}

.todo-checkbox {
  margin-top: 4px;
  width: 19px;
  height: 19px;
  accent-color: var(--emerald);
  cursor: pointer;
  flex-shrink: 0;
}

.todo-content {
  flex: 1;
  min-width: 0;
}

.todo-title {
  margin: 0;
  font-size: 1.02rem;
  font-weight: 600;
  word-break: break-word;
}

.todo-item.is-completed .todo-title {
  text-decoration: line-through;
  color: var(--text-light);
}

.todo-desc {
  margin: 4px 0 0;
  font-size: 0.88rem;
  color: var(--text-muted);
  white-space: pre-wrap;
  word-break: break-word;
}

/* Subtasks Progress & Inline Checklist (#1) */
.subtask-block {
  margin-top: 10px;
  background: var(--surface-muted);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 9px 11px;
}

.subtask-progress-wrap {
  margin-top: 8px;
}

.subtask-progress-meta {
  display: flex;
  justify-content: space-between;
  font-size: 0.76rem;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 4px;
}

.progress-track {
  width: 100%;
  height: 6px;
  background: var(--border);
  border-radius: 999px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--primary), var(--emerald));
  border-radius: 999px;
  transition: width 0.25s ease;
}

.subtask-items {
  list-style: none;
  margin: 8px 0 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 5px;
}

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

.subtask-item input {
  width: 15px;
  height: 15px;
  accent-color: var(--emerald);
  cursor: pointer;
}

.subtask-item.is-done span {
  text-decoration: line-through;
  color: var(--text-light);
}

.subtask-quick-add {
  display: flex;
  gap: 6px;
  margin-top: 8px;
}

.subtask-quick-add input {
  padding: 5px 8px;
  font-size: 0.8rem;
}

/* Attachments Strip (#6) */
.attachments-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}

.attachment-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--surface-muted);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 4px 8px;
  font-size: 0.78rem;
  color: var(--text);
  cursor: pointer;
}

.attachment-pill:hover {
  border-color: var(--primary);
}

.attachment-thumb {
  width: 24px;
  height: 24px;
  border-radius: 4px;
  object-fit: cover;
}

.todo-meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 10px;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 9px;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 600;
}

.badge-priority-high {
  background: var(--rose-soft);
  color: var(--rose);
}

.badge-priority-medium {
  background: var(--amber-soft);
  color: var(--amber);
}

.badge-priority-low {
  background: var(--emerald-soft);
  color: var(--emerald);
}

.badge-category,
.badge-recur,
.badge-attach {
  background: var(--primary-soft);
  color: var(--primary);
}

.badge-status {
  background: var(--surface-muted);
  border: 1px solid var(--border);
  color: var(--text-muted);
}

.badge-date {
  background: var(--surface-muted);
  border: 1px solid var(--border);
  color: var(--text-muted);
}

.badge-date.is-overdue {
  background: var(--rose-soft);
  border-color: transparent;
  color: var(--rose);
}

.meta-time {
  font-size: 0.76rem;
  color: var(--text-light);
}

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

.action-btn {
  border: 1px solid var(--border);
  background: var(--surface-muted);
  color: var(--text-muted);
  border-radius: 8px;
  padding: 6px 10px;
  font-family: inherit;
  font-size: 0.79rem;
  font-weight: 600;
  cursor: pointer;
}

.action-btn:hover {
  background: var(--primary-soft);
  color: var(--primary);
  border-color: var(--primary);
}

.action-btn.is-delete:hover {
  background: var(--rose-soft);
  color: var(--rose);
  border-color: var(--rose);
}

/* Kanban Board (#5) */
.kanban-board {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  align-items: start;
}

.kanban-column {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 12px;
  box-shadow: var(--shadow-sm);
}

.kanban-column.is-todo {
  border-top: 3px solid var(--primary);
}

.kanban-column.is-progress {
  border-top: 3px solid var(--amber);
}

.kanban-column.is-done {
  border-top: 3px solid var(--emerald);
}

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

.kanban-column-header h3 {
  margin: 0;
  font-size: 0.96rem;
  font-weight: 700;
}

.kanban-count {
  background: var(--surface-muted);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 2px 9px;
  font-size: 0.76rem;
  font-weight: 700;
}

.kanban-cards {
  min-height: 180px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  border-radius: var(--radius-sm);
  padding: 4px;
  transition: background-color 0.15s ease;
}

.kanban-cards.is-drag-over {
  background: var(--primary-soft);
}

.kanban-card {
  background: var(--surface-muted);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px;
  cursor: grab;
  transition: transform 0.12s ease, border-color 0.15s ease;
}

.kanban-card:hover {
  border-color: var(--primary);
}

.kanban-card.is-dragging {
  opacity: 0.5;
}

.kanban-card.is-completed {
  opacity: 0.78;
}

.kanban-card-top {
  display: flex;
  gap: 6px;
  margin-bottom: 8px;
}

.kanban-card-title {
  margin: 0;
  font-size: 0.94rem;
  font-weight: 600;
}

.kanban-card.is-completed .kanban-card-title {
  text-decoration: line-through;
  color: var(--text-light);
}

.kanban-card-desc {
  margin: 4px 0 0;
  font-size: 0.8rem;
  color: var(--text-muted);
}

.kanban-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 10px;
}

.kanban-badges {
  display: flex;
  gap: 5px;
  flex-wrap: wrap;
}

.kanban-card-actions {
  display: flex;
  gap: 5px;
}

.kanban-empty {
  border: 1px dashed var(--border);
  border-radius: var(--radius-sm);
  padding: 24px 12px;
  text-align: center;
  font-size: 0.82rem;
  color: var(--text-light);
}

/* Calendar View (#8) */
.calendar-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 18px;
  box-shadow: var(--shadow-md);
}

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

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

.calendar-title {
  margin: 0;
  font-size: 1.15rem;
}

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

.calendar-weekdays {
  text-align: center;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--text-light);
  margin-bottom: 6px;
}

.cal-cell {
  min-height: 98px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface-muted);
  padding: 6px;
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.cal-cell.is-empty {
  background: transparent;
  border-style: dashed;
  opacity: 0.45;
}

.cal-cell.is-today {
  border-color: var(--primary);
  box-shadow: inset 0 0 0 1px var(--primary);
}

.cal-cell-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.cal-day-num {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--text-muted);
}

.cal-add-btn {
  border: none;
  background: transparent;
  color: var(--primary);
  font-weight: 700;
  cursor: pointer;
  border-radius: 4px;
  padding: 0 4px;
}

.cal-add-btn:hover {
  background: var(--primary-soft);
}

.cal-cell-tasks {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.cal-task-chip {
  border: none;
  text-align: left;
  border-radius: 5px;
  padding: 3px 6px;
  font-family: inherit;
  font-size: 0.72rem;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  background: var(--primary-soft);
  color: var(--primary);
}

.cal-task-chip.priority-high {
  background: var(--rose-soft);
  color: var(--rose);
}

.cal-task-chip.priority-medium {
  background: var(--amber-soft);
  color: var(--amber);
}

.cal-task-chip.is-completed {
  text-decoration: line-through;
  opacity: 0.65;
}

.cal-more {
  font-size: 0.7rem;
  color: var(--text-light);
}

/* Empty & Skeleton */
.empty-state {
  background: var(--surface);
  border: 1px dashed var(--border);
  border-radius: var(--radius-lg);
  padding: 40px 20px;
  text-align: center;
  color: var(--text-muted);
}

.empty-state .empty-icon {
  font-size: 2.2rem;
  margin-bottom: 8px;
}

.empty-state h3 {
  margin: 0 0 4px;
  font-size: 1.08rem;
  color: var(--text);
}

.empty-state p {
  margin: 0;
  font-size: 0.9rem;
}

.skeleton-card {
  height: 82px;
  border-radius: var(--radius-md);
  background: linear-gradient(90deg, var(--surface-muted) 25%, var(--border) 50%, var(--surface-muted) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.2s infinite;
}

@keyframes shimmer {
  0% {
    background-position: 200% 0;
  }
  100% {
    background-position: -200% 0;
  }
}

/* Modals */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.55);
  backdrop-filter: blur(3px);
  display: grid;
  place-items: center;
  padding: 16px;
  z-index: 50;
  overflow-y: auto;
}

.modal-card {
  width: 100%;
  max-width: 540px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 22px;
  box-shadow: 0 24px 48px rgba(0, 0, 0, 0.25);
  animation: popIn 0.16s ease-out;
}

.modal-card-lg {
  max-width: 680px;
}

@keyframes popIn {
  from {
    opacity: 0;
    transform: scale(0.97) translateY(6px);
  }
  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

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

.modal-header h2 {
  margin: 0;
  font-size: 1.15rem;
}

.icon-close-btn {
  border: none;
  background: transparent;
  font-size: 1.5rem;
  line-height: 1;
  color: var(--text-light);
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 8px;
}

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

.checkbox-inline {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.92rem;
  font-weight: 500;
  cursor: pointer;
}

.checkbox-inline input {
  width: 18px;
  height: 18px;
  accent-color: var(--emerald);
}

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

.modal-actions-split {
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
}

.modal-actions-left,
.modal-actions-right {
  display: flex;
  gap: 8px;
}

.preview-modal-body {
  display: grid;
  place-items: center;
  min-height: 200px;
  max-height: 65vh;
  overflow: auto;
  background: var(--surface-muted);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px;
}

.preview-modal-body img {
  max-width: 100%;
  max-height: 60vh;
  border-radius: 8px;
}

.preview-modal-body iframe {
  width: 100%;
  height: 55vh;
  border: none;
  border-radius: 6px;
}

.toast-container {
  position: fixed;
  right: 18px;
  bottom: 18px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  z-index: 60;
}

.toast {
  background: #0f172a;
  color: #ffffff;
  padding: 10px 15px;
  border-radius: 10px;
  font-size: 0.88rem;
  font-weight: 500;
  box-shadow: 0 12px 24px rgba(0, 0, 0, 0.25);
  max-width: 350px;
}

.toast.is-success {
  background: #065f46;
}

.toast.is-error {
  background: #991b1b;
}

@media (max-width: 820px) {
  .kanban-board {
    grid-template-columns: 1fr;
  }

  .create-extras-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 720px) {
  .kpi-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

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

  .todo-item {
    flex-direction: column;
  }

  .todo-actions {
    width: 100%;
    justify-content: flex-end;
  }

  .header-right {
    width: 100%;
    justify-content: space-between;
  }

  .cal-cell {
    min-height: 70px;
  }
}
