:root {
  color-scheme: light;
  --ink: #202124;
  --muted: #5f6670;
  --line: #d9dee6;
  --line-soft: #eceff3;
  --surface: #ffffff;
  --page: #f6f7f9;
  --brand: #b3261e;
  --brand-dark: #17191c;
  --focus: #2459c7;
  --ok: #177245;
  --ok-bg: #eaf6ef;
  --warn: #9a6500;
  --warn-bg: #fff4df;
  --danger: #b3261e;
  --danger-bg: #fdebea;
  --blue-bg: #eef4ff;
  --nav: #18172a;
  --paper: #fbfaf7;
  --cream: #f4f2ec;
  --accent: #ec3548;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: var(--paper);
  color: var(--ink);
  font-weight: 400;
}

button,
input,
select,
textarea {
  font: inherit;
}

strong,
b,
h1,
h2,
h3 {
  font-weight: 500;
}

.login-screen {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 20px;
}

.login-card {
  width: min(420px, 100%);
  background: var(--surface);
  border: 0.5px solid var(--line);
  border-radius: 12px;
  padding: 24px;
  display: grid;
  gap: 16px;
}

.login-card h1 {
  font-size: 2rem;
}

.hint {
  margin: 0;
  color: var(--muted);
  font-size: 0.86rem;
  line-height: 1.4;
}

.is-hidden {
  display: none !important;
}

.app-shell {
  width: min(1440px, calc(100% - 48px));
  margin: 0 auto;
  padding: 18px 0 36px;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 34px;
  padding: 24px 40px;
  border-radius: 0;
  background: var(--nav);
  color: #fff;
}

.brand-lockup {
  display: flex;
  align-items: center;
  gap: 14px;
}

.brand-logo-wrap {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 172px;
  max-width: 42vw;
  height: 48px;
}

.brand-logo-wrap-light {
  width: 196px;
  height: 44px;
  padding: 8px 12px;
  border-radius: 12px;
  background: var(--nav);
}

.brand-logo {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.brand-lockup strong {
  display: block;
  font-size: 1.28rem;
  letter-spacing: 0.03em;
}

.brand-lockup span:not(.brand-logo-wrap) {
  display: block;
  margin-top: 2px;
  color: #c4c4d2;
  font-size: 0.9rem;
}

.eyebrow {
  margin: 0 0 4px;
  color: var(--brand);
  font-size: 0.78rem;
  font-weight: 500;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1,
h2,
h3 {
  margin: 0;
  letter-spacing: 0;
}

h1 {
  font-size: clamp(1.8rem, 4vw, 3.2rem);
}

h2 {
  font-size: 1.25rem;
}

h3 {
  font-size: 1rem;
}

.today-pill {
  white-space: nowrap;
  border: 0;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 999px;
  padding: 10px 14px;
  color: #d8d8e4;
  font-weight: 500;
}

.topbar .ghost-button {
  border-color: transparent;
  background: transparent;
  color: #d8d8e4;
}

.hero-panel {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 0.38fr);
  gap: 24px;
  align-items: end;
  margin: 0 48px 28px;
}

.hero-panel h1 {
  font-size: clamp(2.5rem, 5vw, 4.5rem);
  line-height: 0.98;
}

.hero-subtitle {
  margin: 12px 0 0;
  color: #3f3f3f;
  font-size: 1.15rem;
}

.top-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  flex-wrap: wrap;
}

.summary-band {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 24px;
  margin: 0 48px 28px;
}

.report-selector {
  display: grid;
  grid-template-columns: minmax(220px, 280px);
  gap: 12px;
  align-items: end;
  margin: 0;
}

.report-selector label {
  color: var(--muted);
}

.summary-title {
  min-height: 180px;
  background: var(--brand-dark);
  color: #fff;
  border-radius: 12px;
  padding: 26px;
  display: grid;
  align-content: space-between;
}

.summary-title .eyebrow {
  color: #ffcb35;
}

.summary-title span {
  color: #d5d9df;
  font-weight: 500;
}

