:root {
  --bg: #070b14;
  --panel: #0f172a;
  --panel-soft: #111c33;
  --line: #26344f;
  --text: #e5edf9;
  --muted: #94a3b8;
  --brand: #38bdf8;
  --success: #22c55e;
  --danger: #ef4444;
  --warning: #facc15;
  --shadow: 0 18px 50px rgba(0, 0, 0, .35);
}

* {
  box-sizing: border-box;
}

html {
  font-size: 16px;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: Arial, Helvetica, sans-serif;
  background: radial-gradient(circle at top left, #10223f 0, #070b14 38%, #05070d 100%);
  color: var(--text);
}

a {
  color: inherit;
}

.top {
  position: sticky;
  top: 0;
  z-index: 20;
  min-height: 74px;
  padding: 12px 20px;
  background: rgba(7, 11, 20, .94);
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 13px;
  font-weight: 900;
}

.brand img {
  height: 46px;
  width: auto;
  max-width: 190px;
  display: block;
}

.brand-title {
  display: flex;
  flex-direction: column;
  line-height: 1.15;
  font-size: 18px;
}

.brand-title small {
  color: var(--muted);
  font-weight: 600;
  font-size: 12px;
}

.nav {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  align-items: center;
  justify-content: flex-end;
}

.wrap {
  width: 100%;
  max-width: 1560px;
  margin: 0 auto;
  padding: 24px;
}

.panel {
  background: rgba(15, 23, 42, .94);
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 20px;
  box-shadow: var(--shadow);
}

.panel h1,
.panel h2,
.panel h3 {
  margin-top: 0;
}

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
  gap: 16px;
}

.kpi {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 16px;
}

.card {
  display: block;
  min-height: 130px;
  padding: 20px;
  text-decoration: none;
  color: var(--text);
  background: linear-gradient(180deg, rgba(17, 28, 51, .98), rgba(15, 23, 42, .98));
  border: 1px solid var(--line);
  border-radius: 20px;
  box-shadow: var(--shadow);
  transition: .15s transform, .15s border-color;
}

.card:hover {
  transform: translateY(-2px);
  border-color: var(--brand);
}

.card h2 {
  margin: 0 0 8px;
  font-size: 28px;
}

.card p {
  color: var(--muted);
  margin: 6px 0;
}

.btn {
  display: inline-block;
  margin: 2px;
  padding: 10px 14px;
  border: 0;
  border-radius: 12px;
  text-decoration: none;
  font-weight: 800;
  cursor: pointer;
  color: #03130a;
  background: linear-gradient(135deg, var(--success), #16a34a);
}

.btn.gray {
  color: #dbeafe;
  background: #1e293b;
  border: 1px solid #334155;
}

.btn.blue {
  color: #062235;
  background: linear-gradient(135deg, #7dd3fc, var(--brand));
}

.btn.red {
  color: #fff;
  background: linear-gradient(135deg, #fb7185, var(--danger));
}

.btn.yellow {
  color: #422006;
  background: linear-gradient(135deg, #fde68a, var(--warning));
}

.row {
  display: flex;
  gap: 18px;
  align-items: flex-start;
}

.items {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(165px, 1fr));
  gap: 12px;
}

.items form {
  display: block;
}

.items button {
  width: 100%;
  min-height: 86px;
  text-align: left;
  border-radius: 16px;
}

.table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
}

.table th,
.table td {
  padding: 11px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

.table th {
  color: #bfdbfe;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: .07em;
}

input,
select,
textarea {
  max-width: 100%;
  padding: 11px;
  border-radius: 11px;
  border: 1px solid #334155;
  background: #08111f;
  color: var(--text);
  outline: none;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--brand);
}

.badge {
  display: inline-block;
  padding: 5px 9px;
  border-radius: 999px;
  color: #93c5fd;
  background: #0b2a42;
  border: 1px solid #1e40af;
  font-size: 12px;
  font-weight: 800;
}

.muted { color: var(--muted); }
.danger { color: #f87171; }
.ok { color: #22c55e; }
.warn { color: #facc15; }

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

.login-card {
  width: 100%;
  max-width: 420px;
  text-align: center;
}

.login-logo,
.receipt-logo {
  display: block;
  width: auto;
  max-width: 220px;
  max-height: 110px;
  margin: 0 auto 18px;
}

pre {
  white-space: pre-wrap;
  background: #07111f;
  padding: 12px;
  border-radius: 12px;
}

@media (max-width: 900px) {
  .top {
    position: relative;
    flex-direction: column;
    align-items: flex-start;
  }

  .nav {
    justify-content: flex-start;
  }

  .wrap {
    padding: 14px;
  }

  .row {
    flex-direction: column;
  }

  .panel {
    width: 100%;
  }

  .items {
    grid-template-columns: repeat(auto-fill, minmax(135px, 1fr));
  }
}

@media print {
  body {
    background: #fff;
    color: #000;
  }

  .top,
  .btn {
    display: none !important;
  }

  .panel {
    box-shadow: none;
    border: 0;
    color: #000;
  }

  .wrap {
    padding: 0;
  }

  .table td,
  .table th {
    border-bottom: 1px solid #ddd;
    color: #000;
  }
}
