/* VeliGeldi muhasebe paneli — same slate/brand system as the school admin panel. */

:root {
  --bg-0: #0f1420;
  --bg-1: #131a29;
  --ink: #eef2f8;
  --ink-dim: #b7c0d0;
  --ink-mute: #9aa5b8;
  --surface: #1a2130;
  --surface-2: #212a3b;
  --surface-3: #2b3547;
  --card: var(--surface);
  --card-border: #2b3547;
  --field-bg: #f4f6fa;
  --field-ink: #17202e;
  --field-border: #c2ccdb;
  --brand-gradient: linear-gradient(135deg, #833ab4 0%, #e1306c 55%, #f77737 100%);
  --accent-cyan: #38bdf8;
  --ok: #3dd68c;
  --danger: #f87186;
  --radius: 14px;
  --radius-lg: 16px;
  --radius-sm: 8px;
}

* {
  box-sizing: border-box;
}

html {
  height: 100%;
  background: var(--bg-0);
  overscroll-behavior: none;
}

body {
  margin: 0;
  min-height: 100%;
  color: var(--ink);
  font-family: "Segoe UI", Arial, sans-serif;
  font-size: 16px;
  background: transparent;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(1100px 620px at 6% -8%, rgba(225, 48, 108, 0.42), transparent 58%),
    radial-gradient(1100px 620px at 100% 2%, rgba(247, 119, 55, 0.34), transparent 58%),
    radial-gradient(1000px 640px at 62% 112%, rgba(131, 58, 180, 0.32), transparent 60%),
    linear-gradient(160deg, var(--bg-1) 0%, var(--bg-0) 100%);
}

.container {
  width: min(1120px, calc(100% - 32px));
  margin: 0 auto;
}

main.container {
  padding-bottom: 64px;
}

.navbar {
  background: var(--surface);
  border-bottom: 1px solid var(--card-border);
  color: #fff;
  margin-bottom: 32px;
}

.navbar .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 64px;
  flex-wrap: wrap;
  gap: 12px;
  padding-top: 12px;
  padding-bottom: 12px;
}

.navbar-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  min-width: 0;
}

.brand-logo {
  display: inline-block;
  height: 34px;
  width: auto;
}

.brand-text {
  font-size: 20px;
  font-weight: 700;
  background: linear-gradient(180deg, #ffffff 0%, #f0c7ff 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: #f0c7ff;
  -webkit-text-fill-color: transparent;
  min-width: 0;
  overflow-wrap: break-word;
}

.nav-logout {
  padding: 6px 14px;
  border-radius: 20px;
  border: 1px solid var(--card-border);
  color: var(--ink-mute);
  background: none;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
}

.nav-logout:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
}