.metric {
  min-height: 180px;
  background: var(--surface);
  border: 0.5px solid var(--line);
  border-radius: 12px;
  padding: 28px;
  display: grid;
  align-content: space-between;
}

.metric span {
  color: var(--muted);
  font-size: 0.98rem;
  font-weight: 500;
}

.metric strong {
  font-size: clamp(2rem, 3vw, 2.7rem);
}

.metric small {
  color: #3f3f3f;
  font-size: 0.95rem;
}

.metric .trend-up {
  color: #168548;
}

.metric .trend-warn {
  color: #a46900;
}

.metric.warning strong {
  color: var(--warn);
}

.metric.highlight {
  border-color: #f1d79b;
  background: var(--warn-bg);
}

.metric.highlight strong {
  color: var(--brand-dark);
}

.workspace {
  display: grid;
  grid-template-columns: minmax(420px, 0.95fr) minmax(460px, 1.05fr);
  gap: 28px;
  margin: 0 48px;
  align-items: start;
}

.entry-panel,
.dashboard-panel,
.branch-summary-panel,
.weekly-trend-panel {
  background: var(--surface);
  border: 0.5px solid var(--line);
  border-radius: 12px;
  padding: 0;
  overflow: hidden;
}

.entry-panel > *,
.branch-summary-panel > *,
.weekly-trend-panel > *,
.dashboard-panel > * {
  margin-left: 26px;
  margin-right: 26px;
}

.entry-panel > .section-head,
.branch-summary-panel > .section-head,
.weekly-trend-panel > .section-head,
.dashboard-panel > .section-head {
  margin: 0 0 0;
  padding: 26px;
  border-bottom: 1px solid var(--line);
}

.dashboard-panel {
  grid-column: 1 / -1;
}

.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 0;
}

.form-grid,
.money-grid,
.filters {
  display: grid;
  gap: 12px;
}

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

.form-grid.single-field {
  grid-template-columns: minmax(220px, 420px);
}

.money-grid {
  grid-template-columns: repeat(3, 1fr);
}

label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 500;
}

input,
select,
textarea {
  width: 100%;
  min-height: 52px;
  border: 0.5px solid var(--line);
  border-radius: 12px;
  padding: 12px 14px;
  color: var(--ink);
  background: #fff;
}

textarea {
  resize: vertical;
}

input:focus,
select:focus,
textarea:focus {
  outline: 3px solid color-mix(in srgb, var(--focus) 20%, transparent);
  border-color: var(--focus);
}

input:disabled,
select:disabled,
textarea:disabled,
button:disabled {
  cursor: not-allowed;
  opacity: 0.62;
}

.is-readonly .step-card:first-of-type::before {
  content: "Bu kayıt salt okunur. Düzeltme için merkezden kilidi açın.";
  display: block;
  border-radius: 12px;
  padding: 12px;
  color: var(--ok);
  background: var(--ok-bg);
}

.section-title {
  margin: 20px 0 10px;
  font-weight: 500;
}

.header-fields {
  margin-bottom: 14px;
}

.step-card {
  display: grid;
  gap: 14px;
  margin-top: 0;
  padding: 28px 0;
  border: 0;
  border-top: 1px solid var(--line);
  border-radius: 0;
  background: #fff;
}

.step-card:last-of-type {
  border-bottom: 1px solid var(--line);
}

.step-progress {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0;
  margin: 28px 26px 8px;
  position: relative;
}

.step-progress::before {
  content: "";
  position: absolute;
  left: 12%;
  right: 12%;
  top: 22px;
  height: 1px;
  background: var(--line);
}

.progress-step {
  position: relative;
  display: grid;
  justify-items: center;
  gap: 8px;
  color: #3f3f3f;
  text-align: center;
}

.progress-step span {
  display: grid;
  width: 48px;
  height: 48px;
  place-items: center;
  border: 2px solid #bdbbb5;
  border-radius: 999px;
  background: var(--surface);
  color: #3f3f3f;
  font-size: 1.1rem;
  font-weight: 500;
}

