/* ===== CSS RESET & VARIABLES ===== */
:root {
  --bg: #ffffff;
  --bg-card: #ffffff;
  --bg-hover: #f5f5ff;
  --text: #1d1d1f;
  --text-secondary: #6e6e73;
  --text-muted: #aeaeb2;
  --accent: #94BAC7;
  --accent-light: #E4EFF3;
  --accent-hover: #7BA6B5;
  --accent-text: #ffffff;
  --border: #e8e8ed;
  --border-light: #f2f2f7;
  --overdue: #8e8e93;
  --overdue-bg: #f9f9f9;
  --completed-bg: #f2f2f7;
  --danger: #ff6b6b;
  --danger-hover: #ff5252;
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.06);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.08);
  --shadow-lg: 0 8px 30px rgba(0,0,0,0.12);
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 20px;
  --nav-height: 72px;
  --header-height: 56px;
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { font-size: 16px; -webkit-tap-highlight-color: transparent; }

body {
  font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

/* ===== SCREENS ===== */
.screen {
  min-height: 100vh;
  min-height: 100dvh;
}
.hidden { display: none !important; }

/* ===== LOGIN SCREEN ===== */
.login-container {
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: linear-gradient(180deg, #F0F3FF 0%, var(--bg) 100%);
}

.login-logo {
  font-size: 64px;
  margin-bottom: 8px;
  animation: float 3s ease-in-out infinite;
}

@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-8px); }
}

.login-container h1 {
  font-size: 36px;
  font-weight: 700;
  letter-spacing: -0.5px;
  color: var(--text);
}

.login-subtitle {
  color: var(--text-secondary);
  font-size: 17px;
  margin-bottom: 32px;
}

.login-form {
  width: 100%;
  max-width: 320px;
}

.error-text {
  color: var(--danger);
  font-size: 14px;
  text-align: center;
  margin-top: 12px;
}

/* ===== SETUP WIZARD ===== */
.setup-container {
  min-height: 100vh;
  min-height: 100dvh;
  padding: 24px;
  padding-bottom: 40px;
  overflow-y: auto;
  background: var(--bg);
}

.setup-step {
  max-width: 480px;
  margin: 0 auto;
}

.setup-header {
  text-align: center;
  margin-bottom: 28px;
  padding-top: 40px;
}

.setup-step-indicator {
  display: inline-block;
  background: var(--accent-light);
  color: var(--accent);
  font-size: 13px;
  font-weight: 600;
  padding: 4px 12px;
  border-radius: 20px;
  margin-bottom: 16px;
}

.setup-header h2 {
  font-size: 24px;
  font-weight: 700;
  margin-bottom: 8px;
}

.setup-header p {
  color: var(--text-secondary);
  font-size: 15px;
}

.setup-checkboxes {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 24px;
}

.setup-check-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  background: var(--bg-card);
  border-radius: var(--radius-sm);
  border: 1.5px solid var(--border);
  cursor: pointer;
  transition: all 0.2s;
  -webkit-user-select: none;
  user-select: none;
}

.setup-check-item:active { transform: scale(0.98); }
.setup-check-item.selected {
  border-color: var(--accent);
  background: var(--accent-light);
}

.setup-check-item .check-emoji { font-size: 22px; }
.setup-check-item .check-label { flex: 1; font-size: 15px; }
.setup-check-item .check-mark {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 2px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  color: white;
  transition: all 0.2s;
}

.setup-check-item.selected .check-mark {
  background: var(--accent);
  border-color: var(--accent);
}

.routine-section { margin-bottom: 24px; }
.routine-section h3 {
  font-size: 17px;
  font-weight: 600;
  margin-bottom: 12px;
  color: var(--text);
}

/* ===== INPUTS ===== */
.input-group {
  margin-bottom: 16px;
}
.input-group label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.input-group input[type="text"],
.input-group input[type="password"],
.input-group input[type="date"],
.input-group input[type="number"],
.input-group select {
  width: 100%;
  padding: 12px 16px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 16px;
  font-family: inherit;
  background: var(--bg-card);
  color: var(--text);
  transition: border-color 0.2s;
  outline: none;
}
.input-group input:focus,
.input-group select:focus {
  border-color: var(--accent);
}
.emoji-input { text-align: center; font-size: 24px !important; }

