:root {
  --ink: #14281f;
  --ink-soft: #3d5a4c;
  --muted: #6d8578;
  --leaf: #2a6b4a;
  --leaf-deep: #1a4330;
  --bloom: #b83a2e;
  --cream: #f3f7f4;
  --fog: #e7efea;
  --line: rgba(20, 40, 31, 0.1);
  --white: #fff;
  --shadow: 0 14px 40px rgba(20, 40, 31, 0.08);
  --radius: 18px;
  --font: "DM Sans", system-ui, sans-serif;
  --display: "Fraunces", Georgia, serif;
  --sidebar: 240px;
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body {
  font-family: var(--font);
  color: var(--ink);
  background:
    radial-gradient(90% 60% at 100% 0%, rgba(42, 107, 74, 0.12), transparent 55%),
    linear-gradient(165deg, #f8fbf9 0%, #eef4f0 50%, #f6f9f7 100%);
}

a { color: var(--leaf); text-decoration: none; }
a:hover { text-decoration: underline; }
code { font-size: 0.92em; background: var(--fog); padding: 0.1rem 0.35rem; border-radius: 6px; }

.shell {
  display: grid;
  grid-template-columns: var(--sidebar) 1fr;
  min-height: 100vh;
}

.sidebar {
  background: var(--leaf-deep);
  color: #e8f2ec;
  padding: 1.25rem 1rem;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.brand-block { display: flex; gap: 0.75rem; align-items: center; padding: 0.25rem 0.35rem; }
.brand-mark {
  width: 42px; height: 42px; border-radius: 12px;
  background: linear-gradient(145deg, #3d8f62, #1f5a3c);
  display: grid; place-items: center;
  font-family: var(--display); font-weight: 700; font-size: 1.25rem;
  color: #fff;
}
.brand-mark.lg { width: 56px; height: 56px; font-size: 1.5rem; margin: 0 auto 0.5rem; }
.brand-name { font-family: var(--display); font-weight: 700; font-size: 1.15rem; }
.brand-sub { font-size: 0.8rem; opacity: 0.7; }

.side-nav { display: flex; flex-direction: column; gap: 0.35rem; flex: 1; }
.side-nav a {
  color: #cfe4d7;
  padding: 0.7rem 0.85rem;
  border-radius: 12px;
  text-decoration: none;
  font-weight: 500;
}
.side-nav a:hover, .side-nav a.active {
  background: rgba(255,255,255,0.1);
  color: #fff;
  text-decoration: none;
}

.side-foot {
  border-top: 1px solid rgba(255,255,255,0.12);
  padding-top: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}
.who { font-size: 0.9rem; opacity: 0.85; }

.main { padding: 1.5rem 1.75rem 2.5rem; max-width: 1180px; }
.page-head { margin-bottom: 1.25rem; }
.page-head h1 {
  margin: 0;
  font-family: var(--display);
  font-size: 1.85rem;
  font-weight: 700;
}
.lead { margin: 0.35rem 0 0; color: var(--muted); }

.stat-row {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
  margin-bottom: 1.25rem;
}
.stat {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1.1rem 1.2rem;
}
.stat.accent { background: linear-gradient(160deg, #f7fbf8, #e8f3ec); }
.stat-label { display: block; font-size: 0.8rem; color: var(--muted); text-transform: uppercase; letter-spacing: 0.04em; }
.stat-value { display: block; font-size: 2rem; font-weight: 700; margin: 0.35rem 0; font-family: var(--display); }
.stat-value.sm { font-size: 1.15rem; font-family: var(--font); }
.stat-hint { color: var(--muted); font-size: 0.9rem; }

.panel {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1.15rem 1.25rem 1.35rem;
  margin-bottom: 1rem;
}
.panel-head {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  align-items: flex-start;
  margin-bottom: 1rem;
}
.panel-head h2 { margin: 0; font-size: 1.2rem; }
.section-title {
  margin: 1.5rem 0 0.75rem;
  font-size: 1rem;
  color: var(--ink-soft);
}

.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 0.95rem; }
th, td { text-align: left; padding: 0.65rem 0.45rem; border-bottom: 1px solid var(--line); vertical-align: top; }
th { color: var(--muted); font-weight: 600; font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.03em; }

.badge {
  display: inline-block;
  padding: 0.15rem 0.55rem;
  border-radius: 999px;
  font-size: 0.78rem;
  background: var(--fog);
}
.badge.aktif { background: #d7f0e1; color: #1a4330; }
.badge.tamamlandi { background: #e4ebf7; color: #243b6b; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink);
  border-radius: 12px;
  padding: 0.55rem 0.95rem;
  cursor: pointer;
  text-decoration: none;
  font: inherit;
  font-weight: 600;
}
.btn:hover { text-decoration: none; filter: brightness(0.98); }
.btn.primary { background: var(--leaf); color: #fff; border-color: var(--leaf); }
.btn.danger { background: var(--bloom); color: #fff; border-color: var(--bloom); }
.btn.ghost { background: transparent; color: inherit; border-color: rgba(255,255,255,0.28); }
.sidebar .btn.ghost { color: #e8f2ec; }
.btn.small { padding: 0.35rem 0.65rem; font-size: 0.85rem; }
.btn.block { width: 100%; }

.inline-form { display: flex; gap: 0.5rem; flex-wrap: wrap; align-items: center; }
.link-danger {
  border: 0;
  background: transparent;
  color: var(--bloom);
  font: inherit;
  cursor: pointer;
  padding: 0;
  text-decoration: underline;
}
.actions form.inline-form { display: inline; }
.qty-edit input[type="number"] {
  width: 5.5rem;
  padding: 0.35rem 0.45rem;
}
.badge.duzeltme { background: #e8f0fe; color: #1a3a6b; }
.badge.silme { background: #fde8e6; color: #7a1f16; }
.form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 0.75rem;
  align-items: end;
}
label { display: flex; flex-direction: column; gap: 0.35rem; font-size: 0.9rem; color: var(--ink-soft); }
input, select {
  padding: 0.6rem 0.7rem;
  border: 1px solid var(--line);
  border-radius: 12px;
  font: inherit;
  background: #fff;
}
.actions { display: flex; gap: 0.5rem; flex-wrap: wrap; align-items: center; }
.muted { color: var(--muted); }
.mt { margin-top: 0.75rem; }
.alert { padding: 0.8rem 1rem; border-radius: 12px; margin-bottom: 1rem; }
.alert.ok { background: #e4f6eb; color: #1a4330; }
.alert.error { background: #fde8e6; color: #7a1f16; }

.login-page {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 1.5rem;
}
.login-card {
  width: min(100%, 380px);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 22px;
  box-shadow: var(--shadow);
  padding: 1.6rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}
.login-card h1 {
  margin: 0;
  text-align: center;
  font-family: var(--display);
}
.login-card > p { margin: 0; text-align: center; color: var(--muted); }

@media (max-width: 900px) {
  .shell { grid-template-columns: 1fr; }
  .sidebar { flex-direction: row; flex-wrap: wrap; align-items: center; }
  .side-nav { flex-direction: row; flex-wrap: wrap; }
  .side-foot { flex-direction: row; align-items: center; border: 0; padding: 0; margin-left: auto; }
  .stat-row { grid-template-columns: 1fr; }
}
