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

:root {
  --bg: #f4f6f3;
  --surface: #ffffff;
  --surface-soft: #f9faf7;
  --ink: #17211f;
  --muted: #6f7b76;
  --line: #dfe5df;
  --line-strong: #c8d1ca;
  --primary: #0f766e;
  --primary-dark: #0b4f49;
  --accent: #b9853b;
  --danger: #c2413b;
  --danger-dark: #8f2f2a;
  --shadow: 0 22px 60px rgba(23, 33, 31, 0.12);
  --shadow-soft: 0 12px 34px rgba(23, 33, 31, 0.08);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  font-family: 'Inter', Arial, sans-serif;
  color: var(--ink);
  background:
    linear-gradient(90deg, rgba(23, 33, 31, 0.035) 1px, transparent 1px),
    linear-gradient(rgba(23, 33, 31, 0.035) 1px, transparent 1px),
    linear-gradient(180deg, #fbfcfa 0%, var(--bg) 100%);
  background-size: 48px 48px, 48px 48px, auto;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(180deg, rgba(255,255,255,0.78), rgba(255,255,255,0.18));
}

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

.hero {
  position: relative;
  overflow: hidden;
  display: flex;
  justify-content: space-between;
  gap: 24px;
  align-items: center;
  min-height: 220px;
  color: white;
  padding: 34px;
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 14px;
  margin-bottom: 18px;
  background:
    linear-gradient(135deg, rgba(255,255,255,0.08), transparent 42%),
    linear-gradient(135deg, #101817 0%, #20312e 58%, #0f766e 100%);
  box-shadow: var(--shadow);
}

.hero::after {
  content: "";
  position: absolute;
  left: 34px;
  right: 34px;
  bottom: 0;
  height: 4px;
  background: linear-gradient(90deg, var(--accent), rgba(255,255,255,0.5), var(--primary));
}

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

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

.eyebrow::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 999px;
  background: var(--accent);
}

.eyebrow.dark {
  margin-bottom: 10px;
  border-color: rgba(15,118,110,0.16);
  background: #eef8f5;
  color: var(--primary-dark);
}

.view-switcher {
  display: grid;
  grid-template-columns: repeat(2, minmax(116px, 1fr));
  gap: 4px;
  padding: 5px;
  border: 1px solid rgba(255,255,255,0.18);
  border-radius: 12px;
  background: rgba(8, 13, 12, 0.28);
}

.view-tab {
  min-height: 44px;
  padding: 11px 18px;
  border-radius: 8px;
  background: transparent;
  color: #d7eee9;
  box-shadow: none;
}

.view-tab:hover {
  transform: none;
  box-shadow: none;
  background: rgba(255,255,255,0.08);
}

.view-tab.active {
  background: #f8faf7;
  color: var(--ink);
  box-shadow: 0 12px 24px rgba(0,0,0,0.22);
}

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

h1 {
  margin-bottom: 10px;
  max-width: 620px;
  font-size: 52px;
  line-height: 1;
  letter-spacing: 0;
}

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

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

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

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

.portal-intro,
.card {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(255,255,255,0.92);
  box-shadow: var(--shadow-soft);
}

.portal-intro {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: center;
  padding: 20px 22px;
  margin-bottom: 16px;
}

.portal-intro h2 { margin-bottom: 4px; }
.portal-intro p:last-child { margin-bottom: 0; }

.card {
  position: relative;
  overflow: hidden;
  padding: 28px;
  margin-bottom: 22px;
}

.card::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 4px;
  background: linear-gradient(90deg, var(--primary), var(--accent));
}

.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: 8px 11px;
  border-radius: 999px;
  background: #eef8f5;
  color: var(--primary-dark);
  font-size: 12px;
  font-weight: 900;
  border: 1px solid rgba(15,118,110,0.18);
}

.dark-badge {
  background: #fff8eb;
  color: #8a5a16;
  border-color: rgba(185,133,59,0.24);
}

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

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

