
@import url("https://fonts.googleapis.com/css2?family=Cairo:wght@400;500;600;700;800;900&display=swap");

:root {
  font-family: Cairo, system-ui, sans-serif;
  color: #121212;
  background: #f5f5f5;
  --ink: #101010;
  --muted: #797979;
  --line: #e8e8e8;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100dvh;
  background: radial-gradient(
    circle at 10% 0%,
    #fff 0%,
    #f5f5f5 52%,
    #ededed 100%
  );
}

button,
input,
select {
  font: inherit;
}

button {
  cursor: pointer;
}

button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.hidden {
  display: none !important;
}

.auth {
  min-height: 100dvh;
  display: grid;
  place-items: center;
  padding: 24px;
}

.auth-card {
  width: min(100%, 430px);
  padding: 35px 26px;
}

.glass {
  background: linear-gradient(
    140deg,
    rgba(255, 255, 255, 0.98),
    rgba(255, 255, 255, 0.78) 52%,
    rgba(239, 239, 239, 0.76)
  );
  border: 1px solid rgba(255, 255, 255, 0.95);
  box-shadow:
    0 15px 60px rgba(0, 0, 0, 0.07),
    inset 0 1px 0 #fff;
  border-radius: 28px;
}

.mark {
  width: 52px;
  height: 52px;
  display: grid;
  place-items: center;
  border-radius: 17px;
  background: #111;
  color: #fff;
  font-size: 30px;
  box-shadow:
    inset 0 2px 4px #555,
    0 8px 20px #bbb;
}

.eyebrow {
  font-size: 11px;
  letter-spacing: 0.06em;
  font-weight: 800;
  color: #888;
}

.auth h1 {
  font-size: 44px;
  line-height: 1.25;
  margin: 10px 0;
}

.auth h1 span {
  color: #999;
}

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

form {
  display: grid;
  gap: 14px;
  margin-top: 28px;
}

label {
  font-size: 12px;
  font-weight: 800;
  display: grid;
  gap: 6px;
}

input,
select {
  width: 100%;
  background: #fafafa;
  border: 1px solid #dedede;
  border-radius: 13px;
  padding: 12px 14px;
  outline: none;
  color: #111;
  min-height: 45px;
}

input:focus,
select:focus {
  border-color: #111;
  box-shadow: 0 0 0 3px #1111;
}

