/* LifeOS paneli — Dark Neon Glass: koyu zemin, cam kartlar, anlamsal neon tonlar. */
:root {
  --bg: #070b14;
  --bg-2: #0d1424;
  --glass: rgba(22, 32, 54, 0.62);
  --glass-strong: rgba(30, 42, 70, 0.8);
  --border: rgba(140, 170, 255, 0.16);
  --text: #e8eefc;
  --muted: #8d9bbb;
  --success: #34f5a4;
  --danger: #ff5c7a;
  --info: #4cc9ff;
  --warning: #ffc24b;
  --neutral: #a9b4cc;
  --radius: 16px;
  --gap: 16px;
  color-scheme: dark;
}

* { box-sizing: border-box; }

html { background: var(--bg); }

body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  font: 15px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  background:
    radial-gradient(1200px 600px at 10% -10%, rgba(76, 201, 255, 0.14), transparent 60%),
    radial-gradient(900px 500px at 100% 0%, rgba(52, 245, 164, 0.08), transparent 60%),
    linear-gradient(180deg, var(--bg-2), var(--bg));
  background-attachment: fixed;
}

a { color: var(--info); text-decoration: none; }
a:hover { text-decoration: underline; }
h1 { font-size: 26px; margin: 0 0 4px; letter-spacing: -0.01em; }
h2 { font-size: 17px; margin: 0 0 14px; }
code, .mono { font-family: ui-monospace, "Cascadia Code", Consolas, monospace; }
small { display: block; color: var(--muted); font-size: 12px; }
.muted { color: var(--muted); margin: 0; }
.small { font-size: 13px; }
.nowrap { white-space: nowrap; }

/* Üst çubuk */
.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  gap: 24px;
  padding: 12px 32px;
  background: rgba(7, 11, 20, 0.78);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border);
}
.brand { color: var(--text); font-weight: 700; font-size: 18px; }
.brand span { color: var(--success); margin-left: 6px; font-weight: 500; font-size: 13px; text-transform: uppercase; letter-spacing: 0.12em; }
.topbar nav { display: flex; gap: 4px; flex: 1; }
.topbar nav a { color: var(--muted); padding: 8px 14px; border-radius: 999px; }
.topbar nav a:hover { color: var(--text); background: var(--glass); text-decoration: none; }
.topbar nav a.active { color: var(--text); background: var(--glass-strong); box-shadow: inset 0 0 0 1px var(--border), 0 0 18px rgba(76, 201, 255, 0.18); }
.logout { margin: 0; }

.page { max-width: 1240px; margin: 0 auto; padding: 28px 32px 64px; display: flex; flex-direction: column; gap: var(--gap); }
.page-head { display: flex; justify-content: space-between; align-items: flex-end; gap: var(--gap); flex-wrap: wrap; }

/* Cam kart */
.card {
  background: var(--glass);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  backdrop-filter: blur(18px);
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.35);
}
.card.narrow { max-width: 420px; margin: 12vh auto 0; width: 100%; }
.card.empty { text-align: center; color: var(--muted); }
.table-card { padding: 0; overflow-x: auto; }

/* Metrikler */
.metrics { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: var(--gap); }
.metric { display: flex; flex-direction: column; gap: 4px; position: relative; overflow: hidden; }
.metric::before { content: ""; position: absolute; inset: 0 auto 0 0; width: 3px; background: currentColor; box-shadow: 0 0 16px currentColor; }
.metric .label { color: var(--muted); font-size: 13px; }
.metric strong { font-size: 24px; color: var(--text); font-variant-numeric: tabular-nums; }

/* Anlamsal tonlar */
.tone-success { color: var(--success); }
.tone-danger { color: var(--danger); }
.tone-info { color: var(--info); }
.tone-warning { color: var(--warning); }
.tone-neutral { color: var(--neutral); }

.badge {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  border: 1px solid currentColor;
  background: rgba(255, 255, 255, 0.04);
  white-space: nowrap;
}

.notice {
  margin: 0;
  padding: 12px 16px;
  border-radius: 12px;
  border: 1px solid currentColor;
  background: rgba(255, 255, 255, 0.04);
}

