/* ===== RESET & BASE ===== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --cream: #faf7f2;
  --cream2: #f3ede3;
  --cream3: #ede4d6;
  --white: #ffffff;
  --brown-light: #e8ddd0;
  --brown: #c4a882;
  --brown-dark: #8b7355;
  --orange: #d4742a;
  --orange-light: #f0a05a;
  --orange-pale: #fdf0e4;
  --green: #4a7c59;
  --green-light: #e8f5ed;
  --green-pale: #f0f8f2;
  --red: #c0392b;
  --red-pale: #fdf0ee;
  --text-dark: #2c2416;
  --text-mid: #5c4f3d;
  --text-light: #9c8e7e;
  --text-faint: #bdb0a0;
  --sidebar-w: 240px;
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 18px;
  --shadow-sm: 0 1px 4px rgba(44,36,22,0.07);
  --shadow-md: 0 4px 16px rgba(44,36,22,0.10);
  --shadow-lg: 0 8px 32px rgba(44,36,22,0.13);
  --font-serif: 'Lora', Georgia, serif;
  --font-sans: 'Inter', system-ui, sans-serif;
  --transition: 0.2s ease;
}

html, body { height: 100%; background: var(--cream); color: var(--text-dark); font-family: var(--font-sans); font-size: 15px; line-height: 1.65; -webkit-font-smoothing: antialiased; }
a { cursor: pointer; text-decoration: none; color: inherit; }
button { cursor: pointer; font-family: var(--font-sans); }
input, textarea, select { font-family: var(--font-sans); }
body { display: flex; min-height: 100vh; }

/* ===== SIDEBAR ===== */
.sidebar { width: var(--sidebar-w); min-height: 100vh; background: var(--white); border-right: 1px solid var(--brown-light); display: flex; flex-direction: column; position: fixed; top: 0; left: 0; z-index: 100; }
.sidebar-brand { display: flex; align-items: center; gap: 12px; padding: 1.5rem 1.25rem 1.25rem; border-bottom: 1px solid var(--cream3); }
.brand-icon { width: 36px; height: 36px; background: var(--orange); border-radius: 10px; flex-shrink: 0; position: relative; }
.brand-icon::after { content: ''; position: absolute; inset: 6px; border: 2px solid rgba(255,255,255,0.6); border-radius: 4px; }
.brand-title { font-family: var(--font-serif); font-size: 17px; font-weight: 600; color: var(--text-dark); line-height: 1.2; }
.brand-sub { font-size: 11px; color: var(--text-light); letter-spacing: 0.04em; }
.sidebar-nav { flex: 1; padding: 1rem 0.75rem; display: flex; flex-direction: column; gap: 2px; }
.nav-item { display: flex; align-items: center; gap: 10px; padding: 9px 12px; border-radius: var(--radius-sm); color: var(--text-mid); font-size: 13.5px; font-weight: 400; transition: all var(--transition); border: 1px solid transparent; }
.nav-item:hover { background: var(--cream); color: var(--text-dark); }
.nav-item.active { background: var(--orange-pale); color: var(--orange); font-weight: 500; border-color: rgba(212,116,42,0.15); }
.nav-icon { width: 16px; height: 16px; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex-shrink: 0; }
.sidebar-footer { padding: 1rem 1.25rem 1.5rem; border-top: 1px solid var(--cream3); }
.sidebar-quote { font-family: var(--font-serif); font-size: 12px; font-style: italic; color: var(--text-faint); line-height: 1.6; }

/* ===== MAIN ===== */
.main { margin-left: var(--sidebar-w); flex: 1; min-height: 100vh; background: var(--cream); }

/* ===== PAGES ===== */
.page { display: none; padding: 2.5rem 2.5rem 4rem; max-width: 960px; animation: pageIn 0.25s ease; }
.page.active { display: block; }
@keyframes pageIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }

/* PAGE HEADER */
.page-header { margin-bottom: 2rem; }
.page-tag { display: inline-block; font-size: 11px; font-weight: 500; letter-spacing: 0.08em; text-transform: uppercase; color: var(--orange); background: var(--orange-pale); padding: 3px 10px; border-radius: 20px; margin-bottom: 10px; }
.page-date { font-size: 12px; color: var(--text-faint); margin-bottom: 6px; letter-spacing: 0.03em; }
.page-title { font-family: var(--font-serif); font-size: 32px; font-weight: 600; color: var(--text-dark); line-height: 1.25; margin-bottom: 8px; }
.page-desc { font-size: 15px; color: var(--text-mid); max-width: 560px; line-height: 1.7; }

/* ===== CARDS ===== */
.card { background: var(--white); border: 1px solid var(--brown-light); border-radius: var(--radius-lg); padding: 1.5rem; box-shadow: var(--shadow-sm); }
.card-label { font-size: 11px; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; color: var(--text-light); margin-bottom: 1rem; }
.card-desc { font-size: 13px; color: var(--text-mid); margin-bottom: 1rem; line-height: 1.6; }
.highlight-card { background: var(--orange-pale); border-color: rgba(212,116,42,0.2); }