.h3 {
  font-size: 26px;
  line-height: 1.2;
  font-weight: 700;
  background: linear-gradient(180deg, #ffffff 0%, #cfe9ff 55%, #7fd8ec 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: #cfe9ff;
  -webkit-text-fill-color: transparent;
  margin: 0 0 20px;
}

@media (forced-colors: active) {
  .h3 {
    -webkit-text-fill-color: currentColor;
    color: CanvasText;
  }
}

.mb-3 {
  margin-bottom: 16px;
}

.mt-2 {
  margin-top: 8px;
}

.form-label {
  display: block;
  margin-bottom: 8px;
  font-weight: 600;
  color: var(--ink);
}

.form-control {
  width: 100%;
  height: 44px;
  border: 1px solid var(--field-border);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  font-family: inherit;
  font-size: 16px;
  line-height: 1.4;
  background: var(--field-bg);
  color: var(--field-ink);
}

.form-control:focus {
  border-color: #e1306c;
  outline: 3px solid rgba(225, 48, 108, 0.25);
  box-shadow: inset 0 1px 3px rgba(29, 20, 54, 0.12);
}

.form-control-sm {
  height: 34px;
  padding: 6px 8px;
  font-size: 14px;
}

.form-control-textarea {
  min-height: 110px;
  height: auto;
  resize: vertical;
}

.form-stack {
  display: grid;
  gap: 16px;
}

.form-grid {
  display: grid;
  gap: 16px;
  align-items: end;
}

.form-grid-credit {
  grid-template-columns: minmax(140px, 0.35fr) minmax(220px, 1fr);
}

.form-grid-filters {
  grid-template-columns: repeat(3, minmax(180px, 1fr));
}

.form-grid-profile {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.form-field-wide {
  grid-column: 1 / -1;
}

.form-field {
  min-width: 0;
}

.label-optional {
  color: var(--ink-mute);
  font-weight: 400;
}

.field-help {
  margin: 8px 0 0;
  color: var(--ink-mute);
  font-size: 13px;
}

.form-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 10px;
}

.switch-row {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  padding: 14px 16px;
  border: 1px solid var(--card-border);
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  color: var(--ink);
  font-weight: 600;
  cursor: pointer;
}

.switch-row input[type="checkbox"] {
  flex: 0 0 auto;
  width: 20px;
  height: 20px;
  margin: 0;
  accent-color: #e1306c;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 44px;
  border: 1px solid var(--card-border);
  border-radius: var(--radius);
  padding: 0 16px;
  color: var(--ink);
  background: var(--surface-2);
  font: inherit;
  font-weight: 600;
  line-height: 1;
  cursor: pointer;
  text-decoration: none;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
  transition: transform 0.06s ease, box-shadow 0.12s ease, filter 0.12s ease;
}

.btn:hover {
  filter: brightness(1.08);
}

.btn:active {
  transform: translateY(1px);
}

.btn-primary {
  background: var(--brand-gradient);
  border-color: transparent;
  box-shadow: 0 6px 18px rgba(225, 48, 108, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.22);
}

.btn-outline-danger {
  background: rgba(248, 113, 134, 0.1);
  border-color: rgba(248, 113, 134, 0.4);
  color: #ffc7d2;
}

.btn-outline-danger:hover {
  background: rgba(248, 113, 134, 0.18);
}

.btn-sm {
  height: 34px;
  padding: 0 12px;
  font-size: 14px;
  border-radius: var(--radius-sm);
}

.alert {
  border-radius: var(--radius);
  padding: 12px 14px;
  margin-bottom: 16px;
  border: 1px solid transparent;
}

.alert-danger {
  background: rgba(248, 113, 134, 0.16);
  border-color: rgba(248, 113, 134, 0.5);
  color: #ffd2da;
}

.alert-success {
  background: rgba(61, 214, 140, 0.16);
  border-color: rgba(61, 214, 140, 0.5);
  color: #c3f3dc;
}

/* One-time secret reveal: monospace value + explicit copy affordance. */
.key-box {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 8px;
}

.key-value {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 14px;
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-sm);
  padding: 6px 10px;
  word-break: break-all;
}

.copy-btn {
  flex: 0 0 auto;
}

.panel {
  background: var(--card);
  border: 1px solid var(--card-border);
  border-radius: var(--radius);
  padding: 24px;
  margin-bottom: 24px;
}

.panel-danger {
  border-color: rgba(248, 113, 134, 0.38);
}

.panel-title {
  font-size: 18px;
  font-weight: 700;
  margin: 0 0 16px;
  color: var(--ink);
}

.empty-state {
  text-align: center;
  padding: 40px 20px;
  color: var(--ink-dim);
}

.pill {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
}

.pill-ok {
  background: rgba(61, 214, 140, 0.16);
  color: #b8f0d4;
  border: 1px solid rgba(61, 214, 140, 0.4);
}

.pill-mute {
  background: var(--surface-2);
  color: var(--ink-mute);
  border: 1px solid var(--card-border);
}

.pill-warn {
  background: rgba(248, 113, 134, 0.16);
  color: #ffd2da;
  border: 1px solid rgba(248, 113, 134, 0.5);
}

.table {
  width: 100%;
  border-collapse: collapse;
  background: var(--surface);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.28);
}

.table th,
.table td {
  border-bottom: 1px solid var(--card-border);
  padding: 12px;
  text-align: left;
  vertical-align: middle;
  color: var(--ink);
  overflow-wrap: anywhere;
}

.table th {
  color: var(--ink-dim);
  font-weight: 600;
}

.table tbody tr {
  transition: background 0.12s ease;
}

.table-striped tbody tr:nth-child(odd) {
  background: var(--surface-2);
}

.table tbody tr:hover,
.table-striped tbody tr:nth-child(odd):hover {
  background: var(--surface-3);
}

.text-muted {
  color: var(--ink-mute);
  font-size: 13px;
}

