/* ═══════════════════════════════════════════════════════════════════════════
   Plateby — Yemek Planlayıcı  |  "Editorial Kitchen" Design System
   ═══════════════════════════════════════════════════════════════════════════ */

@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:wght@400;600;700&family=DM+Sans:wght@300;400;500;600&display=swap');

/* ── Variables ────────────────────────────────────────────────────────────── */
:root {
  --bg:        #FAF7F2;
  --surface:   #FFFFFF;
  --surface-2: #F3EDE3;
  --primary:   #C4622D;
  --primary-h: #A84E22;
  --secondary: #2D4A3E;
  --accent:    #E8B84B;
  --danger:    #C0392B;

  --text-1: #1A1A18;
  --text-2: #5C5A54;
  --text-3: #9A9188;
  --border: #E0D8CC;

  --radius-sm: 6px;
  --radius:    12px;
  --radius-lg: 20px;

  --shadow-sm: 0 1px 3px rgba(0,0,0,.08);
  --shadow:    0 4px 16px rgba(0,0,0,.10);
  --shadow-lg: 0 12px 40px rgba(0,0,0,.14);

  --sidebar-w: 240px;
  --transition: 200ms ease;

  --font-display: 'Playfair Display', Georgia, serif;
  --font-body:    'DM Sans', system-ui, sans-serif;
}

/* ── Reset ────────────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; }
body {
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--text-1);
  min-height: 100vh;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }
button { cursor: pointer; font-family: inherit; border: none; background: none; }
input { font-family: inherit; }

/* ── Layout ───────────────────────────────────────────────────────────────── */
#app {
  display: grid;
  grid-template-columns: var(--sidebar-w) 1fr;
  min-height: 100vh;
}

/* ── Sidebar ──────────────────────────────────────────────────────────────── */
#sidebar {
  background: var(--secondary);
  display: flex;
  flex-direction: column;
  padding: 0;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
}

.sidebar-logo {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px 16px;
  border-bottom: 1px solid rgba(255,255,255,.1);
}
.sidebar-logo-img {
  width: 130px;
  height: auto;
  object-fit: contain;
  background: #fff;
  border-radius: 10px;
  padding: 8px 12px;
}
.logo-icon { font-size: 24px; }
.logo-text {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 700;
  color: #FFFFFF;
  letter-spacing: -0.5px;
}

.nav-svg {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}
.nav-item .nav-svg path,
.nav-item .nav-svg rect,
.nav-item .nav-svg circle,
.nav-item .nav-svg line {
  opacity: 0.8;
  transition: opacity var(--transition);
}
.nav-item.active .nav-svg path,
.nav-item.active .nav-svg rect,
.nav-item.active .nav-svg circle,
.nav-item.active .nav-svg line,
.nav-item:hover .nav-svg path,
.nav-item:hover .nav-svg rect,
.nav-item:hover .nav-svg circle,
.nav-item:hover .nav-svg line {
  opacity: 1;
}

.sidebar-nav {
  padding: 16px 12px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  color: rgba(255,255,255,.7);
  font-size: 14px;
  font-weight: 500;
  transition: background var(--transition), color var(--transition);
  position: relative;
}
.nav-item:hover { background: rgba(255,255,255,.08); color: #fff; }
.nav-item.active { background: rgba(255,255,255,.15); color: #fff; }
.nav-icon { font-size: 16px; width: 20px; height: 20px; display: flex; align-items: center; justify-content: center; text-align: center; }
.nav-badge {
  margin-left: auto;
  background: var(--accent);
  color: var(--text-1);
  font-size: 11px;
  font-weight: 600;
  padding: 2px 7px;
  border-radius: 20px;
  min-width: 20px;
  text-align: center;
}

.sidebar-plans {
  flex: 1;
  padding: 0 12px 16px;
  overflow-y: auto;
}
.plans-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: rgba(255,255,255,.4);
  padding: 12px 4px 8px;
}
.new-plan-btn {
  width: 22px; height: 22px;
  border-radius: 50%;
  background: rgba(255,255,255,.15);
  color: #fff;
  font-size: 16px;
  line-height: 1;
  display: flex; align-items: center; justify-content: center;
  transition: background var(--transition);
}
.new-plan-btn:hover { background: var(--primary); }

.plan-list { display: flex; flex-direction: column; gap: 4px; }
.no-plans { font-size: 13px; color: rgba(255,255,255,.35); padding: 8px 4px; }

.plan-item {
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background var(--transition);
  border-left: 3px solid transparent;
}
.plan-item:hover { background: rgba(255,255,255,.06); }
.plan-item.active { background: rgba(255,255,255,.1); border-left-color: var(--accent); }
.plan-item-name { font-size: 13px; font-weight: 500; color: #fff; line-height: 1.3; }
.plan-item-meta { font-size: 11px; color: rgba(255,255,255,.4); margin-top: 2px; }
.plan-item-stats { font-size: 11px; color: rgba(255,255,255,.3); margin-top: 2px; }

/* ── Main Content ─────────────────────────────────────────────────────────── */
#main-content {
  padding: 40px 48px;
  max-width: 1100px;
  overflow-y: auto;
}

/* ── Buttons ──────────────────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 10px 20px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 500;
  border: 1.5px solid var(--border);
  background: var(--surface);
  color: var(--text-1);
  transition: all var(--transition);
}
.btn:hover { border-color: var(--text-3); background: var(--surface-2); }
.btn-primary {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
}
.btn-primary:hover { background: var(--primary-h); border-color: var(--primary-h); }
.btn-sm { padding: 6px 14px; font-size: 13px; }
.btn:disabled { opacity: .5; cursor: not-allowed; }

/* ── Planner Header ───────────────────────────────────────────────────────── */
.planner-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 32px;
  flex-wrap: wrap;
  gap: 16px;
}
.plan-name {
  font-family: var(--font-display);
  font-size: 28px;
  font-weight: 700;
  color: var(--text-1);
  line-height: 1.2;
}
.plan-range { color: var(--text-3); font-size: 14px; margin-top: 4px; }