.primary {
  background: linear-gradient(145deg, #2c2c2c, #050505);
  color: #fff;
  border: 1px solid #222;
  box-shadow:
    inset 0 1px 0 #777,
    0 7px 14px #0002;
  border-radius: 14px;
  min-height: 48px;
  padding: 10px 18px;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.secondary {
  background: #fff;
  color: #111;
  border: 1px solid #dedede;
  border-radius: 12px;
  padding: 10px 14px;
  font-weight: 800;
}

.danger {
  color: #a22;
}

.error {
  color: #a22;
  font-size: 12px;
  min-height: 16px;
}

.topbar {
  max-width: 780px;
  margin: auto;
  padding: 27px 20px 10px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.topbar h2 {
  font-size: 21px;
  margin: 3px 0;
}

.icon-btn {
  background: white;
  border: 1px solid #e4e4e4;
  border-radius: 13px;
  width: 43px;
  height: 43px;
  font-size: 22px;
}

.view {
  max-width: 780px;
  margin: auto;
  padding: 12px 18px 115px;
  animation: enter 0.28s ease both;
}

@keyframes enter {
  from {
    opacity: 0;
    transform: translateY(9px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.card {
  border-radius: 23px;
  padding: 20px;
  margin-bottom: 14px;
  background: linear-gradient(130deg, #fff, #fafafa 65%, #f0f0f0);
  border: 1px solid #fff;
  box-shadow:
    0 6px 25px #0000000b,
    inset 0 1px 0 white;
}

.hero {
  background: linear-gradient(135deg, #242424, #070707 70%, #343434);
  color: white;
  position: relative;
  overflow: hidden;
  padding: 25px;
}

.hero:before {
  content: "";
  position: absolute;
  width: 230px;
  height: 230px;
  left: -110px;
  top: -160px;
  background: #ffffff22;
  filter: blur(38px);
  border-radius: 50%;
}

.hero .muted {
  color: #aaa;
}

.big-number {
  font-size: 60px;
  line-height: 1.3;
  font-weight: 900;
  letter-spacing: -2px;
}

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

.section-title {
  font-size: 16px;
  margin: 22px 3px 12px;
}

.tiny {
  font-size: 11px;
  color: #777;
}

.item {
  padding: 13px 0;
  border-bottom: 1px solid var(--line);
}

.item:last-child {
  border-bottom: 0;
}

.pill {
  border-radius: 30px;
  background: #f0f0f0;
  padding: 5px 10px;
  font-size: 11px;
  font-weight: 800;
}

.question {
  margin-bottom: 12px;
}

.question h3 {
  font-size: 14px;
  margin: 0 0 13px;
}

.choices {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.choice {
  border: 1px solid #e5e5e5;
  border-radius: 13px;
  background: #f7f7f7;
  color: #222;
  padding: 10px 15px;
  font-weight: 700;
  min-width: 75px;
}

.choice.selected {
  background: #111;
  color: #fff;
  border-color: #111;
  box-shadow: inset 0 1px 0 #777;
}

.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  max-width: 780px;
  margin: auto;
  display: flex;
  justify-content: space-around;
  padding: 10px 10px calc(10px + env(safe-area-inset-bottom));
  background: rgba(255, 255, 255, 0.87);
  backdrop-filter: blur(22px);
  -webkit-backdrop-filter: blur(22px);
  border: 1px solid #fff;
  border-top-left-radius: 23px;
  border-top-right-radius: 23px;
  box-shadow: 0 -7px 30px #00000010;
  z-index: 10;
}

.nav-btn {
  border: 0;
  background: transparent;
  color: #888;
  min-width: 70px;
  display: grid;
  justify-items: center;
  gap: 2px;
  font-size: 10px;
  font-weight: 800;
}

.nav-btn .symbol {
  font-size: 21px;
}

.nav-btn.active {
  color: #080808;
}

.nav-btn.active .symbol {
  background: #111;
  color: white;
  padding: 2px 13px;
  border-radius: 12px;
}

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

.stat {
  text-align: center;
  padding: 18px 8px;
}

.stat strong {
  font-size: 25px;
  display: block;
}

.stack {
  display: grid;
  gap: 10px;
}

.toolbar {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: end;
}

.toolbar > * {
  flex: 1;
}

.toolbar button {
  flex: 0 0 auto;
}

.table-wrap {
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
  min-width: 450px;
}

td,
th {
  padding: 11px;
  text-align: right;
  border-bottom: 1px solid #eee;
}

th {
  background: #f6f6f6;
}

#toast {
  position: fixed;
  top: 15px;
  left: 50%;
  transform: translateX(-50%);
  background: #111;
  color: #fff;
  padding: 10px 20px;
  border-radius: 12px;
  z-index: 50;
  display: none;
  font-size: 12px;
  max-width: 90vw;
}

.empty {
  text-align: center;
  padding: 28px 8px;
  color: #888;
}

.full {
  width: 100%;
}

.space {
  height: 8px;
}

@media (min-width: 700px) {
  .auth-card {
    padding: 45px;
  }

  .view {
    padding-top: 22px;
  }

  .card {
    padding: 25px;
  }

  .topbar {
    padding-top: 36px;
  }
}

@media print {
  body {
    background: #fff !important;
  }

  .topbar,
  .bottom-nav,
  .no-print {
    display: none !important;
  }

  .view {
    padding: 0;
    max-width: none;
  }

  .card {
    box-shadow: none;
    border: 1px solid #ddd;
  }

  .print-only {
    display: block !important;
  }

  table {
    min-width: 0;
  }

  thead {
    display: table-header-group;
  }
}

.print-only {
  display: none;
}

.password-wrap {
  position: relative;
  display: block;
}

.password-wrap input {
  padding-left: 55px;
}

.eye-toggle {
  position: absolute;
  left: 7px;
  top: 5px;
  border: 0;
  background: #ececec;
  border-radius: 10px;
  padding: 7px 11px;
  font-size: 17px;
  color: #222;
}

.qr-panel {
  text-align: center;
}

.qr-frame {
  display: inline-flex;
  background: white;
  padding: 16px;
  border: 1px solid #ddd;
  border-radius: 20px;
  margin: 14px auto;
}

.qr-frame canvas {
  max-width: 100%;
  height: auto;
}

.offline-tag {
  font-size: 12px;
  color: #555;
}

.scanner-box {
  width: 100%;
  overflow: hidden;
  border-radius: 16px;
}

.scanner-box video {
  max-width: 100%;
}

.breakdown-row {
  display: flex;
  justify-content: space-between;
  padding: 11px 0;
  border-bottom: 1px solid #e8e8e8;
}

.breakdown-row:last-child {
  border: 0;
}

.hint {
  font-size: 12px;
  color: #777;
}

.pending-count {
  font-weight: 800;
}

.soft-button {
  width: 100%;
  margin-top: 8px;
}

.primary,
.secondary,
.nav-btn,
.choice,
.card {
  transition:
    transform 0.2s ease,
    box-shadow 0.2s ease,
    background 0.2s ease;
}

.primary:active,
.secondary:active,
.nav-btn:active,
.choice:active {
  transform: scale(0.97);
}

/* ==========================================
   PLUS / MINUS GLASS BUTTONS
   ========================================== */

.points-action-buttons {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.points-action {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  min-height: 66px;
  width: 100%;
  padding: 12px 16px;
  border-radius: 17px;
  color: #fff;
  font-size: 17px;
  font-weight: 900;
  letter-spacing: 0.02em;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 9px;
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  transition:
    transform 0.2s ease,
    box-shadow 0.2s ease,
    filter 0.2s ease,
    border-color 0.2s ease;
}

.points-action::before {
  content: "";
  position: absolute;
  z-index: -1;
  top: -60%;
  left: -25%;
  width: 85%;
  height: 130%;
  transform: rotate(-25deg);
  background: rgba(255, 255, 255, 0.14);
  filter: blur(16px);
  pointer-events: none;
}

.points-action.plus {
  background: linear-gradient(
    135deg,
    rgba(29, 180, 93, 0.84),
    rgba(10, 105, 55, 0.92)
  );
  border: 2px solid #16a34a;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.46),
    0 7px 18px rgba(22, 163, 74, 0.16);
}

.points-action.minus {
  background: linear-gradient(
    135deg,
    rgba(242, 73, 73, 0.84),
    rgba(158, 24, 38, 0.92)
  );
  border: 2px solid #dc2626;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.46),
    0 7px 18px rgba(220, 38, 38, 0.16);
}

.points-action:not(.selected) {
  filter: saturate(0.8);
  opacity: 0.78;
}

.points-action.selected.plus {
  border-color: #087c3c;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.6),
    0 0 0 3px rgba(22, 163, 74, 0.18),
    0 10px 26px rgba(22, 163, 74, 0.28);
}

.points-action.selected.minus {
  border-color: #a91b27;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.6),
    0 0 0 3px rgba(220, 38, 38, 0.18),
    0 10px 26px rgba(220, 38, 38, 0.28);
}

.points-action:focus-visible {
  outline: 3px solid #111;
  outline-offset: 3px;
}

.points-action:active {
  transform: scale(0.97);
}

.points-action .action-symbol {
  font-size: 25px;
  line-height: 1;
  font-weight: 900;
}

@media (prefers-reduced-motion: reduce) {
  * {
    animation: none !important;
    transition: none !important;
  }
}