.progress-step.done span {
  border-color: #229b56;
  background: #229b56;
  color: #fff;
}

.progress-step.active span {
  border-color: var(--accent);
  background: var(--accent);
  color: #fff;
}

.progress-step small {
  max-width: 96px;
  font-size: 0.8rem;
  line-height: 1.15;
}

.step-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.step-head h3 {
  margin-top: 3px;
  font-size: 1.22rem;
}

.step-label {
  color: var(--muted);
  font-size: 0.82rem;
}

.running-total,
.total-strip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border-radius: 12px;
  padding: 12px;
  background: var(--cream);
}

.running-total span,
.total-strip span,
.summary-cell span {
  color: var(--muted);
  font-size: 0.82rem;
}

.running-total strong,
.total-strip strong {
  font-size: 1.3rem;
}

.cash-field {
  border-color: #c7d8ff;
  background: var(--blue-bg);
}

.cash-split {
  display: grid;
  gap: 10px;
}

.review-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.summary-cell {
  display: grid;
  gap: 5px;
  min-width: 0;
  border: 0.5px solid var(--line-soft);
  border-radius: 12px;
  padding: 12px;
  background: #fff;
}

.summary-cell.full {
  grid-column: 1 / -1;
}

.split-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.expenses-list {
  display: grid;
  gap: 10px;
}

.form-message {
  min-height: 20px;
  margin-top: 10px;
  color: var(--warn);
  font-size: 0.9rem;
  font-weight: 500;
}

.form-message.success {
  color: var(--ok);
}

.status-line {
  margin: 8px 0 0;
  color: var(--muted);
  font-weight: 500;
}

.submission-notice {
  display: grid;
  gap: 6px;
  margin: 16px 0;
  border: 0.5px solid #bfe4ce;
  border-radius: 12px;
  padding: 16px;
  background: var(--ok-bg);
  color: var(--ok);
}

.submission-notice span {
  display: inline-flex;
  width: fit-content;
  margin-bottom: 6px;
  border-radius: 999px;
  padding: 5px 10px;
  background: #d9f0e3;
  font-size: 0.78rem;
  font-weight: 500;
}

.submission-notice strong {
  display: block;
  color: var(--ink);
  font-size: 1.05rem;
}

.submission-notice p {
  margin: 4px 0 0;
  color: var(--muted);
}

.cash-difference {
  margin-top: 10px;
  border: 0.5px solid var(--line);
  border-radius: 12px;
  padding: 12px;
  font-weight: 500;
}

.cash-difference.balanced {
  color: var(--ok);
  background: #e8f4ee;
}

.cash-difference.unbalanced {
  color: var(--danger);
  background: var(--danger-bg);
}

.field-error {
  border-color: var(--warn);
  background: #fff8ed;
}

.expense-row {
  display: grid;
  grid-template-columns: minmax(160px, 1fr) 180px 120px minmax(150px, 0.8fr) 48px;
  gap: 8px;
  align-items: center;
  border: 0.5px solid var(--line);
  border-radius: 12px;
  padding: 10px;
  background: #fbfcfd;
}

.note-field {
  margin-top: 16px;
}

.calculation-strip {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin: 18px 0;
  padding: 12px;
  border-radius: 8px;
  background: #f0f3f5;
}

.calculation-strip div {
  display: grid;
  gap: 4px;
}

.calculation-strip span {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 500;
}

.calculation-strip strong {
  font-size: 1rem;
}

.primary-button,
.ghost-button,
.small-button,
.icon-button,
.dark-button {
  border: 0.5px solid var(--line);
  border-radius: 12px;
  min-height: 48px;
  cursor: pointer;
  font-weight: 500;
}

.primary-button {
  background: var(--brand-dark);
  color: #fff;
  padding: 0 16px;
  border-color: var(--brand-dark);
}

.primary-button:hover {
  background: #000;
}

.ghost-button,
.small-button {
  background: #fff;
  color: var(--ink);
  padding: 0 12px;
}