/* ===== STATS ===== */
.stats-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1rem; margin-bottom: 1.75rem; }
.stat-card { background: var(--white); border: 1px solid var(--brown-light); border-radius: var(--radius-md); padding: 1.25rem 1rem; box-shadow: var(--shadow-sm); text-align: center; }
.stat-num { font-family: var(--font-serif); font-size: 28px; font-weight: 600; color: var(--text-dark); line-height: 1; margin-bottom: 6px; }
.stat-label { font-size: 11px; color: var(--text-light); letter-spacing: 0.04em; }

/* ===== TWO COL ===== */
.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 1.25rem; align-items: start; }

/* ===== HABIT CHECK ===== */
.habit-check-row { display: flex; align-items: center; justify-content: space-between; padding: 10px 0; border-bottom: 1px solid var(--cream3); }
.habit-check-row:last-child { border-bottom: none; }
.habit-check-info { display: flex; align-items: center; gap: 10px; }
.habit-color-dot { width: 9px; height: 9px; border-radius: 50%; flex-shrink: 0; }
.habit-check-name { font-size: 14px; color: var(--text-dark); }
.habit-check-name.done { text-decoration: line-through; color: var(--text-faint); }
.habit-streak-tag { font-size: 11px; color: var(--text-faint); margin-left: 4px; }
.check-btn { width: 26px; height: 26px; border-radius: 7px; border: 1.5px solid var(--brown-light); background: none; color: transparent; font-size: 13px; display: flex; align-items: center; justify-content: center; transition: all var(--transition); flex-shrink: 0; }
.check-btn:hover { border-color: var(--green); }
.check-btn.done { background: var(--green); border-color: var(--green); color: white; }
.empty-msg { font-size: 13px; color: var(--text-light); padding: 0.5rem 0; }
.link { color: var(--orange); font-weight: 500; }
.link:hover { text-decoration: underline; }

/* ===== CALC ===== */
.slider-row { display: flex; align-items: center; gap: 10px; margin-bottom: 0.75rem; }
.slider-row label { font-size: 13px; color: var(--text-mid); min-width: 100px; }
.slider-row input[type=range] { flex: 1; accent-color: var(--orange); height: 4px; }
.slider-row span { font-size: 13px; font-weight: 500; color: var(--orange); min-width: 44px; text-align: right; }
.compound-result { background: var(--cream); border: 1px solid var(--cream3); border-radius: var(--radius-sm); padding: 1rem; display: flex; justify-content: space-around; align-items: center; margin-top: 0.5rem; flex-wrap: wrap; gap: 8px; }
.cr-item { text-align: center; }
.cr-label { font-size: 11px; color: var(--text-faint); text-transform: uppercase; letter-spacing: 0.05em; margin-bottom: 4px; }
.cr-value { font-family: var(--font-serif); font-size: 22px; font-weight: 600; }
.cr-value.good { color: var(--green); }
.cr-value.bad { color: var(--red); }
.cr-value.neutral { color: var(--orange); }
.cr-arrow { font-size: 18px; color: var(--text-faint); }
.cr-note { width: 100%; font-size: 12px; color: var(--text-light); text-align: center; line-height: 1.6; margin-top: 4px; padding-top: 8px; border-top: 1px solid var(--cream3); }

/* ===== QUOTE ===== */
.daily-quote { font-family: var(--font-serif); font-size: 15px; font-style: italic; color: var(--text-dark); line-height: 1.75; border: none; padding: 0; }
.daily-quote::before { content: '\201C'; color: var(--orange); font-size: 24px; line-height: 0; vertical-align: -6px; margin-right: 2px; }
.daily-quote::after  { content: '\201D'; color: var(--orange); font-size: 24px; line-height: 0; vertical-align: -6px; margin-left: 2px; }

/* ===== LAW LIST ===== */
.law-list { display: flex; flex-direction: column; gap: 2px; }
.law-item { display: flex; align-items: flex-start; gap: 12px; padding: 10px; border-radius: var(--radius-sm); cursor: pointer; transition: background var(--transition); }
.law-item:hover { background: var(--cream); }
.law-num { width: 26px; height: 26px; border-radius: 8px; background: var(--orange-pale); color: var(--orange); font-size: 13px; font-weight: 600; display: flex; align-items: center; justify-content: center; flex-shrink: 0; margin-top: 1px; }
.law-item strong { font-size: 13.5px; font-weight: 500; color: var(--text-dark); display: block; margin-bottom: 1px; }
.law-item p { font-size: 12px; color: var(--text-light); margin: 0; }

