/* ---- Base ---- */
* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
  background: #f4f4f5;
  color: #1a1a1a;
}

/* .app is the phone-shaped container: centered, max 480px wide,
   full height so the quick-add bar can stick to the bottom. */
.app {
  max-width: 480px;
  margin: 0 auto;
  min-height: 100vh;
  background: #ffffff;
  display: flex;
  flex-direction: column;
}

/* ---- Auth screen ---- */
.auth-screen {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 40px 24px;
  text-align: center;
}

.auth-screen h1 {
  font-size: 1.5rem;
  margin: 0 0 4px 0;
}

.auth-screen p {
  color: #6b7280;
  margin: 0;
}

.auth-screen input {
  padding: 10px 12px;
  min-height: 44px;
  border: 1px solid #d1d5db;
  border-radius: 8px;
  font-size: 1rem;
}

.auth-screen button {
  padding: 10px 16px;
  min-height: 44px;
  border: none;
  border-radius: 8px;
  background: #4338ca;
  color: white;
  font-weight: 600;
  cursor: pointer;
}

.auth-code-row {
  display: flex;
  gap: 8px;
}

.auth-code-row input {
  flex: 1;
  padding: 10px 12px;
  min-height: 44px;
  border: 1px solid #d1d5db;
  border-radius: 8px;
  font-size: 1rem;
}

.auth-code-row button {
  padding: 10px 16px;
  min-height: 44px;
  border: none;
  border-radius: 8px;
  background: #4338ca;
  color: white;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
}

.auth-status {
  font-size: 0.875rem;
  min-height: 1.2em;
}

.auth-account {
  font-size: 0.875rem;
  color: #6b7280;
  margin: 0;
}

/* ---- Header ---- */
.app-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px;
  border-bottom: 1px solid #e5e5e5;
}

.app-header h1 {
  font-size: 1.25rem;
  margin: 0;
}

.quarter-badge {
  font-size: 0.875rem;
  background: #eef2ff;
  color: #4338ca;
  padding: 4px 10px;
  border-radius: 999px;
  font-weight: 600;
  white-space: nowrap;
}

/* ---- Tabs ---- */
.tabs {
  display: flex;
  border-bottom: 1px solid #e5e5e5;
}

.tab-btn {
  flex: 1;
  padding: 12px 4px;
  border: none;
  background: none;
  font-size: 0.9rem;
  color: #6b7280;
  cursor: pointer;
  border-bottom: 2px solid transparent;
}

.tab-btn.active {
  color: #4338ca;
  border-bottom-color: #4338ca;
  font-weight: 600;
}

/* ---- Tab content ---- */
.tab-content {
  flex: 1;
  padding: 16px;
  overflow-y: auto;
}

.tab-panel {
  display: none;
}

.tab-panel.active {
  display: block;
}

/* ---- Cards (used for Now / Someday / Done / Goals entries) ---- */
.card {
  background: #ffffff;
  border: 1px solid #e5e5e5;
  border-radius: 10px;
  padding: 12px 14px;
  margin-bottom: 10px;
}

.card-title {
  font-weight: 600;
  margin: 0 0 4px 0;
}

.card-title.editable {
  cursor: pointer;
}

.card-title.editable:hover {
  text-decoration: underline;
}

.card-note {
  font-size: 0.875rem;
  color: #6b7280;
  margin: 0 0 8px 0;
}

.card button {
  font-size: 0.875rem;
  padding: 6px 12px;
  min-height: 44px;
  border: 1px solid #d1d5db;
  border-radius: 6px;
  background: #f9fafb;
  cursor: pointer;
}

.card-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 8px;
}

.secondary-btn {
  background: #ffffff !important;
  color: #374151;
}

.icon-btn {
  min-width: 44px;
  padding: 6px !important;
  color: #b91c1c;
  border-color: #fecaca !important;
  background: #fff5f5 !important;
  font-size: 1.1rem !important;
}

/* ---- Edit form (shown in place of a card when editing) ---- */
.edit-form {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.edit-form input {
  padding: 8px 10px;
  min-height: 44px;
  border: 1px solid #d1d5db;
  border-radius: 6px;
  font-size: 1rem;
}

/* ---- Now-list discipline banner ---- */
.now-banner {
  background: #fff7ed;
  color: #9a3412;
  padding: 10px 12px;
  border-radius: 8px;
  font-size: 0.875rem;
  margin: 0 0 12px 0;
}

/* ---- Someday search + count ---- */
.someday-toolbar {
  margin-bottom: 8px;
}

.someday-toolbar input[type="search"] {
  width: 100%;
  padding: 10px 12px;
  min-height: 44px;
  border: 1px solid #d1d5db;
  border-radius: 8px;
  font-size: 1rem;
}

.list-count {
  font-size: 0.875rem;
  color: #6b7280;
  margin: 4px 0 12px 0;
}

/* ---- Not-to-do list ---- */
.not-to-do {
  margin-top: 20px;
  border-top: 1px solid #e5e5e5;
  padding-top: 12px;
}

.not-to-do summary {
  cursor: pointer;
  font-weight: 600;
  padding: 4px 0;
}

.not-to-do-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  padding: 8px 0;
  border-bottom: 1px solid #f0f0f0;
  font-size: 0.9rem;
}

.not-to-do-row span {
  color: #6b7280;
}

#add-not-to-do-btn {
  margin-top: 8px;
  min-height: 44px;
  padding: 6px 12px;
  border: 1px solid #d1d5db;
  border-radius: 6px;
  background: #f9fafb;
  cursor: pointer;
  font-size: 0.875rem;
}

/* ---- Data / backup panel ---- */
.data-panel {
  margin: 0 16px;
  border-top: 1px solid #e5e5e5;
  padding: 8px 0;
}

.data-panel summary {
  cursor: pointer;
  font-size: 0.875rem;
  color: #6b7280;
}

.data-panel-body {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 10px;
}

.data-panel-body button {
  min-height: 44px;
  padding: 8px 12px;
  border: 1px solid #d1d5db;
  border-radius: 6px;
  background: #f9fafb;
  cursor: pointer;
  font-size: 0.875rem;
}

.import-label {
  font-size: 0.875rem;
  color: #374151;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

/* ---- Quick-add bar: stays at the bottom of the app container ---- */
.quick-add {
  display: flex;
  gap: 8px;
  padding: 12px 16px;
  border-top: 1px solid #e5e5e5;
  background: #ffffff;
}

.quick-add input {
  flex: 1;
  padding: 10px 12px;
  border: 1px solid #d1d5db;
  border-radius: 8px;
  font-size: 1rem;
}

.quick-add button {
  padding: 10px 16px;
  border: none;
  border-radius: 8px;
  background: #4338ca;
  color: white;
  font-weight: 600;
  cursor: pointer;
}