.dark-button {
  background: var(--brand-dark);
  color: #fff;
  border-color: var(--brand-dark);
  padding: 0 14px;
}

.small-button {
  min-height: 48px;
}

.icon-button {
  width: 48px;
  min-height: 48px;
  background: var(--danger-bg);
  color: var(--danger);
}

.button-row {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.button-row .primary-button {
  flex: 1 1 160px;
}

.button-row .ghost-button,
.button-row .small-button {
  flex: 1 1 140px;
}

.summary-list {
  display: grid;
  gap: 0;
  padding-bottom: 22px;
}

.summary-item {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  border-bottom: 1px solid var(--line);
  padding: 18px 0;
  font-weight: 500;
}

.summary-item.danger span,
.summary-item.danger strong {
  color: var(--accent);
}

.weekly-trend-panel {
  grid-column: 2;
}

.trend-list {
  display: grid;
  gap: 16px;
  padding: 24px 0 28px;
}

.trend-row {
  display: grid;
  grid-template-columns: 52px minmax(120px, 1fr) 82px;
  gap: 14px;
  align-items: center;
}

.trend-bar {
  height: 12px;
  overflow: hidden;
  border-radius: 999px;
  background: var(--cream);
}

.trend-bar span {
  display: block;
  width: var(--bar-width, 0%);
  height: 100%;
  border-radius: inherit;
  background: var(--accent);
}

.trend-row.empty .trend-bar span {
  min-width: 34px;
  background: #b9b8b2;
}

.trend-row strong {
  text-align: right;
  font-weight: 500;
}

.summary-item span {
  color: var(--muted);
}

.filters {
  grid-template-columns: 1fr 1fr;
  margin-bottom: 16px;
}

.branch-status {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  margin-bottom: 16px;
}

.status-item {
  border: 0.5px solid var(--line);
  border-radius: 999px;
  padding: 12px;
  display: flex;
  justify-content: space-between;
  gap: 8px;
  font-weight: 500;
}

.status-item.done span {
  color: var(--ok);
}

.status-item.waiting span {
  color: var(--warn);
}

.status-item.done {
  background: var(--ok-bg);
  border-color: #c9e8d4;
}

.status-item.waiting {
  background: var(--warn-bg);
  border-color: #f1d79b;
}

.records-list {
  display: grid;
  gap: 14px;
}

.record-card {
  border: 0.5px solid var(--line);
  border-radius: 12px;
  overflow: hidden;
  background: #fff;
}

.record-header {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: flex-start;
  padding: 16px;
  background: #fff;
}

.record-header strong {
  display: block;
  margin-top: 4px;
  font-size: 1.2rem;
  font-weight: 500;
}

.record-kicker,
.record-meta span,
.record-channel span,
.record-total span {
  display: block;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 500;
  text-transform: uppercase;
}

.status-pill {
  border-radius: 999px;
  padding: 7px 11px;
  background: #eef2f7;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 500;
  white-space: nowrap;
}

.status-draft {
  background: var(--warn-bg);
  color: var(--warn);
}

.status-submitted {
  background: #eaf2ff;
  color: #2459c7;
}

.status-locked {
  background: var(--ok-bg);
  color: #167a4a;
}

.status-void {
  background: var(--danger-bg);
  color: var(--danger);
}

.record-meta {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1px;
  background: var(--line);
  border-top: 1px solid var(--line);
}

.record-meta div {
  min-width: 0;
  padding: 12px 16px;
  background: #f8fafc;
}

.record-meta strong,
.record-channel strong,
.record-total strong {
  display: block;
  margin-top: 4px;
  font-weight: 500;
  overflow-wrap: anywhere;
}

.record-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(135px, 1fr));
  background: #fff;
  border-top: 1px solid var(--line);
}