/* ===== FORMS ===== */
.form-group { margin-bottom: 1.25rem; }
.form-label { display: block; font-size: 13px; font-weight: 500; color: var(--text-mid); margin-bottom: 6px; }
.form-hint { font-size: 12px; color: var(--text-faint); margin-bottom: 6px; line-height: 1.5; }
.form-input { width: 100%; padding: 10px 14px; border: 1.5px solid var(--brown-light); border-radius: var(--radius-sm); background: var(--white); color: var(--text-dark); font-size: 14px; transition: border-color var(--transition); outline: none; }
.form-input:focus { border-color: var(--orange); }
.form-input::placeholder { color: var(--text-faint); }
textarea.form-input { resize: vertical; min-height: 80px; line-height: 1.6; }
select.form-input { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%239c8e7e' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 14px center; padding-right: 36px; }

/* ===== 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: none; transition: all var(--transition); }
.btn-primary { background: var(--orange); color: white; }
.btn-primary:hover { background: #c0661f; }
.btn-secondary { background: var(--cream2); color: var(--text-mid); border: 1px solid var(--brown-light); }
.btn-secondary:hover { background: var(--cream3); }
.btn-ghost { background: none; color: var(--orange); padding: 8px 0; }
.btn-ghost:hover { text-decoration: underline; }
.btn-danger { background: var(--red-pale); color: var(--red); border: 1px solid rgba(192,57,43,0.2); }
.btn-danger:hover { background: #fce3e0; }

/* ===== DIVIDER ===== */
.section-divider { display: flex; align-items: center; gap: 12px; margin: 1.75rem 0 1.25rem; }
.section-divider-line { flex: 1; height: 1px; background: var(--cream3); }
.section-divider-label { font-size: 11px; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; color: var(--text-faint); }

/* ===== BADGES ===== */
.badge { display: inline-block; font-size: 11px; font-weight: 500; padding: 3px 10px; border-radius: 20px; letter-spacing: 0.03em; }
.badge-green  { background: var(--green-light); color: var(--green); }
.badge-orange { background: var(--orange-pale); color: var(--orange); }
.badge-red    { background: var(--red-pale); color: var(--red); }
.badge-brown  { background: var(--cream3); color: var(--brown-dark); }

/* ===== PROGRESS ===== */
.progress-wrap { background: var(--cream3); border-radius: 99px; height: 6px; overflow: hidden; margin-top: 8px; }
.progress-fill { height: 100%; border-radius: 99px; background: var(--orange); transition: width 0.4s ease; }
.progress-fill.green { background: var(--green); }

/* ===== TAKVİM ===== */
.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; }
.cal-cell { aspect-ratio: 1; border-radius: 4px; background: var(--cream2); border: 1px solid var(--cream3); transition: background var(--transition); cursor: default; }
.cal-cell.cal-done { background: var(--orange); border-color: var(--orange); }
.cal-cell:hover { border-color: var(--brown); }
.cal-week-labels { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; margin-bottom: 4px; }
.cal-week-label { text-align: center; font-size: 10px; color: var(--text-faint); letter-spacing: 0.04em; }

/* ===== KİRİCI ===== */
.kirici-card { background: var(--white); border: 1px solid rgba(192,57,43,0.15); border-left: 4px solid var(--red); border-radius: var(--radius-md); padding: 1.25rem; margin-bottom: 0.75rem; }
.kirici-card-title { font-size: 15px; font-weight: 500; color: var(--text-dark); margin-bottom: 8px; }
.kirici-steps { display: flex; flex-direction: column; gap: 6px; }
.kirici-step { display: flex; align-items: flex-start; gap: 8px; font-size: 13px; color: var(--text-mid); }
.kirici-step-num { width: 18px; height: 18px; border-radius: 5px; background: var(--red-pale); color: var(--red); font-size: 10px; font-weight: 600; display: flex; align-items: center; justify-content: center; flex-shrink: 0; margin-top: 1px; }

/* ===== TOAST ===== */
.toast { position: fixed; bottom: 2rem; left: 50%; transform: translateX(-50%) translateY(100px); background: var(--text-dark); color: var(--cream); padding: 12px 24px; border-radius: 99px; font-size: 14px; font-weight: 500; box-shadow: var(--shadow-lg); transition: transform 0.3s ease; z-index: 999; white-space: nowrap; }
.toast.show { transform: translateX(-50%) translateY(0); }

/* ===== MOBİL MENÜ ===== */
.mobile-menu-btn { display: none; position: fixed; bottom: 1.5rem; right: 1.5rem; width: 48px; height: 48px; border-radius: 50%; background: var(--orange); color: white; border: none; font-size: 20px; align-items: center; justify-content: center; box-shadow: var(--shadow-md); z-index: 200; cursor: pointer; }

/* ===== UTILITY ===== */
.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.text-small { font-size: 13px; color: var(--text-light); }
.full-width { width: 100%; }

/* ===== RESPONSIVE ===== */
@media (max-width: 860px) {
  :root { --sidebar-w: 200px; }
  .page { padding: 1.5rem 1.25rem 3rem; }
  .stats-row { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 640px) {
  .sidebar { transform: translateX(-100%); width: 220px; transition: transform 0.3s ease; }
  .sidebar.open { transform: translateX(0); box-shadow: var(--shadow-lg); }
  .main { margin-left: 0; }
  .two-col { grid-template-columns: 1fr; }
  .stats-row { grid-template-columns: repeat(2, 1fr); }
  .mobile-menu-btn { display: flex; }
  .page-title { font-size: 24px; }
}

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