:root {
  --bg: #eef1f5;
  --side: #172633;
  --side-ink: #d7dee7;
  --card: #ffffff;
  --line: #e2e7ee;
  --ink: #1b2430;
  --muted: #5e6b7a;
  --accent: #1d4f91;
  --accent-dim: #3d6aab;
  --warn: #9a6700;
  --bad: #b42318;
  --ok: #0f7a45;
  --shadow: 0 1px 2px rgba(16, 24, 40, 0.05);
  --font: "IBM Plex Sans", sans-serif;
  --display: "IBM Plex Sans", sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, monospace;
  --radius: 8px;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
}

#root {
  min-height: 100vh;
}

.boot {
  min-height: 100vh;
  display: grid;
  place-items: center;
  color: var(--muted);
}

.login-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
  background:
    linear-gradient(180deg, #172633 0 180px, transparent 180px),
    var(--bg);
}

.login-card {
  width: min(400px, 100%);
  padding: 28px 28px 22px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--card);
  box-shadow: 0 16px 40px rgba(23, 38, 51, 0.12);
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 22px;
}

.logo {
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  border-radius: 7px;
  background: var(--accent);
  color: #fff;
  font-weight: 700;
  font-size: 0.95rem;
}

.side .logo {
  background: #fff;
  color: var(--side);
}

.brand strong {
  font-size: 0.95rem;
  font-weight: 700;
  letter-spacing: 0.14em;
}

.side .brand strong {
  color: #fff;
}

h1,
h2,
h3 {
  font-family: var(--display);
  font-weight: 600;
  margin: 0;
}

.login-card h1 {
  font-size: 1.45rem;
  margin-bottom: 6px;
}

.lede {
  color: var(--muted);
  margin: 0 0 22px;
  line-height: 1.5;
}

label {
  display: block;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--muted);
  margin-bottom: 6px;
}

input,
button,
textarea,
select {
  font: inherit;
}

input[type="password"],
input[type="text"],
select {
  width: 100%;
  border: 1px solid #cfd6df;
  border-radius: var(--radius);
  background: #fff;
  color: var(--ink);
  padding: 11px 12px;
  outline: none;
  margin-bottom: 14px;
}

input:focus,
textarea:focus,
select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(29, 79, 145, 0.15);
}

textarea {
  width: 100%;
  min-height: 120px;
  resize: vertical;
  border: 1px solid #cfd6df;
  border-radius: var(--radius);
  background: #fff;
  color: var(--ink);
  padding: 12px;
  outline: none;
  margin: 12px 0;
}

textarea.reason {
  min-height: 72px;
  margin: 10px 0 8px;
}

.shot-delete {
  margin-top: 8px;
}

.kt-card:has(.shot-delete) {
  align-items: start;
}

.announce-log {
  margin-top: 16px;
}

.announce-log li span:last-child {
  white-space: pre-wrap;
}

button {
  cursor: pointer;
  border: 0;
  border-radius: var(--radius);
  background: var(--accent);
  color: #fff;
  font-weight: 600;
  padding: 10px 14px;
}

button:hover {
  background: #173f74;
}

button:active {
  transform: translateY(1px);
}

button.ghost {
  background: #fff;
  color: var(--ink);
  border: 1px solid #cfd6df;
}

button.ghost:hover {
  background: #f6f8fb;
  border-color: #b7c2cf;
}

button:disabled {
  opacity: 0.55;
  cursor: wait;
}

.full {
  width: 100%;
}

.hint {
  margin-top: 12px;
  color: var(--muted);
  font-size: 0.86rem;
  line-height: 1.45;
}

.error {
  color: var(--bad);
  margin: 0 0 12px;
  font-size: 0.92rem;
}

.shell {
  display: grid;
  grid-template-columns: 232px minmax(0, 1fr);
  min-height: 100vh;
  align-items: start;
}

.side {
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--side);
  color: var(--side-ink);
  padding: 18px 12px 12px;
}

.side .brand {
  padding: 4px 8px 16px;
  margin: 0;
}

.workspace {
  min-width: 0;
  padding: 22px 28px 48px;
}

.topbar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}

.topbar h1 {
  font-size: 1.45rem;
  letter-spacing: -0.02em;
}

.topbar p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 0.92rem;
}

.actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.menu {
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin: 0;
}

.menu button {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  text-align: left;
  background: transparent;
  color: var(--side-ink);
  border: 0;
  border-radius: 7px;
  padding: 9px 10px;
  font-weight: 500;
}

