* {
  box-sizing: border-box;
  -webkit-box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  padding: 0;
  font-family: "Inter", system-ui, -apple-system, sans-serif;
  background: #f7f7f7;
  color: #111;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  min-height: 100vh;
  width: 100%;
  overflow-x: hidden;
}

.container {
  max-width: 600px;
  margin: 0 auto;
  padding: 16px;
  width: 100%;
  min-height: 100vh;
  padding-bottom: 80px;
}

h1 {
  text-align: center;
  font-size: 1.5rem;
  margin-bottom: 20px;
  margin-top: 24px;
  font-weight: 600;
}

h2, h3 {
  font-size: 1.1rem;
  margin-bottom: 12px;
  font-weight: 600;
  color: #111;
}

/* Sections */
.connect-section,
.focus-section {
  background: white;
  border-radius: 12px;
  padding: 16px;
  margin-bottom: 20px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
  -webkit-box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.focus {
  min-height: 0;
}

.card-list,
#focus,
#taskList {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

/* Cards */
.card {
  background: #f9f9f9;
  border-radius: 8px;
  padding: 12px;
  border: 1px solid #eee;
  border-left: 4px solid #ccc;
}

.card b {
  font-size: 1rem;
  font-weight: 600;
  color: #111;
  display: block;
  margin-bottom: 4px;
}

.card .badges {
  font-size: 0.85rem;
  color: #666;
  margin-bottom: 8px;
}

/* Quadrant colors */
.card.q-do    { border-left-color: #e53935; }
.card.q-invest { border-left-color: #8e24aa; }
.card.q-quick { border-left-color: #d4a017; }
.card.q-low   { border-left-color: #1e88e5; }

.card-actions {
  margin-top: 12px;
}

.card-actions .btn-primary {
  width: 100%;
  margin-top: 0;
}

/* FAB */
.fab {
  position: fixed;
  bottom: 24px;
  right: 24px;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  font-size: 28px;
  font-weight: 300;
  line-height: 1;
  border: none;
  background: #111;
  color: white;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
  -webkit-appearance: none;
  appearance: none;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
}

.fab:active {
  background: #333;
}

/* Modal */
.modal {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  z-index: 1000;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.4);
}

.modal-content {
  position: relative;
  background: white;
  padding: 20px;
  border-radius: 12px;
  width: 100%;
  max-width: 400px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.15);
}

.modal-title {
  font-size: 1.2rem;
  font-weight: 600;
  margin-bottom: 16px;
  margin-top: 0;
}

.modal.hidden {
  display: none;
}

/* Form */
.form-group {
  margin-bottom: 16px;
}

.form-group label {
  display: block;
  font-size: 0.85rem;
  font-weight: 500;
  color: #666;
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.form-group input[type="text"],
.form-group input[type="date"],
.form-group input[type="checkbox"],
.form-group select {
  width: 100%;
  padding: 12px;
  font-size: 16px;
  border-radius: 8px;
  border: 1px solid #ddd;
  -webkit-appearance: none;
  appearance: none;
  background: #fff;
}

.form-group input[type="text"]:focus,
.form-group input[type="date"]:focus,
.form-group select:focus {
  outline: none;
  border-color: #3b82f6;
}

.form-group select {
  cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23333' d='M6 9L1 4h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  padding-right: 35px;
}

/* Toggle switch (Important / Urgent) */
.toggle-wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.toggle-wrap .toggle-label {
  margin-bottom: 0;
  text-transform: uppercase;
  font-size: 0.85rem;
  font-weight: 500;
  color: #666;
}

.toggle-switch {
  position: relative;
  width: 52px;
  height: 28px;
  flex-shrink: 0;
}

.toggle-switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.toggle-switch .slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: #ccc;
  border-radius: 28px;
  transition: background-color 0.2s;
}

.toggle-switch .slider::before {
  position: absolute;
  content: "";
  height: 20px;
  width: 20px;
  left: 4px;
  bottom: 4px;
  background-color: white;
  border-radius: 50%;
  transition: transform 0.2s;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.toggle-switch input:checked + .slider {
  background-color: #111;
}

.toggle-switch input:checked + .slider::before {
  transform: translateX(24px);
}

.modal-actions {
  display: flex;
  gap: 10px;
  margin-top: 20px;
}

.modal-actions .btn-primary,
.modal-actions .btn-secondary {
  flex: 1;
}

.btn-primary {
  padding: 12px;
  font-size: 1rem;
  font-weight: 500;
  border-radius: 8px;
  border: none;
  background: #111;
  color: white;
  cursor: pointer;
  -webkit-appearance: none;
  appearance: none;
  margin-top: 0;
}

.btn-primary:active {
  background: #333;
}

.btn-secondary {
  padding: 12px;
  font-size: 1rem;
  font-weight: 500;
  border-radius: 8px;
  border: 1px solid #ddd;
  background: #f0f0f0;
  color: #111;
  cursor: pointer;
  -webkit-appearance: none;
  appearance: none;
}

.btn-secondary:active {
  background: #e0e0e0;
}

.empty-state {
  text-align: center;
  padding: 24px 16px;
  color: #999;
  font-size: 0.9rem;
}

@media (min-width: 768px) {
  .container {
    padding: 24px;
    padding-bottom: 88px;
  }

  .fab {
    bottom: 32px;
    right: calc(50% - 300px + 24px);
  }
}
