:root {
  --navy: #071525;
  --navy-2: #0e243c;
  --steel: #1d4e6e;
  --ice: #d7e6f2;
  --paper: #eef3f7;
  --card: #ffffff;
  --ink: #0c1a28;
  --muted: #6b7c8d;
  --line: #c5d3df;
  --red: #b42318;
  --plus: #c9e4d4;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: "Segoe UI", Calibri, Arial, sans-serif;
  background: var(--paper);
  color: var(--ink);
}

.topbar {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 24px;
  align-items: center;
  padding: 18px 28px;
  background: var(--navy);
  border-bottom: 3px solid var(--steel);
}
.logo {
  height: 52px;
  width: auto;
  display: block;
}
.topbar h1 {
  margin: 0;
  font-size: 22px;
  font-weight: 800;
  color: #fff;
  letter-spacing: 0.12em;
  text-align: center;
  text-transform: uppercase;
}
button {
  border: 0;
  border-radius: 9px;
  padding: 10px 14px;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
  background: var(--steel);
  color: #fff;
}
button.primary { background: #2f7aa8; }
button.ghost { background: #1a334d; color: var(--ice); }
button:disabled { opacity: 0.55; cursor: wait; }

.status {
  margin: 16px 28px 0;
  text-align: center;
}
.status[hidden] { display: none !important; }
.status.err {
  color: var(--red);
  font-weight: 600;
}
.status.err .status-dots { display: none; }
.status.err .status-text {
  margin: 0;
  font-size: 14px;
}

.status.loading {
  position: fixed;
  inset: 0;
  z-index: 80;
  margin: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background:
    radial-gradient(720px 420px at 50% 46%, rgba(47, 122, 168, 0.35), transparent 70%),
    radial-gradient(1200px 700px at 50% 40%, #12324c 0%, #071525 72%);
}
.status.loading .status-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 22px;
  padding: 28px 36px;
}
.status.loading .status-text {
  margin: 0;
  font-size: 34px;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: none;
  background: linear-gradient(90deg, #8fd4ee, #ffffff, #f4d08a, #8fd4ee);
  background-size: 220% auto;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  animation: statusShine 2.6s linear infinite;
}
.status-dots {
  display: flex;
  gap: 12px;
}
.status-dots span {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  animation: statusBounce 1.05s ease-in-out infinite;
}
.status-dots span:nth-child(1) { background: #6ed4e8; animation-delay: 0s; }
.status-dots span:nth-child(2) { background: #ffffff; animation-delay: 0.14s; }
.status-dots span:nth-child(3) { background: #f4c56a; animation-delay: 0.28s; }

@keyframes statusBounce {
  0%, 80%, 100% { transform: translateY(0); opacity: 0.55; }
  40% { transform: translateY(-10px); opacity: 1; }
}
@keyframes statusShine {
  to { background-position: 220% center; }
}

.report {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 300px;
  gap: 18px;
  padding: 22px 28px 40px;
  align-items: start;
}
.report.hidden { display: none; }

.sheet {
  background: var(--card);
  border-radius: 14px;
  overflow: hidden;
  border: 1px solid var(--line);
  box-shadow: 0 8px 24px rgba(7, 21, 37, 0.06);
}
.month-banner {
  background: var(--navy-2);
  color: #fff;
  text-align: center;
  font-size: 20px;
  font-weight: 800;
  letter-spacing: 0.16em;
  padding: 12px;
}
.table-wrap { overflow-x: auto; }
table.nakit {
  width: 100%;
  border-collapse: collapse;
  background: #f8fbfd;
}
.nakit th, .nakit td {
  border: 1px solid var(--line);
  padding: 7px 8px;
  text-align: center;
  font-size: 13px;
}
.nakit th { background: var(--ice); color: var(--navy); }
.nakit td.num { font-variant-numeric: tabular-nums; white-space: nowrap; }
.nakit td.neg, .nakit .eksi { color: var(--red); }
.nakit tr.total td { font-weight: 800; background: #e7eef4; }
.nakit tr.total td.gun { color: var(--red); }
.nakit tr.today td { background: #eaf6ee; font-weight: 700; }
.nakit tr.today td.arti { background: #d8f0e0; }
.nakit tr.month-end td { background: #f4e2b8; font-weight: 700; }
.nakit tr.month-end td.arti.clickable:hover { background: #ead49a; }
.nakit tr.month-end td.eksi.clickable:hover { background: #f3d3b0; }
.nakit td.sign.plus { background: var(--plus); font-weight: 700; }
.nakit td.eksi.clickable,
.nakit td.arti.clickable {
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 3px;
}
.nakit td.eksi.clickable:hover { background: #fde8e8; }
.nakit td.arti.clickable:hover { background: #e5f4ea; }
.odeme td.arti { color: #176c3a; }

.modal {
  position: fixed;
  inset: 0;
  background: rgba(7, 21, 37, 0.55);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  z-index: 50;
}
.modal[hidden] { display: none; }
.modal-card {
  background: #fff;
  border-radius: 14px;
  max-width: 960px;
  width: 100%;
  max-height: 86vh;
  overflow: auto;
  box-shadow: 0 16px 48px rgba(7, 21, 37, 0.25);
}
.modal-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 14px 18px;
  background: var(--navy-2);
  color: #fff;
  position: sticky;
  top: 0;
}
.modal-head h2 { margin: 0; font-size: 16px; }
.modal-head .ghost { background: #1a334d; }
.modal-actions { display: flex; gap: 8px; flex-shrink: 0; }
.odeme td.clickable {
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 3px;
}
.odeme tr.clickable { cursor: pointer; }
.odeme tr.clickable:hover td { background: #eaf1f6; }

.alacak-btn {
  width: 100%;
  background: var(--red);
  padding: 12px 14px;
  line-height: 1.35;
}
table.odeme {
  width: 100%;
  border-collapse: collapse;
  background: #fff;
}
.odeme th, .odeme td {
  border: 1px solid var(--line);
  padding: 7px 8px;
  text-align: center;
  font-size: 13px;
}
.odeme th { background: var(--ice); color: var(--navy); }
.odeme td.left { text-align: left; }
.odeme tr.total td { font-weight: 800; background: #e7eef4; }

.side-col {
  display: flex;
  flex-direction: column;
  gap: 16px;
  position: sticky;
  top: 12px;
}
.pazartesi-card {
  background: var(--card);
  border-radius: 14px;
  border: 1px solid var(--line);
  padding: 12px;
  box-shadow: 0 8px 24px rgba(7, 21, 37, 0.06);
}
.pazartesi-box {
  width: 100%;
  border-collapse: collapse;
  background: #fff;
  font-size: 12px;
}
.pazartesi-box caption {
  caption-side: top;
  font-weight: 800;
  letter-spacing: 0.02em;
  padding: 6px;
  background: var(--ice);
  color: var(--navy);
  border: 1px solid var(--navy);
  border-bottom: 0;
}
.pazartesi-box td {
  border: 1px solid var(--navy);
  padding: 5px 7px;
  text-align: left;
  background: #fff;
  color: var(--ink);
}
.pazartesi-box td.v { text-align: right; white-space: nowrap; }
.pazartesi-box td.neg { color: var(--red); text-align: right; white-space: nowrap; }

.months6-card {
  background: var(--card);
  border-radius: 14px;
  border: 1px solid var(--line);
  padding: 14px;
  box-shadow: 0 8px 24px rgba(7, 21, 37, 0.06);
}
.months6-card h2 {
  margin: 0 0 10px;
  font-size: 16px;
  color: var(--navy);
}
.months6 { width: 100%; border-collapse: collapse; }
.months6 td {
  border: 1px solid var(--line);
  padding: 7px 8px;
  font-weight: 700;
}
.months6 td.k { background: var(--ice); color: var(--navy); }
.months6 td.v { background: #f8fbfd; text-align: right; font-variant-numeric: tabular-nums; }
.months6 td.neg { color: var(--red); }

@media (max-width: 980px) {
  .topbar { display: flex; flex-direction: column; text-align: center; }
  .logo { height: 42px; }
  .topbar h1 { font-size: 18px; }
  .report { display: block; }
  .side-col { position: static; margin-top: 12px; }
}