/* ===== BUTTONS ===== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 24px;
  border: none;
  border-radius: var(--radius-sm);
  font-size: 16px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: all 0.2s;
  text-decoration: none;
  -webkit-user-select: none;
  user-select: none;
}
.btn:active { transform: scale(0.97); }

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

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

.btn-outline {
  background: transparent;
  border: 1.5px solid var(--border);
  color: var(--text);
}
.btn-outline:hover { border-color: var(--accent); color: var(--accent); }

.btn-danger {
  background: transparent;
  color: var(--danger);
}
.btn-danger:hover { background: rgba(255,107,107,0.1); }

.btn-full { width: 100%; }
.btn-sm { padding: 8px 16px; font-size: 14px; }
.btn-icon {
  background: none;
  border: none;
  font-size: 22px;
  cursor: pointer;
  padding: 4px;
  border-radius: 8px;
  transition: background 0.2s;
}
.btn-icon:hover { background: var(--border-light); }

.form-row {
  display: flex;
  gap: 12px;
  align-items: flex-end;
}
.flex-1 { flex: 1; }
.flex-2 { flex: 2; }
.flex-3 { flex: 3; }
.emoji-sm { max-width: 70px; }

/* ===== APP HEADER ===== */
.app-header {
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 20px;
  padding-top: max(12px, env(safe-area-inset-top));
  background: rgba(255,255,255,0.92);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 0.5px solid var(--border-light);
  height: var(--header-height);
}

.app-header h1 {
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.3px;
}

/* ===== VIEWS ===== */
.views-container {
  padding-bottom: calc(var(--nav-height) + var(--safe-bottom) + 16px);
  min-height: calc(100vh - var(--header-height));
}

.view {
  display: none;
  padding: 20px;
  animation: fadeIn 0.25s ease;
}
.view.active { display: block; }

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

.view-header {
  margin-bottom: 20px;
}
.view-header h2 {
  font-size: 26px;
  font-weight: 700;
  letter-spacing: -0.3px;
}
.text-muted { color: var(--text-secondary); font-size: 15px; }
.text-center { text-align: center; }

/* ===== PROGRESS BAR ===== */
.progress-bar-container {
  margin-bottom: 24px;
  padding: 16px;
  background: var(--bg-card);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
}

.progress-bar {
  height: 8px;
  background: var(--border-light);
  border-radius: 4px;
  overflow: hidden;
  margin-bottom: 8px;
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--accent), var(--accent-light));
  border-radius: 4px;
  transition: width 0.5s cubic-bezier(0.4, 0, 0.2, 1);
  width: 0%;
}

.progress-text {
  font-size: 13px;
  color: var(--text-secondary);
  text-align: center;
}

/* ===== SECTIONS ===== */
.section { margin-bottom: 24px; }

.section-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 12px;
}

.completed-title { color: var(--text-muted); }
.overdue-title { color: var(--overdue); }

/* ===== TASK CARDS ===== */
.task-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.task-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  background: var(--bg-card);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  cursor: pointer;
  position: relative;
  overflow: hidden;
}

.task-card:active { transform: scale(0.98); }

.task-card.completed {
  opacity: 0.6;
  background: var(--completed-bg);
}

.task-card.completed .task-name {
  text-decoration: line-through;
  color: var(--text-muted);
}

.task-card.overdue {
  background: var(--overdue-bg);
  border-left: 3px solid var(--overdue);
}

.task-checkbox {
  width: 28px;
  height: 28px;
  min-width: 28px;
  border-radius: 50%;
  border: 2.5px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  cursor: pointer;
}

.task-card.completed .task-checkbox {
  background: var(--accent);
  border-color: var(--accent);
  color: white;
}

.task-emoji {
  font-size: 24px;
  min-width: 28px;
  text-align: center;
}