.menu button:hover {
  background: rgba(255, 255, 255, 0.06);
}

.menu button.active {
  background: #fff;
  color: var(--side);
}

.filters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 4px 0 16px;
}

.filters button {
  background: #fff;
  color: var(--ink);
  border: 1px solid var(--line);
}

.filters button:hover {
  background: #f6f8fb;
}

.filters button.active {
  background: var(--accent);
  color: #fff;
  border-color: transparent;
}

.menu .count,
.filters .count {
  margin-left: 8px;
  font-family: var(--mono);
  font-size: 0.72rem;
}

.menu .count {
  min-width: 1.4rem;
  text-align: center;
  padding: 2px 6px;
  border-radius: 99px;
  background: rgba(255, 255, 255, 0.12);
}

.menu button.active .count {
  background: #e7eef8;
  color: var(--accent);
}

.stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
}

button.stat {
  display: grid;
  gap: 2px;
  text-align: left;
  background: var(--card);
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 14px 16px 12px;
  box-shadow: var(--shadow);
}

button.stat:hover {
  background: #f8fafc;
  border-color: #c5d0dc;
}

button.stat strong {
  font-size: 1.7rem;
  font-weight: 600;
  line-height: 1.1;
  letter-spacing: -0.03em;
}

button.stat span {
  font-weight: 600;
  font-size: 0.92rem;
}

button.stat em {
  font-style: normal;
  color: var(--accent);
  font-size: 0.78rem;
  font-weight: 500;
}

.kt-list {
  display: grid;
  gap: 8px;
}

.kt-card,
.kt-row {
  display: grid;
  gap: 16px;
  align-items: center;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-left: 3px solid var(--warn);
  border-radius: 10px;
  background: #fff;
}

.kt-card {
  grid-template-columns: minmax(0, 1fr) auto;
}

.kt-row {
  grid-template-columns: auto minmax(0, 1fr) auto;
  width: 100%;
  cursor: pointer;
  color: inherit;
  text-align: left;
}

.kt-row:hover,
.kt-card:hover {
  border-color: #cfd6df;
}

.kt-card.approved,
.kt-row.approved {
  border-left-color: var(--ok);
}

.kt-card.rejected,
.kt-row.rejected,
.dispute-card.rejected {
  border-left-color: var(--bad);
}

.dispute-card {
  cursor: pointer;
}

.dispute-card.approved {
  border-left-color: var(--ok);
}

.dispute-detail {
  grid-column: 1 / -1;
  display: grid;
  gap: 6px;
  margin-top: 4px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}

.dispute-detail p {
  margin: 0;
  white-space: pre-wrap;
  line-height: 1.45;
  font-size: 0.9rem;
}

.dispute-receipt {
  display: block;
  width: min(100%, 420px);
  max-height: 520px;
  object-fit: contain;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #f4f6f8;
}

.dispute-link {
  color: var(--accent);
  font-size: 0.9rem;
}

.dispute-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 4px;
}

.dispute-label {
  margin: 8px 0 0;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--muted);
}

textarea.dispute-karar {
  min-height: 88px;
  margin: 6px 0 0;
}

.kt-top {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 6px;
}

.kt-name {
  font-size: 1rem;
  font-weight: 600;
}

.kt-sub,
.kt-time,
.kt-note,
.kt-no {
  color: var(--muted);
  font-size: 0.84rem;
  margin-top: 3px;
}

.kt-no {
  margin-top: 0;
  font-family: var(--mono);
  font-size: 0.75rem;
}

.kt-side {
  display: grid;
  justify-items: end;
  gap: 8px;
}

.kt-amount {
  font-size: 1.15rem;
  font-weight: 600;
  letter-spacing: -0.02em;
  white-space: nowrap;
}

.grid {
  display: grid;
  grid-template-columns: 1.3fr 0.9fr;
  gap: 12px;
}

.panel {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--card);
  padding: 18px 18px 16px;
  box-shadow: var(--shadow);
}

.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.panel-head h2 {
  font-size: 1.02rem;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 4px 8px;
  border-radius: 99px;
  background: #f2f4f7;
  color: var(--muted);
}

.badge::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
}

.badge.ok {
  color: var(--ok);
  background: #e8f6ee;
}

.badge.warn {
  color: var(--warn);
  background: #fbf3e4;
}

.badge.bad {
  color: var(--bad);
  background: #fdeceb;
}

.meta {
  display: grid;
  gap: 10px;
}

.row {
  display: grid;
  grid-template-columns: 120px 1fr;
  gap: 10px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--line);
}

