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

:root {
  --bg: #eef3fb;
  --card: rgba(255,255,255,0.88);
  --text: #111827;
  --muted: #64748b;
  --line: rgba(148, 163, 184, 0.28);
  --primary: #2563eb;
  --danger: #ef4444;
  --shadow: 0 24px 70px rgba(15, 23, 42, 0.12);
  --shadow-soft: 0 12px 34px rgba(15, 23, 42, 0.08);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  font-family: 'Inter', Arial, sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at top left, rgba(37, 99, 235, 0.18), transparent 32%),
    radial-gradient(circle at top right, rgba(168, 85, 247, 0.15), transparent 28%),
    linear-gradient(180deg, #f8fbff 0%, var(--bg) 100%);
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(15, 23, 42, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(15, 23, 42, 0.035) 1px, transparent 1px);
  background-size: 38px 38px;
  mask-image: linear-gradient(to bottom, black, transparent 75%);
}

.app {
  position: relative;
  max-width: 1120px;
  margin: 0 auto;
  padding: 34px 22px 52px;
}

.hero {
  position: relative;
  overflow: hidden;
  display: flex;
  justify-content: space-between;
  gap: 24px;
  align-items: center;
  color: white;
  padding: 34px;
  border-radius: 34px;
  margin-bottom: 22px;
  background:
    radial-gradient(circle at 78% 15%, rgba(96, 165, 250, 0.35), transparent 28%),
    radial-gradient(circle at 18% 10%, rgba(196, 181, 253, 0.23), transparent 32%),
    linear-gradient(135deg, #020617 0%, #111827 42%, #1e3a8a 100%);
  box-shadow: var(--shadow);
}

.hero::after {
  content: "";
  position: absolute;
  right: -80px;
  top: -90px;
  width: 260px;
  height: 260px;
  border-radius: 999px;
  background: rgba(255,255,255,0.10);
  border: 1px solid rgba(255,255,255,0.16);
}

.hero > * { position: relative; z-index: 1; }

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 12px;
  padding: 8px 12px;
  border: 1px solid rgba(255,255,255,0.18);
  border-radius: 999px;
  color: #bfdbfe;
  background: rgba(255,255,255,0.08);
  text-transform: uppercase;
  letter-spacing: 1.5px;
  font-size: 11px;
  font-weight: 900;
}

.eyebrow::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: #22c55e;
  box-shadow: 0 0 0 6px rgba(34, 197, 94, 0.14);
}

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

h1 {
  margin-bottom: 8px;
  font-size: clamp(34px, 5vw, 54px);
  line-height: 0.96;
  letter-spacing: -2.4px;
}

h2 {
  margin-bottom: 5px;
  font-size: 23px;
  letter-spacing: -0.6px;
}

h3 {
  margin: 28px 0 12px;
  font-size: 16px;
  letter-spacing: -0.2px;
}

.muted { color: var(--muted); }

.hero .muted {
  max-width: 560px;
  margin-bottom: 0;
  color: #dbeafe;
  font-size: 16px;
}

.card {
  position: relative;
  overflow: hidden;
  background: var(--card);
  backdrop-filter: blur(18px);
  border: 1px solid rgba(255,255,255,0.68);
  border-radius: 28px;
  padding: 28px;
  margin-bottom: 22px;
  box-shadow: var(--shadow-soft);
}

.card::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 5px;
  background: linear-gradient(90deg, #2563eb, #7c3aed, #06b6d4);
}

.section-title {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: flex-start;
  margin-bottom: 18px;
}

.section-title p { margin-bottom: 0; }

.badge {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 9px 12px;
  border-radius: 999px;
  background: #ecfdf5;
  color: #047857;
  font-size: 12px;
  font-weight: 900;
  border: 1px solid rgba(16,185,129,0.18);
}

.dark-badge {
  background: #eff6ff;
  color: #1d4ed8;
  border-color: rgba(37,99,235,0.18);
}

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

label {
  display: block;
  margin-top: 15px;
  margin-bottom: 8px;
  color: #334155;
  font-size: 13px;
  font-weight: 900;
}

input {
  width: 100%;
  padding: 15px 16px;
  border: 1px solid #dbe3ef;
  border-radius: 14px;
  background: rgba(255,255,255,0.95);
  color: var(--text);
  font-size: 15px;
  font-family: inherit;
  outline: none;
  transition: 0.18s ease;
}

input:focus {
  border-color: rgba(37,99,235,0.75);
  box-shadow: 0 0 0 4px rgba(37,99,235,0.11);
}