.record-channel {
  min-width: 0;
  background: #fff;
  padding: 13px 16px;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.record-channel:last-child {
  border-right: 0;
}

.record-totals {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  background: #fff;
}

.record-total {
  min-width: 0;
  background: #fff;
  padding: 13px 16px;
  border-right: 1px solid var(--line);
}

.record-total:last-child {
  border-right: 0;
}

.record-action-bar {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
  padding: 12px 16px;
  background: #fff;
  border-top: 1px solid var(--line);
}

.record-action-bar .small-button {
  min-width: 108px;
  min-height: 38px;
}

.danger-button {
  color: var(--danger);
  border-color: #f1c4c7;
  background: #fff;
}

.expense-report {
  margin-top: 18px;
}

.expense-report h3 {
  margin-bottom: 10px;
}

.empty-state {
  color: var(--muted);
  border: 1px dashed var(--line);
  border-radius: 8px;
  padding: 16px;
}

.report-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
}

@media (max-width: 1000px) {
  .workspace,
  .summary-band,
  .hero-panel {
    grid-template-columns: 1fr;
  }

  .weekly-trend-panel {
    grid-column: auto;
  }

  .metric,
  .summary-title {
    min-height: 82px;
  }
}

@media (max-width: 720px) {
  .app-shell {
    width: 100%;
    padding: 0 0 18px;
  }

  .topbar,
  .section-head {
    align-items: flex-start;
    flex-direction: column;
  }

  .topbar {
    gap: 10px;
    margin-bottom: 24px;
    padding: 18px;
  }

  .hero-panel,
  .summary-band,
  .workspace {
    margin-left: 14px;
    margin-right: 14px;
  }

  h1 {
    font-size: 2.15rem;
    line-height: 1.05;
  }

  h2 {
    font-size: 1.1rem;
  }

  .entry-panel,
  .dashboard-panel,
  .branch-summary-panel,
  .weekly-trend-panel {
    padding: 0;
  }

  .summary-band {
    gap: 10px;
    margin-bottom: 12px;
  }

  .metric,
  .summary-title {
    min-height: 76px;
    padding: 13px;
  }

  .metric strong {
    font-size: 1.35rem;
  }

  input,
  select,
  textarea {
    min-height: 48px;
    font-size: 1rem;
  }

  .section-title {
    margin-top: 16px;
  }

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

  .form-grid,
  .money-grid,
  .filters,
  .branch-status,
  .calculation-strip {
    grid-template-columns: 1fr;
  }

  .step-progress {
    margin-left: 14px;
    margin-right: 14px;
  }

  .entry-panel > *,
  .branch-summary-panel > *,
  .weekly-trend-panel > *,
  .dashboard-panel > * {
    margin-left: 14px;
    margin-right: 14px;
  }

  .entry-panel > .section-head,
  .branch-summary-panel > .section-head,
  .weekly-trend-panel > .section-head,
  .dashboard-panel > .section-head {
    padding: 18px 14px;
  }

  .expense-row {
    grid-template-columns: 1fr;
  }

  .record-header {
    flex-direction: column;
  }

  .record-meta,
  .record-totals {
    grid-template-columns: 1fr;
  }

  .record-action-bar {
    justify-content: stretch;
  }

  .record-action-bar .small-button {
    flex: 1 1 130px;
  }

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

  .record-channel:last-child:nth-child(odd) {
    grid-column: 1 / -1;
  }

  .sticky-actions {
    position: sticky;
    bottom: 0;
    z-index: 10;
    margin: 18px 0 0;
    padding: 12px 14px;
    background: var(--surface);
    border-top: 1px solid var(--line);
  }

  .split-title {
    align-items: stretch;
  }

  .small-button {
    width: 100%;
  }

  .calculation-strip {
    gap: 8px;
    padding: 10px;
  }

  .icon-button {
    width: 100%;
  }
}

@media (max-width: 430px) {
  h1 {
    font-size: 1.85rem;
  }

  .login-card {
    padding: 18px;
  }

  .today-pill,
  .ghost-button {
    width: 100%;
    text-align: center;
  }

  .entry-panel,
  .dashboard-panel,
  .branch-summary-panel {
    border-radius: 8px;
  }

  .record-grid {
    grid-template-columns: 1fr;
  }
}