.planner-controls { display: flex; align-items: center; gap: 12px; }

.view-toggle {
  display: flex;
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  overflow: hidden;
}
.view-btn {
  padding: 7px 14px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-2);
  transition: all var(--transition);
}
.view-btn.active { background: var(--text-1); color: #fff; }
.view-btn:not(.active):hover { background: var(--surface-2); }

.stat-badge {
  font-size: 13px;
  color: var(--text-2);
  background: var(--surface-2);
  padding: 6px 12px;
  border-radius: 20px;
  border: 1px solid var(--border);
}

/* ── Day Cards ────────────────────────────────────────────────────────────── */
.day-cards {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.day-card {
  background: var(--surface);
  border-radius: var(--radius);
  border: 1.5px solid var(--border);
  overflow: hidden;
  transition: box-shadow var(--transition);
}
.day-card:hover { box-shadow: var(--shadow); }
.day-card.day-confirmed { border-color: #4CAF50; }

.day-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 20px;
  background: var(--surface-2);
  border-bottom: 1px solid var(--border);
}
.day-info { display: flex; align-items: baseline; gap: 10px; }
.day-name {
  font-family: var(--font-display);
  font-size: 17px;
  font-weight: 600;
  color: var(--text-1);
  text-transform: capitalize;
}
.day-date { font-size: 13px; color: var(--text-3); }
.confirmed-badge {
  font-size: 12px;
  font-weight: 600;
  color: #2e7d32;
  background: #e8f5e9;
  padding: 3px 10px;
  border-radius: 20px;
}

.meal-slots { display: flex; gap: 0; }

.meal-slot {
  flex: 1;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  border-right: 1px solid var(--border);
  position: relative;
  transition: background var(--transition);
}
.meal-slot:last-child { border-right: none; }
.meal-slot.slot-confirmed { background: #f9fef9; }
.meal-slot-empty { opacity: .7; }

.slot-type-label {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--text-3);
}

.slot-content { flex: 1; }
.slot-meal-name {
  font-size: 15px;
  font-weight: 600;
  color: var(--text-1);
  line-height: 1.3;
  margin-bottom: 8px;
}
.slot-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  margin-bottom: 8px;
}

.time-badge {
  font-size: 11px;
  padding: 2px 7px;
  border-radius: 20px;
  font-weight: 500;
}
.time-badge.prep { background: #fff3e0; color: #e65100; }
.time-badge.cook { background: #e8f5e9; color: #2e7d32; }

.difficulty-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}
.cal-badge { font-size: 11px; color: var(--text-3); }

.slot-tags { display: flex; flex-wrap: wrap; gap: 4px; }
.tag {
  font-size: 11px;
  background: var(--surface-2);
  color: var(--text-2);
  padding: 2px 8px;
  border-radius: 20px;
  border: 1px solid var(--border);
}

.slot-actions {
  display: flex;
  gap: 4px;
  margin-top: auto;
}
.slot-action-btn {
  width: 30px; height: 30px;
  border-radius: 50%;
  border: 1.5px solid var(--border);
  font-size: 14px;
  display: flex; align-items: center; justify-content: center;
  color: var(--text-2);
  transition: all var(--transition);
  background: var(--surface);
}
.slot-action-btn:hover { border-color: var(--primary); color: var(--primary); }
.slot-action-btn.confirm-btn.confirmed { background: #4CAF50; border-color: #4CAF50; color: #fff; }

.slot-add-btn {
  font-size: 13px;
  color: var(--text-3);
  border: 1.5px dashed var(--border);
  border-radius: var(--radius-sm);
  padding: 8px;
  width: 100%;
  transition: all var(--transition);
}
.slot-add-btn:hover { border-color: var(--primary); color: var(--primary); }

/* ── Calendar View ────────────────────────────────────────────────────────── */
.calendar-view { overflow-x: auto; }
.calendar-grid {
  display: grid;
  gap: 1px;
  background: var(--border);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  min-width: 600px;
}
.cal-cell {
  background: var(--surface);
  padding: 12px;
  min-height: 40px;
}
.cal-corner { background: var(--surface-2); }
.cal-date-header {
  background: var(--surface-2);
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
}
.cal-day-name { font-size: 11px; color: var(--text-3); text-transform: capitalize; }
.cal-day-num { font-size: 18px; font-weight: 700; color: var(--text-1); }

.cal-meal-label {
  background: var(--surface-2);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  font-weight: 600;
  color: var(--text-2);
  text-transform: uppercase;
  letter-spacing: .04em;
  text-align: center;
}

.cal-meal-cell { padding: 8px; }
.cal-meal-cell.cal-confirmed { background: #f9fef9; }

.cal-meal {
  display: flex;
  flex-direction: column;
  gap: 4px;
  cursor: pointer;
}
.cal-meal-name { font-size: 12px; font-weight: 500; color: var(--text-1); line-height: 1.3; }
.cal-meal-meta { display: flex; align-items: center; gap: 6px; font-size: 11px; color: var(--text-3); }
.cal-actions { display: flex; gap: 4px; margin-top: 4px; }
.cal-btn {
  font-size: 11px;
  padding: 2px 6px;
  border-radius: 4px;
  border: 1px solid var(--border);
  color: var(--text-2);
  transition: all var(--transition);
  background: var(--surface);
}
.cal-btn:hover { border-color: var(--primary); color: var(--primary); }
.cal-btn.confirm-btn.confirmed { background: #4CAF50; border-color: #4CAF50; color: #fff; }
.cal-empty-btn {
  width: 100%; height: 100%; min-height: 60px;
  border: 1.5px dashed var(--border);
  border-radius: var(--radius-sm);
  font-size: 18px;
  color: var(--text-3);
  transition: all var(--transition);
}
.cal-empty-btn:hover { border-color: var(--primary); color: var(--primary); }

/* ── Shopping View ────────────────────────────────────────────────────────── */
.shopping-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 24px;
  flex-wrap: wrap;
  gap: 16px;
}
.shopping-header h2 {
  font-family: var(--font-display);
  font-size: 28px;
  font-weight: 700;
}
.shopping-controls { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }

.progress-bar-wrap {
  position: relative;
  height: 8px;
  background: var(--surface-2);
  border-radius: 20px;
  margin-bottom: 8px;
  overflow: visible;
}
.progress-bar {
  height: 100%;
  background: linear-gradient(90deg, var(--primary), var(--accent));
  border-radius: 20px;
  transition: width 400ms ease;
}
.progress-label {
  font-size: 12px;
  color: var(--text-3);
  display: block;
  text-align: right;
  margin-bottom: 24px;
  margin-top: 4px;
}

.shopping-group {
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  margin-bottom: 12px;
}
.shopping-group-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  background: var(--surface-2);
  border-bottom: 1px solid var(--border);
}
.group-icon { font-size: 18px; }
.group-name { font-weight: 600; font-size: 14px; flex: 1; }
.group-count { font-size: 12px; color: var(--text-3); }

.shopping-items { padding: 4px 0; }

.shopping-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 16px;
  cursor: pointer;
  transition: background var(--transition);
  border-bottom: 1px solid var(--border);
}
.shopping-item:last-child { border-bottom: none; }
.shopping-item:hover { background: var(--surface-2); }
.shopping-item.item-checked .item-name { text-decoration: line-through; color: var(--text-3); }
.shopping-item.item-checked { opacity: .6; }

.item-checkbox {
  width: 20px; height: 20px;
  border-radius: 50%;
  border: 2px solid var(--border);
  display: flex; align-items: center; justify-content: center;
  font-size: 11px;
  color: #fff;
  flex-shrink: 0;
  transition: all var(--transition);
}
.item-checkbox.checked { background: #4CAF50; border-color: #4CAF50; }

.item-name { flex: 1; font-size: 14px; }
.item-amount { font-size: 13px; color: var(--text-3); font-variant-numeric: tabular-nums; }

/* ── Settings ─────────────────────────────────────────────────────────────── */
.settings-page { max-width: 600px; }
.settings-page h2 {
  font-family: var(--font-display);
  font-size: 28px;
  font-weight: 700;
  margin-bottom: 32px;
}

.settings-section {
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  margin-bottom: 16px;
}
.settings-section h3 {
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 8px;
}
.settings-desc { font-size: 13px; color: var(--text-3); margin-bottom: 16px; line-height: 1.6; }

.form-group { margin-bottom: 16px; }
.form-group:last-child { margin-bottom: 0; }
.form-group label {
  display: block;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-2);
  margin-bottom: 6px;
}
.form-input {
  width: 100%;
  padding: 10px 14px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 14px;
  background: var(--surface);
  color: var(--text-1);
  transition: border-color var(--transition);
}
.form-input:focus { outline: none; border-color: var(--primary); }
.form-input-sm { width: 80px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.input-row { display: flex; gap: 8px; }
.input-row .form-input { flex: 1; }

.tag-input-area { }
.excluded-tags { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; min-height: 10px; }
.excluded-tag {
  display: flex;
  align-items: center;
  gap: 6px;
  background: #fdeaea;
  border: 1px solid #f5b3b3;
  color: var(--danger);
  font-size: 13px;
  padding: 4px 10px;
  border-radius: 20px;
}
.tag-remove {
  font-size: 15px;
  line-height: 1;
  opacity: .6;
  transition: opacity var(--transition);
}
.tag-remove:hover { opacity: 1; }

.meal-type-toggles { display: flex; gap: 12px; flex-wrap: wrap; }
.toggle-label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  cursor: pointer;
  padding: 8px 16px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  transition: all var(--transition);
  user-select: none;
}
.toggle-label:has(input:checked) { border-color: var(--primary); color: var(--primary); background: #fef6f2; }
.toggle-label input { display: none; }

.settings-actions { margin-top: 24px; }
.form-actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 24px; }

/* ── Modal ────────────────────────────────────────────────────────────────── */
#modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.5);
  backdrop-filter: blur(4px);
  z-index: 1000;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
#modal-overlay.active { display: flex; }

.modal {
  background: var(--surface);
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 520px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: var(--shadow-lg);
  position: relative;
  animation: modal-in 200ms ease;
}
@keyframes modal-in {
  from { opacity: 0; transform: translateY(12px) scale(.98); }
  to   { opacity: 1; transform: none; }
}

.modal-close {
  position: absolute;
  top: 16px; right: 16px;
  width: 32px; height: 32px;
  border-radius: 50%;
  border: 1.5px solid var(--border);
  font-size: 18px;
  color: var(--text-2);
  display: flex; align-items: center; justify-content: center;
  transition: all var(--transition);
  background: var(--surface);
  z-index: 1;
}
.modal-close:hover { background: var(--surface-2); }

/* SONRA */
.modal-body { padding: 32px; user-select: text; }
.ingredient-list li  { user-select: text; cursor: text; }
.instructions-section p { user-select: text; cursor: text; }

/* Meal Modal */
.meal-modal-header { margin-bottom: 24px; }
.meal-modal-header h2 {
  font-family: var(--font-display);
  font-size: 24px;
  font-weight: 700;
  line-height: 1.2;
  margin-bottom: 12px;
}
.meal-modal-meta { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }
.meta-chip {
  font-size: 12px;
  font-weight: 500;
  padding: 4px 10px;
  border-radius: 20px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  color: var(--text-2);
}
.meta-chip.prep { background: #fff3e0; border-color: #ffe0b2; }
.meta-chip.cook { background: #e8f5e9; border-color: #c8e6c9; }
.meta-chip.cal  { background: #fce4ec; border-color: #f8bbd0; }

.prep-reminder {
  background: #fff8e1;
  border: 1px solid #ffe082;
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  font-size: 13px;
  color: #e65100;
}

.meal-modal-body h3 {
  font-size: 14px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--text-3);
  margin-bottom: 12px;
  margin-top: 20px;
}

.ingredient-list { list-style: none; }
.ingredient-list li {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 0;
  border-bottom: 1px solid var(--border);
  font-size: 14px;
}
.ingredient-list li:last-child { border-bottom: none; }
.ing-name { color: var(--text-1); }
.ing-amount { color: var(--text-3); font-variant-numeric: tabular-nums; }

.instructions-section p { font-size: 14px; color: var(--text-2); line-height: 1.7; }

.meal-modal-actions {
  display: flex;
  gap: 10px;
  margin-top: 28px;
  padding-top: 20px;
  border-top: 1px solid var(--border);
}
.meal-modal-actions .btn-primary { flex: 1; justify-content: center; }

/* New Plan Modal */
.new-plan-modal h2, .reminder-modal h2 {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 700;
  margin-bottom: 8px;
}
.modal-desc { font-size: 14px; color: var(--text-3); margin-bottom: 24px; }

/* Reminder Modal */
.reminder-modal { text-align: center; }
.reminder-icon { font-size: 48px; margin-bottom: 16px; }
.reminder-modal p { color: var(--text-2); margin-bottom: 8px; }

/* ── Loading Overlay ──────────────────────────────────────────────────────── */
#loading-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(255,255,255,.85);
  backdrop-filter: blur(6px);
  z-index: 2000;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 16px;
}
#loading-overlay.active { display: flex; }
.loading-spinner {
  width: 48px; height: 48px;
  border: 4px solid var(--surface-2);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 800ms linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.loading-text {
  font-size: 15px;
  color: var(--text-2);
  font-weight: 500;
}

/* ── Toast ────────────────────────────────────────────────────────────────── */
#toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  z-index: 3000;
}
.toast {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  border-radius: var(--radius);
  background: var(--text-1);
  color: #fff;
  font-size: 14px;
  box-shadow: var(--shadow-lg);
  opacity: 0;
  transform: translateX(20px);
  transition: all 300ms ease;
  max-width: 320px;
}
.toast-visible { opacity: 1; transform: none; }
.toast-icon { font-size: 16px; font-weight: 700; }
.toast-success .toast-icon { color: #69f0ae; }
.toast-error { background: var(--danger); }
.toast-info .toast-icon { color: var(--accent); }

/* ── Empty States ─────────────────────────────────────────────────────────── */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 50vh;
  text-align: center;
  gap: 12px;
}
.empty-icon { font-size: 56px; }
.empty-state h3 {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 600;
  color: var(--text-1);
}
.empty-state p { font-size: 15px; color: var(--text-3); max-width: 300px; line-height: 1.6; }
.empty-state .btn-primary { margin-top: 8px; }

.empty-msg { color: var(--text-3); font-size: 14px; padding: 16px 0; }

/* ── Scrollbar ────────────────────────────────────────────────────────────── */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-3); }

/* ── Responsive ───────────────────────────────────────────────────────────── */
@media (max-width: 768px) {
  :root { --sidebar-w: 56px; }
  #app { grid-template-columns: var(--sidebar-w) 1fr; }
  .logo-text, .nav-item span:last-child, .sidebar-plans { display: none; }
  .sidebar-logo-img { width: 32px; padding: 4px; border-radius: 6px; }
  .sidebar-logo { padding: 14px 10px; }
  .nav-item { justify-content: center; padding: 12px; }
  #main-content { padding: 24px 20px; }
  .meal-slots { flex-direction: column; }
  .meal-slot { border-right: none; border-bottom: 1px solid var(--border); }
  .meal-slot:last-child { border-bottom: none; }
  .planner-header { flex-direction: column; }
  .form-row { grid-template-columns: 1fr; }
}

/* ── Push Badge ───────────────────────────────────────────────────────────── */
.push-status-row { margin: 8px 0; }
.push-badge {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 5px 12px; border-radius: 20px; font-size: 13px; font-weight: 500;
}
.push-on     { background: #e8f5e9; color: #2e7d32; border: 1px solid #c8e6c9; }
.push-off    { background: var(--surface-2); color: var(--text-2); border: 1px solid var(--border); }
.push-denied { background: #fdeaea; color: #c62828; border: 1px solid #f5b3b3; }

/* ── Login Page ───────────────────────────────────────────────────────────── */
.login-bg {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg, #FAF7F2);
  padding: 20px;
}
.login-card {
  background: white;
  border-radius: 20px;
  padding: 48px 40px;
  width: 100%;
  max-width: 400px;
  box-shadow: 0 8px 40px rgba(0,0,0,0.12);
}
.login-logo {
  display: flex;
  align-items: center;
  gap: 12px;
  justify-content: center;
  margin-bottom: 8px;
}
.login-logo-img { width: 200px; height: auto; object-fit: contain; }
.login-logo-icon { font-size: 40px; }
.login-logo-text { font-size: 32px; font-weight: 700; color: var(--primary, #2D4A3E); font-family: 'Playfair Display', serif; }
.login-subtitle  { text-align: center; color: #888; margin-bottom: 32px; font-size: 14px; }
.login-btn       { width: 100%; margin-top: 8px; padding: 14px; font-size: 16px; }
.login-error     { background: #fdeaea; color: #c62828; border-radius: 8px; padding: 10px 14px; font-size: 14px; margin-bottom: 12px; }

/* ── Sidebar footer ───────────────────────────────────────────────────────── */
.sidebar-footer {
  margin-top: auto;
  padding: 16px;
  border-top: 1px solid rgba(255,255,255,0.1);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.sidebar-user { font-size: 12px; color: rgba(255,255,255,0.7); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.logout-btn {
  background: rgba(255,255,255,0.1);
  border: 1px solid rgba(255,255,255,0.2);
  color: rgba(255,255,255,0.8);
  border-radius: 6px;
  padding: 4px 10px;
  font-size: 12px;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.2s;
}
.logout-btn:hover { background: rgba(255,255,255,0.2); }

/* ── User Management ──────────────────────────────────────────────────────── */
.user-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  background: var(--surface-2, #f5f5f5);
  border-radius: 10px;
  margin-bottom: 8px;
  gap: 12px;
}
.user-info { display: flex; flex-direction: column; gap: 3px; }
.user-name  { font-weight: 600; font-size: 14px; }
.user-display { font-size: 12px; color: #888; }
.user-badges { display: flex; gap: 6px; margin-top: 2px; }
.badge {
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 20px;
  font-weight: 500;
}
.badge-admin    { background: #e8f0fe; color: #1a56db; }
.badge-inactive { background: #fdeaea; color: #c62828; }
.badge-you      { background: #e8f5e9; color: #2e7d32; }
.user-actions { display: flex; gap: 8px; flex-shrink: 0; }
.danger-btn { background: #fdeaea !important; color: #c62828 !important; border-color: #f5b3b3 !important; }

/* ── Google Login ─────────────────────────────────────────────────────────── */
.google-btn-wrap {
  display: flex;
  justify-content: center;
  margin-bottom: 16px;
}
.login-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 4px 0 20px;
  color: var(--text-3);
  font-size: 13px;
}
.login-divider::before,
.login-divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--border);
}



/* ── Responsive (Mobile Bottom Nav) ───────────────────────────────────────── */
@media (max-width: 768px) {
  /* Layout'u grid'den block yapıya geçiriyoruz */
  #app { 
    display: block; 
  }
  
  /* Ana içerik alanına alt menü yüksekliği kadar boşluk veriyoruz ki yazılar altında kalmasın */
  #main-content { 
    padding: 24px 16px 85px 16px; 
    min-height: 100vh;
  }

  /* Sidebar'ı ekranın altına sabitliyoruz (Twitter Bottom Nav) */
  #sidebar { 
    position: fixed;
    bottom: 0;
    top: auto; /* BU SATIR EKSİKTİ - Üstten yapışmayı iptal eder */
    left: 0;
    width: 100%;
    height: 65px;
    flex-direction: row;
    justify-content: center;
    padding: 0;
    z-index: 1000;
    background: var(--secondary);
    box-shadow: 0 -4px 12px rgba(0,0,0,0.15);
    border-top: 1px solid rgba(255,255,255,0.05);
    border-right: none;
  }

  /* Alt barda gereksiz olan logo, plan listesi ve footer'ı gizliyoruz */
  .sidebar-logo, .sidebar-plans, .sidebar-footer { 
    display: none !important; 
  }

  /* Menü linklerini yatayda eşit dağıtıyoruz */
  .sidebar-nav {
    flex-direction: row;
    justify-content: space-around;
    align-items: center;
    width: 100%;
    padding: 0;
    gap: 0;
  }

  /* Her bir menü butonunu dikey hizalayıp ikon ve yazı şeklinde ayarlıyoruz */
  .nav-item { 
    flex: 1;
    flex-direction: column; 
    justify-content: center; 
    align-items: center;
    gap: 4px;
    padding: 10px 0; 
    border-radius: 0;
    background: transparent !important;
  }
  
  /* Seçili menünün sadece ikon rengini parlatıyoruz, arka planı değil */
  .nav-item.active { color: var(--accent); }
  
  /* İkonların altındaki yazıyı mobilde minik gösteriyoruz */
  .nav-item span:last-child { 
    display: block !important; 
    font-size: 10px;
    font-weight: 500;
    letter-spacing: 0.03em;
  }

  /* Varsa bildirim rozetlerini ikonun sağ üstüne alıyoruz */
  .nav-badge {
    position: absolute;
    top: 4px;
    right: calc(50% - 20px);
    margin: 0;
    padding: 2px 5px;
    font-size: 9px;
    min-width: 16px;
    border: 2px solid var(--secondary);
  }

  /* -- İçerik Düzeltmeleri -- */
  .meal-slots { flex-direction: column; }
  .meal-slot { border-right: none; border-bottom: 1px solid var(--border); }
  .meal-slot:last-child { border-bottom: none; }
  
  .planner-header { 
    flex-direction: column; 
    align-items: flex-start; 
    gap: 12px;
  }
  .form-row { grid-template-columns: 1fr; }
  
  /* Hata/Bilgi bildirimlerini (Toast) alt bardan kurtarıp biraz yukarı alıyoruz */
  #toast-container {
    bottom: 80px;
    right: 16px;
    left: 16px;
    align-items: stretch;
  }
  .toast { max-width: 100%; justify-content: center; }
}


/* ── Today Dashboard ──────────────────────────────────────────────────────── */
.today-page { max-width: 900px; margin: 0 auto; }
.today-header { margin-bottom: 32px; }
.today-header h2 { font-family: var(--font-display); font-size: 32px; font-weight: 700; color: var(--text-1); line-height: 1.2; }
.today-date { font-size: 16px; color: var(--text-3); margin-top: 4px; text-transform: capitalize; }

.section-title { font-size: 18px; font-weight: 600; color: var(--text-1); margin-bottom: 16px; font-family: var(--font-display); border-bottom: 1px solid var(--border); padding-bottom: 8px;}

.prep-alerts-section { margin-bottom: 40px; }
.prep-alerts-grid { display: flex; flex-direction: column; gap: 12px; }
.prep-alert-card {
  display: flex; gap: 16px; align-items: flex-start;
  background: #fff8e1; border: 1.5px solid #ffe082;
  border-radius: var(--radius); padding: 16px;
  box-shadow: var(--shadow-sm);
}
.prep-alert-icon { font-size: 24px; line-height: 1; margin-top: 2px; }
.prep-alert-content { flex: 1; }
.prep-alert-title { font-weight: 600; color: #e65100; font-size: 15px; margin-bottom: 4px; }
.prep-alert-type { font-weight: 400; opacity: 0.8; font-size: 13px; }
.prep-alert-desc { font-size: 14px; color: #b26a00; line-height: 1.5; }

.today-meals-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 20px;
}
.today-meal-card {
  background: var(--surface); border: 1.5px solid var(--border);
  border-radius: var(--radius); padding: 20px;
  display: flex; flex-direction: column; gap: 16px;
  transition: transform var(--transition), box-shadow var(--transition);
}
.today-meal-card:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.today-meal-card.confirmed { border-color: #4CAF50; background: #f9fef9; }
.today-meal-card.empty { border-style: dashed; background: var(--surface-2); justify-content: center; align-items: center; text-align: center; opacity: 0.8; }

.today-meal-header { display: flex; justify-content: space-between; align-items: center; }
.today-meal-type { font-size: 12px; font-weight: 600; color: var(--text-3); text-transform: uppercase; letter-spacing: 0.05em; }
.today-meal-name { font-family: var(--font-display); font-size: 20px; font-weight: 600; color: var(--text-1); line-height: 1.3; margin-bottom: 12px; }
.today-meal-meta { display: flex; flex-wrap: wrap; gap: 8px; }
.today-meal-empty-text { font-size: 14px; color: var(--text-3); margin-top: 8px; }

.today-meal-footer { margin-top: auto; border-top: 1px solid var(--border); padding-top: 16px; }
.today-meal-footer .btn { width: 100%; justify-content: center; }


/* Masaüstünde gizle, sadece mobilde bottom-nav içinde göster */
.mobile-logout { display: none !important; }

@media (max-width: 768px) {
  .mobile-logout { display: flex !important; }
}


/* Shopping Filters & Views */
.shopping-filters { background: var(--bg-card); padding: 15px; border-radius: 8px; margin-bottom: 20px; border: 1px solid var(--border-color); }
.filter-section h4 { margin: 0 0 10px 0; font-size: 14px; color: var(--text-muted); }
.chip-group { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { padding: 6px 12px; border-radius: 20px; border: 1px solid var(--primary-color); background: transparent; color: var(--text-color); cursor: pointer; font-size: 13px; transition: all 0.2s;}
.chip.selected { background: var(--primary-color); color: white; }
.view-tabs { display: flex; gap: 10px; margin-bottom: 15px; border-bottom: 2px solid var(--border-color); }
.tab-btn { background: none; border: none; padding: 10px 15px; cursor: pointer; color: var(--text-muted); font-weight: 500; border-bottom: 2px solid transparent; margin-bottom: -2px; }
.tab-btn.active { color: var(--primary-color); border-bottom-color: var(--primary-color); }
.action-bar { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 15px; align-items: center; justify-content: space-between; }
.action-group { display: flex; gap: 8px; flex-wrap: wrap; }


/* ── Tabs Component ─────────────────────────────────────────────────────────── */
.tabs-container {
  margin-bottom: 16px;
}

.tabs-header {
  display: flex;
  gap: 4px;
  border-bottom: 2px solid var(--border);
  padding-bottom: 0;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.tab-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 12px 16px;
  font-size: 14px;
  font-weight: 500;
  color: var(--text-2);
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  cursor: pointer;
  white-space: nowrap;
  transition: all var(--transition);
  border-radius: 8px 8px 0 0;
}

.tab-btn:hover {
  color: var(--text-1);
  background: var(--surface-2);
}

.tab-btn.active {
  color: var(--primary);
  border-bottom-color: var(--primary);
  background: rgba(196, 98, 45, 0.05);
}

.tab-btn span {
  display: inline-block;
}

.tabs-content {
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-top: none;
  border-radius: 0 0 var(--radius) var(--radius);
  min-height: 200px;
}

.tab-pane {
  display: none;
  padding: 20px;
  animation: fadeIn 0.2s ease;
}

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

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

/* Mobile tab styling */
@media (max-width: 768px) {
  .tabs-header {
    gap: 2px;
  }
  
  .tab-btn {
    padding: 10px 12px;
    font-size: 13px;
  }
  
  .tab-btn span {
    font-size: 13px;
  }
}

/* ── Market Tabs ──────────────────────────────────────────────────────────── */
.market-tabs-header {
  display: flex;
  margin-bottom: 24px;
  border-bottom: 2px solid var(--border);
  position: sticky;
  top: 0;
  background: var(--bg);
  z-index: 10;
  padding-top: 4px;
}
.market-tab-btn {
  flex: 1;
  padding: 12px 20px;
  font-size: 15px;
  font-weight: 600;
  color: var(--text-3);
  border-bottom: 3px solid transparent;
  margin-bottom: -2px;
  border-radius: 0;
  transition: color var(--transition), border-color var(--transition);
  background: none;
}
.market-tab-btn:hover  { color: var(--text-1); }
.market-tab-btn.active { color: var(--primary); border-bottom-color: var(--primary); }

/* ── Transferred item badge ───────────────────────────────────────────────── */
.item-transferred-badge {
  font-size: 10px;
  font-weight: 600;
  color: #16a34a;
  background: #f0fdf4;
  border: 1px solid #bbf7d0;
  border-radius: 4px;
  padding: 1px 6px;
  white-space: nowrap;
  flex-shrink: 0;
}

.cm-open-btn {
  background: #fff8f0;
  border: 1px solid #fed7aa;
  color: #c2410c;
  font-weight: 700;
}
.cm-open-btn:hover {
  background: #ffedd5;
  border-color: #fb923c;
}
/* ── Tarif Havuzu (Pool) ──────────────────────────────────────────────────── */
.pool-wrap {
  padding: 0 0 40px;
}

/* Arama */
.pool-search-bar {
  position: sticky;
  top: 0;
  z-index: 20;
  background: var(--bg);
  padding: 16px 0 12px;
  margin-bottom: 4px;
}
.pool-search-input-wrap {
  position: relative;
  display: flex;
  align-items: center;
}
.pool-search-icon {
  position: absolute;
  left: 14px;
  font-size: 16px;
  pointer-events: none;
  color: var(--text-3);
}
.pool-search-input {
  width: 100%;
  padding: 12px 44px 12px 42px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  font-size: 15px;
  font-family: inherit;
  background: var(--surface);
  color: var(--text-1);
  transition: border-color 0.2s;
  box-sizing: border-box;
}
.pool-search-input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(196,98,45,0.12);
}
.pool-search-clear {
  position: absolute;
  right: 12px;
  background: none;
  border: none;
  font-size: 15px;
  color: var(--text-3);
  cursor: pointer;
  padding: 4px;
  line-height: 1;
}
.pool-search-clear:hover { color: var(--danger); }
.pool-search-clear.hidden { display: none; }

/* Filtreler */
.pool-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 16px;
}
.pool-filter-group {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}
.pool-filter-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-3);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  white-space: nowrap;
}
.pool-chip {
  padding: 5px 12px;
  border: 1.5px solid var(--border);
  border-radius: 20px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-2);
  background: var(--surface);
  cursor: pointer;
  transition: all 0.15s;
  white-space: nowrap;
}
.pool-chip:hover { border-color: var(--primary); color: var(--primary); }
.pool-chip.active {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
}

/* Sonuç sayısı */
.pool-result-count {
  font-size: 13px;
  color: var(--text-3);
  margin-bottom: 12px;
  font-weight: 500;
}

/* Grid */
.pool-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 16px;
}

/* Kart */
.pool-card {
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  cursor: pointer;
  transition: box-shadow 0.2s, border-color 0.2s, transform 0.15s;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.pool-card:hover {
  box-shadow: var(--shadow);
  border-color: var(--primary);
  transform: translateY(-2px);
}
.pool-card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
}
.pool-card-name {
  font-size: 15px;
  font-weight: 600;
  color: var(--text-1);
  margin: 0;
  line-height: 1.3;
  flex: 1;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.pool-fav-btn {
  background: none;
  border: none;
  font-size: 18px;
  cursor: pointer;
  padding: 2px 4px;
  border-radius: 6px;
  transition: transform 0.15s;
  flex-shrink: 0;
  line-height: 1;
}
.pool-fav-btn:hover { transform: scale(1.2); }
.pool-fav-btn.active { filter: drop-shadow(0 0 4px rgba(220,50,50,0.4)); }

.pool-card-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.pool-meta-chip {
  font-size: 12px;
  padding: 3px 8px;
  background: var(--surface-2);
  border-radius: 10px;
  color: var(--text-2);
  white-space: nowrap;
}
.pool-card-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: auto;
}
.pool-ingredient-count {
  font-size: 12px;
  color: var(--text-3);
}
.pool-card-action {
  font-size: 12px;
  font-weight: 600;
  color: var(--primary);
}

/* Durum ekranları */
.pool-spinner,
.pool-empty,
.pool-error {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-3);
  font-size: 15px;
}
.pool-error { color: var(--danger); }

/* Sayfalama */
.pool-pagination { margin-top: 28px; }
.pool-pagination.hidden { display: none; }
.pool-pagination-inner {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  flex-wrap: wrap;
}
.pool-page-btn {
  padding: 7px 14px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 500;
  color: var(--text-2);
  background: var(--surface);
  cursor: pointer;
  transition: all 0.15s;
}
.pool-page-btn:hover { border-color: var(--primary); color: var(--primary); }
.pool-page-btn.active {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
}
.pool-page-info {
  font-size: 13px;
  color: var(--text-3);
  margin-left: 8px;
}

/* Mobil */
@media (max-width: 600px) {
  .pool-grid {
    grid-template-columns: 1fr;
  }
  .pool-filters {
    gap: 8px;
  }
}
/* ── FAZ 5: Plan Şablonları ─────────────────────────────────────────────── */

.tmpl-wrap {
  padding: 16px;
  max-width: 1100px;
  margin: 0 auto;
}

/* Sekme başlıkları */
.tmpl-tabs {
  display: flex;
  gap: 4px;
  margin-bottom: 20px;
  border-bottom: 2px solid var(--border, #e5e7eb);
  padding-bottom: 0;
}

.tmpl-tab {
  padding: 8px 18px;
  border: none;
  background: none;
  font-size: 14px;
  font-weight: 500;
  color: var(--text-secondary, #6b7280);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  border-radius: 6px 6px 0 0;
  transition: color 0.15s, border-color 0.15s;
}
.tmpl-tab:hover  { color: var(--primary, #4f46e5); }
.tmpl-tab.active {
  color: var(--primary, #4f46e5);
  border-bottom-color: var(--primary, #4f46e5);
  font-weight: 600;
}

/* Sekme içerik paneli */
.tmpl-pane        { min-height: 200px; }
.tmpl-pane.hidden { display: none; }

/* Arama barı (havuz için) */
.tmpl-pool-search-bar {
  margin-bottom: 16px;
}
.tmpl-search-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
  background: #fff;
  border: 1px solid var(--border, #e5e7eb);
  border-radius: 8px;
  padding: 6px 12px;
  max-width: 400px;
}
.tmpl-search-icon  { font-size: 14px; color: #9ca3af; }
.tmpl-search-input {
  flex: 1;
  border: none;
  outline: none;
  font-size: 14px;
  background: transparent;
}
.tmpl-search-clear {
  background: none;
  border: none;
  color: #9ca3af;
  cursor: pointer;
  font-size: 14px;
  padding: 0 2px;
}
.tmpl-search-clear.hidden { display: none; }
.tmpl-search-clear:hover  { color: var(--danger, #ef4444); }

/* Kart grid */
.tmpl-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 16px;
}

/* Tek kart */
.tmpl-card {
  background: #fff;
  border: 1px solid var(--border, #e5e7eb);
  border-radius: 10px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  transition: box-shadow 0.15s, border-color 0.15s;
}
.tmpl-card:hover {
  box-shadow: 0 4px 12px rgba(0,0,0,0.08);
  border-color: var(--primary-light, #a5b4fc);
}

.tmpl-card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
}
.tmpl-card-name {
  font-weight: 600;
  font-size: 15px;
  color: var(--text-primary, #0f172a);
  line-height: 1.3;
}
.tmpl-card-desc {
  font-size: 13px;
  color: var(--text-secondary, #6b7280);
  margin: 0;
  line-height: 1.4;
}
.tmpl-card-meta {
  display: flex;
  gap: 12px;
  font-size: 12px;
  color: var(--text-secondary, #6b7280);
}

/* Rozet */
.tmpl-badge {
  font-size: 11px;
  font-weight: 500;
  padding: 2px 8px;
  border-radius: 9999px;
  white-space: nowrap;
  flex-shrink: 0;
}
.tmpl-badge.public  { background: #dcfce7; color: #166534; }
.tmpl-badge.private { background: #f1f5f9; color: #475569; }
.tmpl-badge.fav     { background: #fce7f3; color: #9d174d; }

/* Kart aksiyonları */
.tmpl-card-actions {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-top: auto;
}
.tmpl-btn {
  padding: 6px 12px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 500;
  border: 1px solid transparent;
  cursor: pointer;
  transition: opacity 0.15s, background 0.15s;
}
.tmpl-btn:disabled  { opacity: 0.5; cursor: not-allowed; }
.tmpl-btn-primary   { background: var(--primary, #4f46e5); color: #fff; }
.tmpl-btn-primary:hover { opacity: 0.88; }
.tmpl-btn-secondary {
  background: #f1f5f9;
  color: var(--text-primary, #374151);
  border-color: var(--border, #e5e7eb);
}
.tmpl-btn-secondary:hover { background: #e2e8f0; }
.tmpl-btn-secondary.active { background: #fce7f3; color: #9d174d; border-color: #fbcfe8; }
.tmpl-btn-danger    { background: #fee2e2; color: #dc2626; border-color: #fca5a5; }
.tmpl-btn-danger:hover { background: #fecaca; }

/* Spinner */
.tmpl-spinner {
  padding: 40px;
  text-align: center;
  color: var(--text-secondary, #9ca3af);
  font-size: 14px;
}

/* Boş durum */
.tmpl-empty {
  padding: 48px 24px;
  text-align: center;
  color: var(--text-secondary, #6b7280);
}
.tmpl-empty-icon { font-size: 40px; margin-bottom: 12px; }
.tmpl-empty p    { margin: 4px 0; font-size: 15px; }
.tmpl-empty-hint { font-size: 13px; color: #9ca3af; line-height: 1.5; }

/* Sayfalama */
.tmpl-pagination {
  display: flex;
  gap: 6px;
  justify-content: center;
  margin-top: 20px;
  flex-wrap: wrap;
}
.tmpl-pagination.hidden { display: none; }
.tmpl-page-btn {
  padding: 6px 12px;
  border: 1px solid var(--border, #e5e7eb);
  border-radius: 6px;
  background: #fff;
  font-size: 13px;
  cursor: pointer;
  transition: background 0.15s;
}
.tmpl-page-btn:hover  { background: #f1f5f9; }
.tmpl-page-btn.active { background: var(--primary, #4f46e5); color: #fff; border-color: var(--primary, #4f46e5); }

/* Mobil */
@media (max-width: 600px) {
  .tmpl-grid { grid-template-columns: 1fr; }
  .tmpl-wrap { padding: 12px; }
}