.task-info { flex: 1; min-width: 0; }

.task-name {
  font-size: 16px;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.task-meta {
  font-size: 13px;
  color: var(--text-muted);
  margin-top: 2px;
}

.task-actions {
  display: flex;
  gap: 4px;
  opacity: 0;
  transition: opacity 0.2s;
}

.task-card:hover .task-actions,
.task-card:active .task-actions {
  opacity: 1;
}

/* Always show actions on touch */
@media (hover: none) {
  .task-actions { opacity: 1; }
}

.task-action-btn {
  background: none;
  border: none;
  font-size: 16px;
  padding: 4px 6px;
  border-radius: 6px;
  cursor: pointer;
  transition: background 0.2s;
}

.task-action-btn:hover { background: var(--border-light); }

/* Task completion animation */
.task-card.completing {
  animation: taskComplete 0.5s ease;
}

@keyframes taskComplete {
  0% { transform: scale(1); }
  30% { transform: scale(0.95); }
  60% { transform: scale(1.02); }
  100% { transform: scale(1); }
}

.task-card.completing .task-checkbox {
  animation: checkBounce 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes checkBounce {
  0% { transform: scale(1); }
  40% { transform: scale(1.3); }
  100% { transform: scale(1); }
}

/* ===== EMPTY STATE ===== */
.empty-state {
  text-align: center;
  padding: 48px 24px;
}

.empty-emoji {
  font-size: 56px;
  margin-bottom: 16px;
  animation: float 3s ease-in-out infinite;
}

.empty-state h3 {
  font-size: 20px;
  font-weight: 600;
  margin-bottom: 8px;
}

.empty-state p {
  color: var(--text-secondary);
  font-size: 15px;
}

/* ===== FILTER BAR ===== */
.tasks-filter-bar {
  display: flex;
  gap: 8px;
  margin-bottom: 16px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  padding-bottom: 4px;
}

.filter-btn {
  flex-shrink: 0;
  padding: 8px 16px;
  border: 1.5px solid var(--border);
  border-radius: 20px;
  background: var(--bg-card);
  font-size: 14px;
  font-weight: 500;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.2s;
  font-family: inherit;
}

.filter-btn.active {
  background: var(--accent);
  color: var(--accent-text);
  border-color: var(--accent);
}

/* ===== CHECKLIST GRID ===== */
.checklist-categories {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.category-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 12px;
}

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

.checklist-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 20px 12px;
  background: var(--bg-card);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  cursor: pointer;
  transition: all 0.2s;
  border: 1.5px solid transparent;
  text-align: center;
}

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

.checklist-card:active { transform: scale(0.97); }

.checklist-card .card-emoji { font-size: 32px; }
.checklist-card .card-name { font-size: 14px; font-weight: 600; }
.checklist-card .card-count { font-size: 12px; color: var(--text-muted); }

/* ===== CHECKLIST MODAL ITEMS ===== */
.checklist-items {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 20px;
  max-height: 50vh;
  overflow-y: auto;
}

.checklist-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  background: var(--bg);
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
}

.checklist-item .item-emoji { font-size: 20px; }
.checklist-item .item-name { flex: 1; font-size: 15px; }

.checklist-item .item-import-btn {
  padding: 4px 12px;
  font-size: 12px;
  background: var(--accent-light);
  color: var(--accent);
  border: none;
  border-radius: 12px;
  cursor: pointer;
  font-weight: 600;
  font-family: inherit;
  transition: all 0.2s;
}
.checklist-item .item-import-btn:hover { background: var(--accent); color: white; }
.checklist-item .item-import-btn.imported { 
  background: var(--completed-bg); 
  color: var(--text-muted); 
  cursor: default; 
}

.import-options {
  border-top: 1px solid var(--border);
  padding-top: 16px;
}

.import-options h4 {
  font-size: 14px;
  color: var(--text-secondary);
  margin-bottom: 12px;
}

.day-select { flex: 1; }

