:root{
  --bg1:#f5f7ff;
  --bg2:#f8fbff;
  --card:#ffffff;
  --stroke:#e7ecf5;
  --shadow: 0 16px 40px rgba(16, 24, 40, 0.07);
  --shadow2: 0 10px 24px rgba(16, 24, 40, 0.06);
  --radius: 18px;
}

*{
  font-family: Inter, system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
}

html{
  -webkit-text-size-adjust: 100%;
  text-rendering: optimizeLegibility;
}

body{
  background:
    radial-gradient(1200px 700px at 10% 0%, var(--bg1), transparent 70%),
    radial-gradient(900px 600px at 90% 10%, #eaf7ff, transparent 70%),
    linear-gradient(180deg, var(--bg2), #ffffff);
  min-height: 100vh;
}

.material-symbols-rounded{
  font-variation-settings: "FILL" 0, "wght" 560, "GRAD" 0, "opsz" 24;
}

.icon{
  font-size: 20px;
  vertical-align: -4px;
}

.hero{
  border: 1px solid var(--stroke);
  border-radius: var(--radius);
  padding: 18px;
  background: linear-gradient(180deg, #ffffffdd, #ffffffb8);
  box-shadow: var(--shadow2);
  backdrop-filter: blur(10px);
}

.hero-title{
  font-weight: 800;
  letter-spacing: -0.02em;
}

.hero-sub{
  font-size: .95rem;
}

.auth-shell{
  display: grid;
  grid-template-columns: minmax(320px, 1.1fr) minmax(280px, .9fr);
  gap: 24px;
  align-items: stretch;
}

.auth-panel{
  border-radius: 24px;
  padding: 32px;
  background: linear-gradient(180deg, #ffffff, #f7faff);
  border: 1px solid var(--stroke);
}

.auth-badge{
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid var(--stroke);
  background: #fff;
  font-weight: 600;
  margin-bottom: 14px;
}

.auth-form .form-control{
  height: 46px;
}

.code-input{
  font-size: 1.4rem;
  letter-spacing: 0.3em;
  text-align: center;
  font-weight: 700;
}

.auth-actions{
  display: flex;
  gap: 12px;
  align-items: center;
}

.auth-aside{
  display: grid;
  align-items: center;
}

.auth-card{
  background: #0f172a;
  color: #f8fafc;
  border-radius: 24px;
  padding: 32px;
  box-shadow: 0 24px 50px rgba(15, 23, 42, 0.28);
  display: grid;
  gap: 14px;
}

.auth-card h2{
  margin: 0;
  font-weight: 700;
}

.auth-aside-icon{
  width: 52px;
  height: 52px;
  border-radius: 16px;
  background: rgba(255,255,255,0.12);
  display: grid;
  place-items: center;
}

.auth-aside-icon .material-symbols-rounded{
  font-size: 28px;
}

.auth-meta{
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-radius: 999px;
  background: rgba(255,255,255,0.12);
  font-size: .9rem;
}

@media (max-width: 992px){
  .auth-shell{
    grid-template-columns: 1fr;
  }
}

.admin-summary{
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 18px;
  margin-bottom: 14px;
}

.admin-progress{
  margin-bottom: 10px;
}

.admin-meta{
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-radius: 999px;
  background: #ffffff;
  border: 1px solid var(--stroke);
  font-size: .9rem;
}

.admin-chart{
  width: 100%;
  height: 200px;
  background: #f8fbff;
  border: 1px solid var(--stroke);
  border-radius: 16px;
  padding: 8px;
  margin-bottom: 10px;
}

.admin-chart svg{
  width: 100%;
  height: 100%;
}

.admin-chart-legend{
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  color: #6b7280;
  font-size: .9rem;
}

.admin-period{
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

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

.admin-stat{
  padding: 14px 16px;
  border-radius: 16px;
  background: #ffffff;
  border: 1px solid var(--stroke);
  min-width: 0;
}

.admin-stat .metric-value{
  font-size: clamp(1rem, 1.5vw, 1.35rem);
  white-space: nowrap;
}

.admin-histogram{
  display: grid;
  gap: 10px;
}

.admin-bar{
  display: grid;
  grid-template-columns: 90px 1fr 40px;
  align-items: center;
  gap: 10px;
  font-size: .9rem;
}

.admin-bar-track{
  height: 10px;
  background: #eef2ff;
  border-radius: 999px;
  overflow: hidden;
}

.admin-bar-fill{
  height: 100%;
  background: linear-gradient(90deg, #4f8ef7, #7cb3ff);
  border-radius: 999px;
}

.admin-bar-value{
  text-align: right;
  color: #6b7280;
}

.admin-weekdays{
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 12px;
}

.admin-chip{
  padding: 12px;
  border-radius: 14px;
  background: #ffffff;
  border: 1px solid var(--stroke);
  display: grid;
  gap: 6px;
}

.admin-chip span{
  color: #6b7280;
  font-size: .85rem;
}

.admin-chip strong{
  font-size: 1rem;
}

.admin-chip em{
  font-style: normal;
  color: #9aa4b2;
  font-size: .8rem;
}

.admin-anomalies{
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.admin-anomaly{
  padding: 8px 12px;
  border-radius: 999px;
  background: #fff1f1;
  border: 1px solid #ffd4d4;
  color: #c24141;
  display: inline-flex;
  gap: 8px;
  align-items: center;
  font-size: .9rem;
}

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

.admin-wide{
  grid-column: span 2;
}

.admin-chart-card{
  grid-column: span 1;
}

.admin-anomaly-card{
  grid-column: span 1;
}

@media (max-width: 992px){
  .admin-grid{
    grid-template-columns: 1fr;
  }
  .admin-wide{
    grid-column: span 1;
  }
  .admin-chart-card,
  .admin-anomaly-card{
    grid-column: span 1;
  }
}

.hero-chips{
  display:flex;
  gap:10px;
  flex-wrap: wrap;
}

.badge-soft{
  display:inline-flex;
  align-items:center;
  gap:8px;
  padding: 8px 10px;
  border-radius: 999px;
  border: 1px solid var(--stroke);
  background: #ffffff;
  color: #334155;
  font-weight: 600;
  font-size: .85rem;
}

.glass{
  border: 1px solid var(--stroke);
  border-radius: var(--radius);
  background: var(--card);
  backdrop-filter: blur(12px);
}

.shadow-soft{
  box-shadow: var(--shadow);
}

.card-anim{
  animation: pop .45s ease both;
}

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

.tile{
  border: 1px solid var(--stroke);
  border-radius: 16px;
  padding: 14px;
  background: #fff;
  box-shadow: 0 8px 24px rgba(16, 24, 40, 0.06);
  position: relative;
}

.shadow-inset{
  background: linear-gradient(180deg, #ffffff, #fbfcff);
}

.tile-head{
  display:flex;
  align-items:center;
  gap:10px;
  font-weight: 700;
  color: #1f2a37;
  margin-bottom: 10px;
}

.tile-head-row{
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.metrics{
  display:flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 14px;
}

.metric{
  flex: 1 1 0;
  min-width: 0;
}

.metric-left{
  text-align: left;
}

.metric-right{
  text-align: right;
}

.metric-right .metric-label{
  justify-content: flex-end;
}

.metric-label{
  display:flex;
  align-items:center;
  gap:8px;
  color: #6b7280;
  font-size: .85rem;
}

.metric-value{
  font-size: 1.55rem;
  font-weight: 800;
  letter-spacing: -0.01em;
  line-height: 1.15;
  white-space: nowrap;
  margin-top: 6px;
}

@media (max-width: 768px){
  .metrics{
    flex-direction: column;
    gap: 12px;
  }

  .metric-right{
    text-align: left;
  }

  .metric-right .metric-label{
    justify-content: flex-start;
  }

  .metric-value{
    font-size: clamp(1.2rem, 6vw, 1.55rem);
  }
}

.progress-soft{
  border-radius: 999px;
  overflow: hidden;
  background: #e0e7ff;
}

.progress-bar-anim{
  transition: width .8s cubic-bezier(.2,.9,.2,1);
}

.percent-big{
  font-weight: 800;
  font-size: 1.2rem;
  color: #1f2a37;
}

.trust-pill{
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-radius: 999px;
  background: #fff;
  border: 1px solid var(--stroke);
  font-size: .85rem;
  font-weight: 600;
  color: #1f2a37;
}

.table-wrap{
  border: 1px solid var(--stroke);
  border-radius: 14px;
  overflow: hidden;
  background: #fff;
}

.table thead th{
  background: #f7f9ff;
  border-bottom: 1px solid var(--stroke);
  font-weight: 700;
}

.table tbody tr:hover{
  background: #fbfdff;
}

.pay-pre{
  white-space: pre-wrap;
  word-break: break-word;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas,
               "Liberation Mono", "Courier New", monospace;
  font-size: 0.9rem;
  margin: 0;
  color: #111827;
}

.qr-wrap{
  border-radius: 14px;
  padding: 12px;
  border: 1px dashed #d8e0f0;
  background: linear-gradient(180deg, #ffffff, #f7fbff);
}

.qr-img{
  max-height: 240px;
  border-radius: 12px;
}

.btn, .btn-lg{
  border-radius: 14px;
}

.btn-glow{
  box-shadow: 0 10px 26px rgba(59, 130, 246, 0.25);
  transition: transform .08s ease, box-shadow .2s ease;
}

.btn-glow:hover{
  transform: translateY(-1px);
  box-shadow: 0 14px 34px rgba(59, 130, 246, 0.30);
}

.btn-glow:active{
  transform: translateY(0px) scale(.99);
}

.btn-action{
  height: 48px;
  padding: 0 16px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  font-weight: 700;
  letter-spacing: -0.01em;
  border-radius: 14px;
}

.btn-copy{
  height: 38px;
  padding: 0 16px;
  border-radius: 10px;
  text-decoration: none !important;
  color: #1f2a37;
  border: 1px solid #d7deea;
  background: #fff;
  box-shadow: 0 4px 10px rgba(16, 24, 40, 0.08);
  transition: transform .08s ease, box-shadow .2s ease, border-color .2s ease;
  font-size: .9rem;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.btn-copy:hover{
  color: #111827;
  transform: translateY(-1px);
  border-color: #b9c7e6;
  box-shadow: 0 10px 18px rgba(16, 24, 40, 0.12);
}

.btn-copy:active{
  transform: translateY(0);
}

.btn-copy-accent{
  background: #1f6feb;
  border-color: #1f6feb;
  color: #fff;
  box-shadow: 0 10px 22px rgba(31, 111, 235, 0.28);
}

.btn-copy-accent:hover{
  color: #fff;
  background: #195fd0;
  border-color: #195fd0;
}

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

.actions-bottom{
  margin-top: 14px;
  justify-content: flex-start;
}

@media (max-width: 768px){
  .actions-bar{
    justify-content: flex-start;
  }
}

.hint{
  display:flex;
  align-items:flex-start;
  gap:10px;
  padding: 10px 12px;
  border-radius: 14px;
  border: 1px solid #e8eefb;
  background: #f7fbff;
  color: #475569;
  font-size: .9rem;
}

.alert-soft{
  display:flex;
  gap:10px;
  align-items:flex-start;
  border-radius: 14px;
  border: 1px solid #fde7b3;
  background: #fff7df;
  color: #7a4b00;
}

.skeleton{
  position: relative;
  color: transparent !important;
  border-radius: 10px;
  background: linear-gradient(90deg, #eef2ff, #f6f7ff, #eef2ff);
  background-size: 200% 100%;
  animation: shimmer 1.1s infinite linear;
}

@keyframes shimmer{
  0%{ background-position: 200% 0; }
  100%{ background-position: -200% 0; }
}

.copy-toast{
  position: fixed;
  left: 50%;
  top: 14px;
  transform: translateX(-50%) translateY(-14px);
  opacity: 0;

  padding: 12px 18px;
  border-radius: 999px;

  display: inline-flex;
  align-items: center;
  gap: 10px;

  font-weight: 800;
  font-size: .92rem;

  min-width: 260px;
  max-width: calc(100vw - 32px);
  justify-content: center;
  text-align: center;

  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;

  box-shadow: 0 18px 40px rgba(0,0,0,.18);
  pointer-events: none;
  z-index: 2000;

  background: rgba(17,24,39,.92);
  color: #fff;
  border: 1px solid rgba(255,255,255,.10);

  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.copy-toast .icon{
  font-size: 20px;
  vertical-align: -3px;
}

.copy-toast.is-success{
  background: rgba(16,185,129,.92);
  border-color: rgba(255,255,255,.18);
}

.copy-toast.is-warning{
  background: rgba(245,158,11,.92);
  border-color: rgba(255,255,255,.18);
}

.copy-toast.is-error{
  background: rgba(239,68,68,.92);
  border-color: rgba(255,255,255,.18);
}

.copy-toast.show{
  animation: toastIn .22s cubic-bezier(.2,.9,.2,1) forwards,
             toastOut .26s ease-in forwards;
  animation-delay: 0s, var(--toast-hide-delay, 1.25s);
}

@keyframes toastIn{
  from { opacity: 0; transform: translateX(-50%) translateY(-14px); }
  to   { opacity: 1; transform: translateX(-50%) translateY(0); }
}

@keyframes toastOut{
  to { opacity: 0; transform: translateX(-50%) translateY(-10px); }
}

@media (max-width: 768px){
  .hero{ padding: 14px; }

  .hero-title{
    font-size: 1.9rem;
    line-height: 1.1;
  }

  .hero-chips{
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 4px;
  }

  .hero-chips .badge-soft{
    white-space: nowrap;
  }

  .card-body{
    padding: 16px !important;
  }

  .tile{
    padding: 12px;
  }

  .sticky-pay{
    position: fixed;
    left: 14px;
    right: 14px;
    bottom: 14px;
    z-index: 1200;

    border-radius: 18px;
    padding: 6px;
    background: rgba(255,255,255,.55);
    backdrop-filter: blur(20px);

    filter: drop-shadow(0 16px 26px rgba(16,24,40,.18));
  }

  .sticky-pay .btn{
    border-radius: 16px;
  }

  body{
    padding-bottom: 84px;
  }
}

.payments-table{
  transition: opacity .18s ease, transform .18s ease;
  will-change: opacity, transform;
}

.payments-table.is-loading{
  opacity: 0;
  transform: translateY(6px);
}

@media (prefers-reduced-motion: reduce){
  .payments-table{ transition: none; }
  .card-anim{ animation: none; }
  .progress-bar-anim{ transition: none; }
}

.segmented{
  display: inline-flex;
  gap: 6px;
  padding: 6px;
  border-radius: 14px;
  background: rgba(255,255,255,.6);
  border: 1px solid rgba(0,0,0,.06);
}

.seg-btn{
  border: 0;
  padding: 8px 12px;
  border-radius: 12px;
  background: transparent;
  font-weight: 600;
  cursor: pointer;
}

.seg-btn.is-active{
  background: #0B5AA7;
  color: #fff;
  box-shadow: 0 6px 16px rgba(11,90,167,.25);
}

.seg-btn:focus-visible{
  outline: 3px solid rgba(11,90,167,.35);
  outline-offset: 2px;
}