.mono {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

.row-actions-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.row-actions-inner form {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin: 0;
}

.row-actions-inner .amount-input {
  width: 13rem;
}

.row-actions-inner .note-input {
  width: 12rem;
}

/* Native number-input spinner clashes with the flat theme everywhere it appears. */
input[type="number"] {
  -moz-appearance: textfield;
}

input[type="number"]::-webkit-inner-spin-button,
input[type="number"]::-webkit-outer-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

/* Login: centered brand card (page glow comes from the body corner wash). */
.login-wrap {
  min-height: calc(100vh - 128px);
  display: flex;
  align-items: center;
  justify-content: center;
}

.login-card {
  width: min(100%, 400px);
  background: var(--surface);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-lg);
  padding: 36px 32px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.4);
}

.login-brand {
  text-align: center;
  margin-bottom: 28px;
}

.login-logo {
  display: inline-block;
  height: 60px;
  width: auto;
  margin-bottom: 14px;
}

.login-brand-text {
  font-size: 24px;
  font-weight: 800;
  background: linear-gradient(180deg, #ffffff 0%, #cfe9ff 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: #cfe9ff;
  -webkit-text-fill-color: transparent;
}

.login-subtitle {
  margin-top: 2px;
  color: var(--ink-mute);
  font-size: 15px;
}

.login-submit {
  width: 100%;
  margin-top: 4px;
}

.login-tagline {
  margin: 22px 0 0;
  text-align: center;
  color: var(--ink-mute);
  font-size: 13px;
}

/* Wide screens: let content breathe instead of a fixed 1120px island. */
@media (min-width: 1600px) {
  .container {
    width: min(1440px, calc(100% - 96px));
  }
}

/* Narrow screens: wide tables scroll horizontally instead of overflowing. */
@media (max-width: 720px) {
  .panel {
    padding: 18px;
  }

  .form-grid-credit,
  .form-grid-filters,
  .form-grid-profile {
    grid-template-columns: 1fr;
  }

  .form-actions .btn {
    flex: 1 1 auto;
  }

  .row-actions-inner form {
    align-items: stretch;
    flex-direction: column;
    width: 100%;
  }

  .row-actions-inner .amount-input,
  .row-actions-inner .note-input {
    width: 100%;
  }

  .table {
    display: block;
    overflow-x: auto;
    white-space: nowrap;
  }

  .navbar .container {
    justify-content: center;
    text-align: center;
  }
}

/* First in-content link; --accent-cyan was declared in :root and unused until now. */
.link {
  color: var(--accent-cyan);
  text-decoration: none;
  font-weight: 600;
}

.link:hover {
  text-decoration: underline;
}

/* Native <dialog> so Esc, the focus trap and ::backdrop come for free. */
.confirm-dialog {
  background: var(--card);
  border: 1px solid var(--card-border);
  border-radius: var(--radius);
  color: var(--ink);
  padding: 24px;
  max-width: 30rem;
  width: calc(100% - 32px);
}

.confirm-dialog::backdrop {
  background: rgba(8, 11, 18, 0.7);
}

.confirm-title {
  font-size: 18px;
  font-weight: 700;
  margin: 0 0 12px;
}

.confirm-body {
  margin: 0 0 12px;
  line-height: 1.5;
}

.confirm-note {
  margin: 0 0 20px;
  font-size: 14px;
  line-height: 1.5;
}

.confirm-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

/* Groups panels on the detail page into named sections without a new component. */
.section-title {
  font-size: 14px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--ink-mute);
  margin: 32px 0 12px;
}

/* Native <details> reuses .panel for its border/background; only the summary needs styling. */
details.panel > summary {
  cursor: pointer;
  font-size: 18px;
  font-weight: 700;
  color: var(--ink);
}

details.panel[open] > summary {
  margin-bottom: 16px;
}

.settings-stack {
  display: grid;
  gap: 20px;
}

.setting-block + .setting-block {
  padding-top: 20px;
  border-top: 1px solid var(--card-border);
}

.setting-title {
  margin: 0 0 10px;
  color: var(--ink);
  font-size: 16px;
}

.setting-value {
  margin: 0;
}

.navbar-start {
  display: flex;
  align-items: center;
  gap: 20px;
  flex-wrap: wrap;
}

.nav-link {
  color: var(--ink-dim);
  text-decoration: none;
  font-weight: 600;
}

.nav-link:hover {
  color: var(--ink);
  text-decoration: underline;
}