button {
  border: none;
  border-radius: 15px;
  padding: 14px 20px;
  font-size: 14px;
  font-weight: 900;
  font-family: inherit;
  cursor: pointer;
  background: linear-gradient(135deg, #2563eb, #3b82f6);
  color: white;
  box-shadow: 0 12px 24px rgba(37,99,235,0.24);
  transition: transform 0.16s ease, box-shadow 0.16s ease, opacity 0.16s ease;
}

button:hover {
  transform: translateY(-1px);
  box-shadow: 0 16px 30px rgba(37,99,235,0.30);
}

.secondary {
  background: linear-gradient(135deg, #0f172a, #334155);
  box-shadow: 0 12px 24px rgba(15,23,42,0.18);
}

.danger {
  background: linear-gradient(135deg, #ef4444, #f97316);
  box-shadow: 0 12px 24px rgba(239,68,68,0.22);
}

.button-row {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 20px;
}

.status {
  margin-top: 20px;
  padding: 15px 16px;
  border: 1px solid #dbeafe;
  border-radius: 16px;
  background: linear-gradient(135deg, #eef2ff, #eff6ff);
  color: #3730a3;
  font-weight: 800;
}

.info, .notice {
  position: relative;
  padding: 16px 16px 16px 46px;
  border: 1px solid rgba(16,185,129,0.16);
  border-radius: 18px;
  background: linear-gradient(135deg, #ecfdf5, #f0fdfa);
  color: #065f46;
  margin-bottom: 18px;
  line-height: 1.5;
}

.info::before, .notice::before {
  content: "✓";
  position: absolute;
  left: 16px;
  top: 15px;
  display: grid;
  place-items: center;
  width: 21px;
  height: 21px;
  border-radius: 999px;
  background: #10b981;
  color: white;
  font-size: 13px;
  font-weight: 900;
}

.summary-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
  margin-top: 22px;
}

.summary-grid div {
  position: relative;
  overflow: hidden;
  min-height: 122px;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  background:
    radial-gradient(circle at top right, rgba(37,99,235,0.12), transparent 38%),
    linear-gradient(180deg, #ffffff, #f8fafc);
  border: 1px solid var(--line);
  border-radius: 22px;
  padding: 18px;
}

.summary-grid div::before {
  content: "";
  position: absolute;
  top: 18px;
  left: 18px;
  width: 36px;
  height: 36px;
  border-radius: 13px;
  background: linear-gradient(135deg, #dbeafe, #ede9fe);
}

.summary-grid span {
  display: block;
  font-size: 30px;
  line-height: 1;
  font-weight: 900;
  color: #0f172a;
  letter-spacing: -1px;
}

.summary-grid small {
  margin-top: 8px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  line-height: 1.35;
}

.settings {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 12px;
  align-items: end;
  margin: 16px 0;
}

.settings label { margin-top: 0; }

.qr-box {
  display: grid;
  grid-template-columns: 1fr 1fr auto;
  gap: 12px;
  align-items: center;
  margin: 16px 0;
}

.qr-output {
  padding: 18px;
  background: linear-gradient(135deg, #ffffff, #f8fafc);
  border: 1px dashed #93c5fd;
  border-radius: 22px;
  word-break: break-all;
  margin-bottom: 20px;
}

.qr-output a {
  color: #2563eb;
  font-weight: 800;
}

.qr-output img {
  display: block;
  margin-top: 14px;
  max-width: 220px;
  border: 10px solid white;
  border-radius: 18px;
  box-shadow: 0 14px 36px rgba(15,23,42,0.12);
}

.records-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-top: 26px;
}

.records-header h3 { margin: 0; }

.shop-location {
  padding: 12px 14px;
  border-radius: 14px;
  background: rgba(248,250,252,0.78);
  border: 1px solid var(--line);
}

.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: white;
  margin-top: 14px;
}

table {
  width: 100%;
  border-collapse: collapse;
}

th, td {
  padding: 14px 16px;
  border-bottom: 1px solid #eef2f7;
  text-align: left;
  white-space: nowrap;
  font-size: 14px;
}

th {
  background: #f8fafc;
  color: #475569;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.8px;
}

tbody tr:hover { background: #f8fafc; }

td small {
  color: var(--muted);
  font-weight: 800;
}

.hidden { display: none !important; }

#checkInBtn::before { content: "↗ "; }
#checkOutBtn::before { content: "↙ "; }
#adminToggle::before { content: "⚙ "; }
#exportBtn::before { content: "↓ "; }

@media (max-width: 860px) {
  .hero, .section-title, .records-header {
    align-items: flex-start;
    flex-direction: column;
  }

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

  .settings, .qr-box {
    grid-template-columns: 1fr;
  }

  .button-row button {
    flex: 1;
  }
}

@media (max-width: 520px) {
  .app {
    padding: 18px 14px 38px;
  }

  .hero {
    padding: 26px 22px;
    border-radius: 26px;
  }

  .card {
    padding: 22px 18px;
    border-radius: 24px;
  }

  h1 { font-size: 37px; }

  .summary-grid, .form-grid {
    grid-template-columns: 1fr;
  }

  button { width: 100%; }
}