/* Tablolar */
table { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
th, td { padding: 11px 16px; text-align: left; border-bottom: 1px solid rgba(140, 170, 255, 0.08); vertical-align: top; }
th { color: var(--muted); font-weight: 600; font-size: 12px; text-transform: uppercase; letter-spacing: 0.06em; background: rgba(255, 255, 255, 0.02); }
tbody tr:hover { background: rgba(76, 201, 255, 0.05); }
td, td.tone-neutral { color: var(--text); }
td.tone-success { color: var(--success); }
td.tone-danger { color: var(--danger); }
td.tone-info { color: var(--info); }
td.tone-warning { color: var(--warning); }
.num { text-align: right; white-space: nowrap; }
.amount { font-weight: 600; }
table.compact th, table.compact td { padding: 8px 10px; }

/* Formlar */
label { display: flex; flex-direction: column; gap: 6px; color: var(--muted); font-size: 13px; }
input, select, textarea {
  font: inherit;
  color: var(--text);
  background: rgba(5, 9, 18, 0.7);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px 12px;
  min-height: 44px;
}
input:focus, select:focus, textarea:focus, .btn:focus-visible, a:focus-visible { outline: 2px solid var(--info); outline-offset: 2px; }
textarea { resize: vertical; }
.stack { display: flex; flex-direction: column; gap: 12px; margin-top: 16px; }
.filters, .inline-form { display: flex; flex-wrap: wrap; gap: 12px; align-items: flex-end; }
.filters label { min-width: 170px; }
.grid-form { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin-top: 16px; }
.grid-form .wide { grid-column: span 3; }
.grid-form .actions { grid-column: span 3; display: flex; justify-content: flex-end; }
.form-card summary { cursor: pointer; font-weight: 600; color: var(--success); }
.form-card[open] summary { margin-bottom: 4px; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0 18px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--glass-strong);
  color: var(--text);
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}
.btn:hover { text-decoration: none; border-color: rgba(76, 201, 255, 0.5); }
.btn.primary { background: linear-gradient(135deg, rgba(52, 245, 164, 0.24), rgba(76, 201, 255, 0.24)); border-color: rgba(52, 245, 164, 0.55); box-shadow: 0 0 22px rgba(52, 245, 164, 0.18); }
.btn.danger { color: var(--danger); border-color: rgba(255, 92, 122, 0.55); background: rgba(255, 92, 122, 0.08); }
.btn.ghost { background: transparent; }
.btn.small { min-height: 34px; padding: 0 12px; font-size: 13px; }

.month-nav { display: flex; gap: 8px; align-items: center; }
.month-nav form { display: flex; gap: 8px; margin: 0; }
.tabs { display: flex; gap: 6px; }
.tab { padding: 8px 16px; border-radius: 999px; color: var(--muted); border: 1px solid var(--border); }
.tab.active { color: var(--text); background: var(--glass-strong); box-shadow: 0 0 14px rgba(76, 201, 255, 0.2); }
.pager { display: flex; justify-content: center; align-items: center; gap: 16px; color: var(--muted); }
.back { color: var(--muted); }

/* Kategori çubukları */
.bars { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 12px; }
.bars li { display: grid; grid-template-columns: 200px 1fr 190px; gap: 14px; align-items: center; }
.bar-label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bar-value { text-align: right; font-variant-numeric: tabular-nums; }
.bar-value small { display: inline; }
progress { appearance: none; -webkit-appearance: none; width: 100%; height: 10px; border: 0; border-radius: 999px; background: rgba(255, 255, 255, 0.06); overflow: hidden; }
progress::-webkit-progress-bar { background: rgba(255, 255, 255, 0.06); border-radius: 999px; }
progress::-webkit-progress-value { background: linear-gradient(90deg, #ff5c7a, #ff9a6b); border-radius: 999px; box-shadow: 0 0 12px rgba(255, 92, 122, 0.6); }
progress::-moz-progress-bar { background: linear-gradient(90deg, #ff5c7a, #ff9a6b); border-radius: 999px; }

/* Grafik */
.chart { width: 100%; height: auto; display: block; margin-bottom: 8px; }
.chart .axis { stroke: rgba(140, 170, 255, 0.2); stroke-width: 1; }
.chart .bar-income { fill: var(--success); filter: drop-shadow(0 0 4px rgba(52, 245, 164, 0.5)); }
.chart .bar-outgo { fill: var(--danger); filter: drop-shadow(0 0 4px rgba(255, 92, 122, 0.5)); }
.chart text { fill: var(--muted); font-size: 11px; }
.legend { color: var(--muted); font-size: 13px; margin: 0 0 12px; display: flex; gap: 8px; align-items: center; }
.dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; background: currentColor; box-shadow: 0 0 8px currentColor; margin-left: 8px; }

/* Bir kez gösterilen cihaz anahtarı */
.secret { border-color: rgba(255, 194, 75, 0.55); box-shadow: 0 0 30px rgba(255, 194, 75, 0.15); }
.secret, .secret p { color: var(--text); }
.secret h2 { color: var(--warning); }
.secret dl { display: grid; grid-template-columns: max-content 1fr; gap: 10px 16px; margin: 12px 0 0; }
.secret dt { color: var(--muted); }
.secret dd { margin: 0; display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.secret code { word-break: break-all; padding: 6px 10px; background: rgba(0, 0, 0, 0.35); border-radius: 8px; }

.login h1 { margin-bottom: 8px; }
.login .notice { margin-top: 16px; }

@media (max-width: 860px) {
  .topbar { flex-wrap: wrap; padding: 12px 16px; }
  .page { padding: 20px 16px 48px; }
  .grid-form { grid-template-columns: 1fr; }
  .grid-form .wide, .grid-form .actions { grid-column: span 1; }
  .bars li { grid-template-columns: 1fr; gap: 4px; }
  .bar-value { text-align: left; }
}
