:root {
  --bg: #F6F7F4;
  --ink: #22303C;
  --muted: #5A6B63;
  --faint: #9AA79F;
  --line: #E5E8E2;
  --line2: #F0F2EE;
  --accent: #2F6D63;
  --accent-soft: #EDF1EC;
  --pos: #2F7D4F;
  --neg: #B5443C;
  --warn: #C98A2D;
}
* { box-sizing: border-box; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
  font-size: 15px;
}
.wrap { max-width: 760px; margin: 0 auto; padding: 24px 16px 60px; }
h1, h3 { font-family: Georgia, "Times New Roman", serif; margin: 0; }
h1 { font-size: 26px; }
h3 { font-size: 16px; }
.muted { color: var(--muted); }
.faint { color: var(--faint); }
.center { text-align: center; }
.small { font-size: 12px; }
.num { font-variant-numeric: tabular-nums; font-weight: 700; }

.card {
  background: #fff; border: 1px solid var(--line);
  border-radius: 16px; padding: 16px; margin-bottom: 16px;
}
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 12px; flex-wrap: wrap; }

.row { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 8px 0; border-bottom: 1px solid var(--line2); font-size: 14px; }
.row:last-of-type { border-bottom: none; }

.form-row { display: flex; gap: 8px; align-items: flex-end; flex-wrap: wrap; margin-top: 12px; }
.field { flex: 1; min-width: 110px; }
.field span { display: block; font-size: 12px; font-weight: 500; color: var(--muted); margin-bottom: 3px; }
input, select {
  width: 100%; padding: 10px 12px; font-size: 16px;
  border: 1px solid #DFE3DC; border-radius: 10px; background: #fff; color: var(--ink);
  outline: none;
  -webkit-appearance: none;
  appearance: none;
}
input:focus, select:focus { border-color: var(--accent); box-shadow: 0 0 0 2px rgba(47,109,99,.15); }

.btn {
  padding: 9px 16px; border: none; border-radius: 10px; cursor: pointer;
  font-size: 14px; font-weight: 600; background: var(--accent); color: #fff;
}
.btn:hover { filter: brightness(1.08); }
.btn-soft { background: var(--accent-soft); color: var(--accent); font-size: 12px; padding: 6px 12px; }
.btn-ghost { background: #fff; border: 1px solid var(--line); color: var(--muted); font-size: 12px; padding: 6px 12px; }
.btn-del { background: none; color: var(--neg); font-size: 13px; padding: 4px 8px; }
.btn:disabled { opacity: .5; cursor: not-allowed; }

.tabs { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 20px; }
.tab {
  padding: 7px 14px; border-radius: 999px; font-size: 13px; font-weight: 500;
  background: #fff; border: 1px solid var(--line); color: var(--muted); cursor: pointer;
}
.tab.active { background: var(--accent); border-color: var(--accent); color: #fff; }

.pulse { background: var(--ink); color: #fff; border-radius: 16px; padding: 16px; margin-bottom: 20px; }
.pulse .top { display: flex; justify-content: space-between; font-size: 12px; opacity: .8; margin-bottom: 8px; }
.bar { height: 12px; border-radius: 999px; background: #3A4756; overflow: hidden; }
.bar > div { height: 100%; border-radius: 999px; transition: width .4s; }
.bar-sm { height: 8px; background: var(--accent-soft); margin-top: 5px; }

.grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 16px; }
.stat { background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 12px; }
.stat .label { font-size: 12px; color: var(--muted); }
.stat .val { font-size: 18px; font-weight: 700; font-variant-numeric: tabular-nums; }

.badge { font-size: 11px; font-weight: 600; padding: 2px 8px; border-radius: 999px; margin-right: 6px; }
.badge.alacak { background: #E6F2EA; color: var(--pos); }
.badge.verecek { background: #F8E9E7; color: var(--neg); }

pre.report {
  background: var(--bg); border-radius: 12px; padding: 12px;
  font-family: ui-monospace, "Cascadia Mono", Consolas, monospace;
  font-size: 12px; white-space: pre-wrap; margin: 0;
}

.chatbox { background: var(--bg); border-radius: 12px; padding: 12px; height: 320px; overflow-y: auto; margin-bottom: 10px; }
.msg { display: flex; margin-bottom: 8px; }
.msg.me { justify-content: flex-end; }
.msg > div {
  max-width: 75%; padding: 8px 12px; border-radius: 12px; font-size: 14px; white-space: pre-wrap;
  background: #fff; border: 1px solid var(--line);
}
.msg.me > div { background: var(--accent); color: #fff; border: none; }

.login-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 16px; }
.login-card { width: 100%; max-width: 360px; background: #fff; border: 1px solid var(--line); border-radius: 16px; padding: 24px; }
.err { color: var(--neg); font-size: 13px; margin-top: 8px; }
.ok-msg { color: var(--pos); font-size: 13px; margin-top: 8px; }

.strike { text-decoration: line-through; color: var(--faint); }
.header-bar { display: flex; align-items: flex-end; justify-content: space-between; margin-bottom: 4px; }
.sub-bar { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; }

@media (max-width: 520px) {
  .grid { grid-template-columns: 1fr; }
  .form-row .field { min-width: 45%; }
  .btn { padding: 11px 18px; }
  input[type="checkbox"] { width: 20px !important; height: 20px; }
  .tab { padding: 9px 15px; }
}