/* ===== ROUTINE TABS ===== */
.routine-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 20px;
  background: var(--border-light);
  border-radius: var(--radius-md);
  padding: 4px;
}

.routine-tab {
  flex: 1;
  padding: 10px 8px;
  border: none;
  border-radius: var(--radius-sm);
  background: transparent;
  font-size: 14px;
  font-weight: 500;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.2s;
  font-family: inherit;
}

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

.routine-panel { display: none; }
.routine-panel.active { display: block; }

/* ===== BOTTOM NAVIGATION ===== */
.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 100;
  display: flex;
  align-items: flex-start;
  justify-content: space-around;
  background: rgba(255,255,255,0.92);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-top: 0.5px solid var(--border-light);
  padding: 8px 0;
  padding-bottom: max(8px, var(--safe-bottom));
  height: var(--nav-height);
}

.nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 6px 16px;
  border: none;
  background: none;
  cursor: pointer;
  transition: all 0.2s;
  -webkit-user-select: none;
  user-select: none;
  position: relative;
}

.nav-icon { font-size: 24px; line-height: 1; transition: transform 0.2s; }
.nav-label { font-size: 11px; font-weight: 500; color: var(--text-muted); transition: color 0.2s; }

.nav-item.active .nav-label { color: var(--accent); font-weight: 600; }
.nav-item.active .nav-icon { transform: scale(1.1); }

/* ===== FAB (Floating Action Button) ===== */
.fab {
  position: fixed;
  bottom: calc(var(--nav-height) + var(--safe-bottom) + 16px);
  right: 20px;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--accent);
  color: white;
  font-size: 28px;
  border: none;
  box-shadow: var(--shadow-lg);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  z-index: 60;
}

.fab:hover { transform: scale(1.05); background: var(--accent-hover); }
.fab:active { transform: scale(0.95); }

/* ===== MODALS ===== */
.modal {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  align-items: flex-end;
  justify-content: center;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.3);
  animation: fadeInBg 0.2s ease;
}

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

.modal-content {
  position: relative;
  width: 100%;
  max-width: 500px;
  max-height: 85vh;
  background: var(--bg-card);
  border-radius: var(--radius-xl) var(--radius-xl) 0 0;
  overflow: hidden;
  animation: slideUp 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  flex-direction: column;
}

.modal-full { max-height: 90vh; }
.modal-small { max-height: 40vh; }

@keyframes slideUp {
  from { transform: translateY(100%); }
  to { transform: translateY(0); }
}

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

.modal-header h3 {
  font-size: 18px;
  font-weight: 700;
}

.modal-body {
  padding: 16px 20px 24px;
  overflow-y: auto;
  flex: 1;
}

.modal-footer {
  display: flex;
  gap: 12px;
  margin-top: 20px;
}

.modal-footer .btn { flex: 1; }