input {
  width: 100%;
  min-height: 50px;
  padding: 14px 15px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: var(--surface);
  color: var(--ink);
  font-size: 15px;
  font-family: inherit;
  outline: none;
  transition: border-color 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
}

input:focus {
  border-color: rgba(15,118,110,0.82);
  box-shadow: 0 0 0 4px rgba(15,118,110,0.12);
  background: #fff;
}

button {
  border: none;
  border-radius: 8px;
  padding: 14px 20px;
  font-size: 14px;
  font-weight: 900;
  font-family: inherit;
  cursor: pointer;
  background: linear-gradient(135deg, var(--primary-dark), var(--primary));
  color: white;
  box-shadow: 0 12px 24px rgba(15,118,110,0.22);
  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(15,118,110,0.26);
}

.secondary {
  background: linear-gradient(135deg, #273632, #40504b);
  box-shadow: 0 12px 24px rgba(23,33,31,0.18);
}

.danger {
  background: linear-gradient(135deg, var(--danger-dark), var(--danger));
  box-shadow: 0 12px 24px rgba(194,65,59,0.22);
}

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

.status {
  margin-top: 20px;
  padding: 14px 15px;
  border: 1px solid #cae2dd;
  border-radius: 8px;
  background: #eef8f5;
  color: var(--primary-dark);
  font-weight: 800;
}

.info, .notice {
  position: relative;
  padding: 16px 16px 16px 46px;
  border: 1px solid #cae2dd;
  border-radius: 8px;
  background: linear-gradient(135deg, #f3fbf8, #fbfdfb);
  color: #174f48;
  margin-bottom: 18px;
  line-height: 1.5;
}

.info::before, .notice::before {
  content: "i";
  position: absolute;
  left: 16px;
  top: 15px;
  display: grid;
  place-items: center;
  width: 21px;
  height: 21px;
  border-radius: 999px;
  background: var(--primary);
  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: 124px;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  background: linear-gradient(180deg, var(--surface), var(--surface-soft));
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 18px;
}

.summary-grid div::before {
  content: "";
  position: absolute;
  top: 18px;
  left: 18px;
  width: 36px;
  height: 4px;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--primary), var(--accent));
}

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

.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; }

.admin-login {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) auto;
  gap: 12px;
  align-items: end;
  max-width: 560px;
}

.admin-login label { margin-top: 0; }

.admin-status { max-width: 560px; }

.admin-actions {
  display: flex;
  gap: 10px;
  align-items: center;
}

.compact-button {
  padding: 10px 14px;
  border-radius: 8px;
  box-shadow: 0 8px 18px rgba(23,33,31,0.14);
}

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

.qr-output {
  padding: 18px;
  background: var(--surface-soft);
  border: 1px dashed var(--primary);
  border-radius: 8px;
  word-break: break-all;
  margin-bottom: 20px;
}

.qr-output a {
  color: var(--primary-dark);
  font-weight: 800;
}

.qr-output img {
  display: block;
  margin-top: 14px;
  max-width: 220px;
  border: 10px solid white;
  border-radius: 8px;
  box-shadow: 0 14px 36px rgba(23,33,31,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: 8px;
  background: var(--surface-soft);
  border: 1px solid var(--line);
}

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

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

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

th {
  background: var(--surface-soft);
  color: #53625d;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0;
}

tbody tr:hover { background: #fbfcfa; }

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

.hidden { display: none !important; }

#checkInBtn::before { content: "+ "; }
#checkOutBtn::before { content: "- "; }
#exportBtn::before { content: "v "; }

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

  .hero {
    min-height: auto;
  }

  .view-switcher {
    width: 100%;
  }

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

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

  .admin-actions {
    align-items: flex-start;
    flex-direction: column;
  }

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

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

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

  .card {
    padding: 22px 18px;
  }

  h1 { font-size: 37px; }

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

  button { width: 100%; }

  .view-tab {
    width: auto;
  }
}