.row:last-child {
  border-bottom: 0;
  padding-bottom: 0;
}

.row dt {
  color: var(--muted);
  font-size: 0.84rem;
}

.row dd {
  margin: 0;
  font-family: var(--mono);
  font-size: 0.88rem;
  word-break: break-all;
}

.iban-big {
  margin-top: 8px;
  padding: 14px;
  background: #f4f7fb;
  border: 1px solid #d5e0ee;
  border-radius: 8px;
  font-family: var(--mono);
  font-size: 1rem;
  letter-spacing: 0.03em;
}

.wait-box {
  padding: 16px;
  border: 1px solid #ead7b2;
  border-radius: 8px;
  background: #fbf6ec;
}

.wait-box h3 {
  margin-bottom: 6px;
  color: var(--warn);
  font-size: 1rem;
}

.wait-box p {
  margin: 0;
  color: var(--muted);
  line-height: 1.5;
}

.status-list {
  display: grid;
  gap: 8px;
}

.status-item {
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fafc;
}

.status-item .label {
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 4px;
}

.status-item .value {
  font-family: var(--mono);
  font-size: 0.9rem;
}

.side-stack {
  display: grid;
  gap: 12px;
}

.logs {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 8px;
}

.logs li {
  display: grid;
  grid-template-columns: 72px 1fr;
  gap: 10px;
  font-size: 0.88rem;
  color: var(--muted);
}

.logs .lvl {
  font-family: var(--mono);
  text-transform: uppercase;
  font-size: 0.72rem;
  letter-spacing: 0.04em;
}

.logs .lvl.ok {
  color: var(--ok);
}
.logs .lvl.error {
  color: var(--bad);
}
.logs .lvl.warn {
  color: var(--warn);
}
.logs .lvl.info {
  color: var(--accent);
}

.password-box {
  display: grid;
  gap: 8px;
  margin-top: 8px;
}

.password-box input {
  margin-bottom: 0;
}

.stack {
  display: grid;
  gap: 12px;
}

.people {
  display: grid;
  gap: 8px;
}

.person {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 14px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #f8fafc;
}

.person .who {
  font-weight: 600;
}

.person .sub {
  margin-top: 3px;
  color: var(--muted);
  font-size: 0.84rem;
}

.person .addr {
  margin-top: 6px;
  font-family: var(--mono);
  font-size: 0.8rem;
  word-break: break-all;
  color: var(--ink);
}

.kasa-tools {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  justify-content: flex-end;
}

.kasa-tools input.amount {
  width: 132px;
  margin: 0;
  padding: 8px 10px;
}

.btns {
  display: flex;
  gap: 8px;
  flex-shrink: 0;
}

button.small {
  padding: 7px 11px;
  font-size: 0.84rem;
}

button.danger {
  background: #fff;
  color: var(--bad);
  border: 1px solid #f0c7c3;
}

button.danger:hover {
  background: #fdf4f3;
}

.toast {
  position: fixed;
  right: 18px;
  bottom: 18px;
  background: var(--side);
  color: #fff;
  border-radius: 8px;
  padding: 12px 14px;
  box-shadow: 0 10px 24px rgba(23, 38, 51, 0.2);
  opacity: 0;
  transform: translateY(8px);
  pointer-events: none;
  transition: 0.2s ease;
  z-index: 20;
}

.toast.show {
  opacity: 1;
  transform: translateY(0);
}

@media (max-width: 980px) {
  .shell {
    grid-template-columns: 1fr;
  }

  .side {
    position: sticky;
    top: 0;
    z-index: 5;
    height: auto;
    padding-bottom: 8px;
  }

  .side .brand {
    padding-bottom: 8px;
  }

  .menu {
    flex-direction: row;
    overflow-x: auto;
    gap: 4px;
  }

  .menu button {
    width: auto;
    white-space: nowrap;
  }

  .workspace {
    padding: 16px 14px 36px;
  }
}

@media (max-width: 860px) {
  .stats {
    grid-template-columns: 1fr 1fr;
  }

  .kt-card,
  .kt-row {
    grid-template-columns: 1fr;
  }

  .kt-row .kt-amount,
  .kt-side {
    justify-self: start;
  }

  .kt-side {
    justify-items: start;
  }

  .grid {
    grid-template-columns: 1fr;
  }

  .topbar {
    flex-direction: column;
  }

  .row {
    grid-template-columns: 1fr;
    gap: 4px;
  }

  .person {
    flex-direction: column;
    align-items: stretch;
  }
}