/* ===== DAY BUTTONS ===== */
.day-buttons {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.day-btn {
  width: 42px;
  height: 42px;
  border: 1.5px solid var(--border);
  border-radius: 50%;
  background: var(--bg-card);
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.2s;
  font-family: inherit;
}

.day-btn.active {
  background: var(--accent);
  color: white;
  border-color: var(--accent);
}

/* ===== POSTPONE ===== */
.postpone-options {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

/* ===== CONFETTI ===== */
.confetti-container {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 9999;
  overflow: hidden;
}

.confetti-piece {
  position: absolute;
  width: 10px;
  height: 10px;
  border-radius: 2px;
  animation: confettiFall 1.5s ease-out forwards;
}

@keyframes confettiFall {
  0% { transform: translateY(0) rotate(0deg) scale(1); opacity: 1; }
  100% { transform: translateY(100vh) rotate(720deg) scale(0); opacity: 0; }
}

/* ===== SATISFACTION EFFECT ===== */
.satisfaction-burst {
  position: fixed;
  pointer-events: none;
  z-index: 9998;
  font-size: 32px;
  animation: burstFloat 1s ease-out forwards;
}

@keyframes burstFloat {
  0% { transform: scale(0) translateY(0); opacity: 1; }
  50% { transform: scale(1.2) translateY(-20px); opacity: 1; }
  100% { transform: scale(1) translateY(-60px); opacity: 0; }
}

/* ===== ROOM CARDS (Rooms View) ===== */
.room-cards {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.room-card {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 18px 20px;
  background: var(--bg-card);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  border: 1.5px solid var(--border-light);
  position: relative;
  overflow: hidden;
}

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

.room-card:active {
  transform: scale(0.98);
}

.room-card-emoji {
  font-size: 36px;
  min-width: 44px;
  text-align: center;
}

.room-card-info {
  flex: 1;
  min-width: 0;
}

.room-card-name {
  display: block;
  font-size: 17px;
  font-weight: 600;
  color: var(--text);
}

.room-card-count {
  display: block;
  font-size: 13px;
  color: var(--text-muted);
  margin-top: 2px;
}

.room-card-arrow {
  font-size: 24px;
  color: var(--text-muted);
  font-weight: 300;
}

/* ===== ROOM DETAIL VIEW ===== */
.room-detail-header {
  margin-bottom: 20px;
}

.btn-back {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: none;
  border: none;
  font-size: 16px;
  font-weight: 500;
  color: var(--accent);
  cursor: pointer;
  padding: 8px 0;
  margin-bottom: 8px;
  font-family: inherit;
  transition: opacity 0.2s;
}

.btn-back:hover { opacity: 0.7; }

.room-detail-title {
  display: flex;
  align-items: center;
  gap: 12px;
}

.room-detail-emoji {
  font-size: 40px;
}

.room-detail-title h2 {
  font-size: 24px;
  font-weight: 700;
}

/* ===== SETTINGS & ROOMS ===== */
.settings-section {
  margin-bottom: 20px;
}
.settings-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 12px;
}
.settings-divider {
  border: none;
  border-top: 1px solid var(--border-light);
  margin: 16px 0;
}

.rooms-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 12px;
}

.room-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  background: var(--bg);
  border-radius: var(--radius-sm);
  border: 1.5px solid var(--border);
  transition: all 0.2s;
}

.room-item-emoji {
  font-size: 22px;
  min-width: 28px;
  text-align: center;
}

.room-item-name {
  flex: 1;
  font-size: 15px;
  font-weight: 500;
}

.room-item-actions {
  display: flex;
  gap: 4px;
}

.btn-icon-sm {
  font-size: 18px;
  padding: 4px;
}

.color-picker-row {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  padding: 4px 0;
}

.color-swatch {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  cursor: pointer;
  border: 3px solid transparent;
  transition: all 0.2s;
  box-shadow: var(--shadow-sm);
}

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

.color-swatch:active {
  transform: scale(0.95);
}

/* ===== TOAST ===== */
.toast {
  position: fixed;
  bottom: calc(var(--nav-height) + var(--safe-bottom) + 20px);
  left: 50%;
  transform: translateX(-50%) translateY(100px);
  background: var(--text);
  color: white;
  padding: 12px 24px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 500;
  z-index: 300;
  animation: toastIn 0.3s ease, toastOut 0.3s ease 2s forwards;
  box-shadow: var(--shadow-lg);
  white-space: nowrap;
}

@keyframes toastIn {
  to { transform: translateX(-50%) translateY(0); }
}
@keyframes toastOut {
  to { transform: translateX(-50%) translateY(100px); opacity: 0; }
}

/* ===== RESPONSIVE ===== */

/* ===== ROOM FAB (positioned within room detail) ===== */
.room-fab {
  position: fixed;
  bottom: calc(var(--nav-height) + var(--safe-bottom) + 16px);
  right: 20px;
  z-index: 60;
}

/* ===== MODAL TABS ===== */
.modal-tabs {
  display: flex;
  gap: 0;
  padding: 0 20px;
  border-bottom: 1.5px solid var(--border);
}

.modal-tab {
  flex: 1;
  padding: 12px 8px;
  border: none;
  background: none;
  font-size: 14px;
  font-weight: 500;
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.2s;
  font-family: inherit;
  border-bottom: 2px solid transparent;
  margin-bottom: -1.5px;
}

