* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Nunito', 'Segoe UI', sans-serif;
  background: linear-gradient(170deg, #fdf6ec 0%, #fef9f2 40%, #f5efe6 100%);
  min-height: 100vh;
  color: #3d2e1f;
}

#app {
  max-width: 720px;
  margin: 0 auto;
  padding: 0 16px 40px;
}

/* Header */
.header {
  text-align: center;
  padding: 28px 0 8px;
}

.title {
  font-size: 28px;
  font-weight: 800;
  margin: 0;
  letter-spacing: -0.5px;
  background: linear-gradient(135deg, #c45e2c, #a0522d);
  -webkit-background-clip: text;
  background-clip: text;
}

/* Navigation */
.nav {
  display: flex;
  gap: 8px;
  margin: 16px 0;
  background: #ede4d8;
  border-radius: 12px;
  padding: 4px;
}

.nav-btn {
  flex: 1;
  padding: 10px 0;
  border: none;
  border-radius: 10px;
  background: transparent;
  font-size: 14px;
  font-weight: 600;
  color: #7a6b5d;
  cursor: pointer;
  transition: all 0.2s;
  font-family: inherit;
}

.nav-btn.active {
  background: #fff;
  color: #3d2e1f;
  box-shadow: 0 1px 4px rgba(0,0,0,0.08);
}

/* Error Bar */
.error-bar {
  background: #fdecea;
  color: #b71c1c;
  padding: 10px 14px;
  border-radius: 10px;
  font-size: 13px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

.error-close {
  background: none;
  border: none;
  color: #b71c1c;
  font-size: 16px;
  cursor: pointer;
  padding: 0 4px;
}

/* Section */
.section {
  margin-top: 4px;
}

/* Buttons */
.btn-primary {
  padding: 10px 20px;
  border-radius: 10px;
  border: none;
  background: linear-gradient(135deg, #c45e2c, #a0522d);
  color: #fff;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s;
  white-space: nowrap;
  font-family: inherit;
}

.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 2px 8px rgba(196, 94, 44, 0.3);
}

.btn-primary:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

.btn-secondary {
  padding: 10px 20px;
  border-radius: 10px;
  border: 1.5px solid #c9bdb0;
  background: #fff;
  color: #5d4e3f;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
}

.btn-secondary:hover {
  background: #f9f6f3;
}

.btn-link {
  background: none;
  border: none;
  color: #c45e2c;
  font-weight: 700;
  font-size: 14px;
  cursor: pointer;
  text-decoration: underline;
  font-family: inherit;
}

/* Plan Controls */
.plan-controls {
  display: flex;
  gap: 12px;
  align-items: flex-end;
  flex-wrap: wrap;
  margin-bottom: 16px;
}

.date-label {
  font-size: 13px;
  font-weight: 600;
  color: #7a6b5d;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

select, input[type="text"], input[type="password"] {
  padding: 8px 12px;
  border-radius: 8px;
  border: 1.5px solid #d9cfc3;
  font-size: 14px;
  font-family: inherit;
  background: #fff;
  color: #3d2e1f;
}

select {
  cursor: pointer;
}

input[type="text"], input[type="password"] {
  min-width: 200px;
}

/* Plan Grid */
.plan-grid {
  display: grid;
  gap: 8px;
  margin-bottom: 16px;
}

.plan-card {
  background: #fff;
  border-radius: 12px;
  padding: 12px 16px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.05);
  border: 1px solid #ebe3d9;
}

/* Drop Placeholder */
.drop-placeholder {
  background: rgba(196, 94, 44, 0.06);
  border-radius: 12px;
  padding: 12px 16px;
  border: 2px dashed #c45e2c;
  min-height: 70px;
}

.plan-card.dragging {
  opacity: 0.3;
  pointer-events: none;
}

.plan-day-header {
  font-size: 12px;
  font-weight: 700;
  color: #a0522d;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 4px;
}

.plan-dish-name {
  font-size: 16px;
  font-weight: 700;
  color: #3d2e1f;
}

.plan-category {
  font-size: 12px;
  color: #9a8576;
  margin-top: 2px;
}

.plan-last-cooked {
  font-size: 11px;
  color: #b8a99a;
  margin-top: 2px;
}

.plan-empty {
  font-size: 16px;
  color: #ccc;
}

.plan-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

/* Dish Controls */
.dish-controls {
  display: flex;
  gap: 10px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

/* Import Box */
.import-box {
  background: #fff;
  border-radius: 14px;
  padding: 20px;
  margin-bottom: 16px;
  border: 1.5px dashed #c9bdb0;
}

.import-title {
  font-size: 16px;
  font-weight: 700;
  margin: 0 0 12px;
}

.import-default-btn {
  width: 100%;
  padding: 14px;
  border-radius: 10px;
  border: 1.5px solid #c45e2c;
  background: #fef3eb;
  color: #a0522d;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  font-family: inherit;
}

.import-default-btn:hover {
  background: #fde9d8;
}

.import-or {
  text-align: center;
  color: #b8a99a;
  font-size: 13px;
  margin: 12px 0;
}

.import-textarea {
  width: 100%;
  min-height: 80px;
  border-radius: 8px;
  border: 1.5px solid #d9cfc3;
  padding: 12px;
  font-size: 13px;
  font-family: monospace;
  resize: vertical;
  margin-bottom: 10px;
}

/* Empty State */
.empty-state {
  text-align: center;
  padding: 40px 20px;
  color: #9a8576;
}

.empty-icon {
  font-size: 48px;
  margin: 0 0 8px;
}

/* Category Group */
.cat-group {
  margin-bottom: 16px;
}

.cat-title {
  font-size: 14px;
  font-weight: 700;
  color: #a0522d;
  margin: 0 0 6px;
  padding: 4px 0;
  border-bottom: 1px solid #ebe3d9;
}

.dish-list {
  display: grid;
  gap: 4px;
}

.dish-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: #fff;
  border-radius: 8px;
  padding: 8px 12px;
  border: 1px solid #f0e9e0;
  font-size: 14px;
}

.dish-name {
  font-weight: 600;
  flex: 1;
  margin-right: 12px;
}

.dish-date {
  font-size: 12px;
  color: #9a8576;
  white-space: nowrap;
}

/* Loading */
.loading-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
}

.spinner {
  width: 32px;
  height: 32px;
  border: 3px solid #ede4d8;
  border-top: 3px solid #c45e2c;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

.loading-text {
  margin-top: 12px;
  color: #9a8576;
  font-size: 14px;
}

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

/* API Key Section */
.api-key-box {
  background: #fff3e0;
  border: 1.5px solid #f39c12;
  border-radius: 10px;
  padding: 12px 16px;
  margin-bottom: 16px;
}

.api-key-label {
  font-size: 12px;
  font-weight: 600;
  color: #8b5e34;
  margin-bottom: 6px;
  display: block;
}

.api-key-hint {
  font-size: 11px;
  color: #9a8576;
  margin-top: 4px;
}