.modal-tab.active {
  color: var(--accent);
  border-bottom-color: var(--accent);
  font-weight: 600;
}

.modal-tab-content {
  display: none;
}
.modal-tab-content.active {
  display: block;
}

/* ===== IMPORT ROOM SECTION ===== */
.import-room-section {
  padding: 4px 0;
}

.import-room-section .checklist-grid {
  gap: 8px;
}

/* ===== TASK DETAIL MODAL ===== */
.td-info-section {
  margin-bottom: 4px;
}

.td-info-meta {
  font-size: 13px;
  color: var(--text-muted);
  margin-top: 4px;
  line-height: 1.6;
}

.td-subtasks-section {
  margin-top: 4px;
}

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

.td-subtasks-header h4 {
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
}

.subtask-badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  background: var(--accent-light);
  color: var(--accent);
  font-size: 12px;
  font-weight: 700;
  border-radius: 12px;
  white-space: nowrap;
}

.subtask-badge.complete {
  background: #e8f5e9;
  color: #4caf50;
}

.subtask-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 12px;
  max-height: 40vh;
  overflow-y: auto;
}

.subtask-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  background: var(--bg);
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  transition: all 0.2s;
}

.subtask-item:hover {
  border-color: var(--accent);
}

.subtask-item.completed {
  opacity: 0.55;
}

.subtask-item.completed .subtask-title {
  text-decoration: line-through;
  color: var(--text-muted);
}

.subtask-checkbox {
  width: 22px;
  height: 22px;
  min-width: 22px;
  border-radius: 50%;
  border: 2px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  cursor: pointer;
  transition: all 0.2s;
  color: white;
}

.subtask-checkbox:hover {
  border-color: var(--accent);
}

.subtask-item.completed .subtask-checkbox {
  background: var(--accent);
  border-color: var(--accent);
}

.subtask-title {
  flex: 1;
  font-size: 15px;
  font-weight: 400;
}

.subtask-title-input {
  flex: 1;
  font-size: 15px;
  font-family: inherit;
  border: 1px solid var(--accent);
  border-radius: 6px;
  padding: 4px 8px;
  outline: none;
  background: white;
}

.subtask-delete-btn {
  background: none;
  border: none;
  font-size: 16px;
  cursor: pointer;
  padding: 2px 4px;
  border-radius: 4px;
  opacity: 0.4;
  transition: all 0.2s;
}

.subtask-delete-btn:hover {
  opacity: 1;
  background: rgba(255,107,107,0.1);
}

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

.subtask-add-row input {
  flex: 1;
  padding: 10px 14px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 15px;
  font-family: inherit;
  outline: none;
  background: var(--bg);
  transition: border-color 0.2s;
}

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

.td-actions {
  margin-top: 4px;
}

/* ===== TASK CARD SUBTASK BADGE ===== */
.task-subtask-badge {
  display: inline-flex;
  align-items: center;
  padding: 1px 7px;
  background: var(--accent-light);
  color: var(--accent);
  font-size: 11px;
  font-weight: 700;
  border-radius: 10px;
  white-space: nowrap;
  margin-left: 6px;
  vertical-align: middle;
}

.task-subtask-badge.complete {
  background: #e8f5e9;
  color: #4caf50;
}

/* ===== RESPONSIVE ===== */
@media (min-width: 768px) {
  .checklist-grid {
    grid-template-columns: repeat(3, 1fr);
  }
  .modal-content {
    border-radius: var(--radius-xl);
    margin-bottom: 20px;
  }
  .modal {
    align-items: center;
  }
}

@media (min-width: 1024px) {
  .checklist-grid {
    grid-template-columns: repeat(4, 1fr);
  }
}

/* ===== SCROLLBAR ===== */
::-webkit-scrollbar { width: 0; height: 0; }

/* ===== PULL TO REFRESH VISUAL ===== */
.refreshing .views-container {
  opacity: 0.6;
  transition: opacity 0.2s;
}
