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

:root {
  --bg: #f6f5f2;
  --surface: #ffffff;
  --surface-alt: #f0efe9;
  --ink: #1f1b16;
  --muted: #6b5f52;
  --primary: #2a9d8f;
  --primary-strong: #1f7f73;
  --accent: #ff7a4d;
  --danger: #c0392b;
  --shadow: 0 10px 30px rgba(31, 27, 22, 0.12);
  --radius: 18px;
  --radius-lg: 24px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: 'Space Grotesk', sans-serif;
  color: var(--ink);
  background: linear-gradient(180deg, #efe9de 0%, #f7f6f2 100%);
  min-height: 100vh;
}

.app {
  max-width: 520px;
  margin: 0 auto;
  padding: 16px 14px 120px;
  display: grid;
  gap: 14px;
}

.appbar {
  position: sticky;
  top: 0;
  z-index: 5;
  padding: 16px 14px 12px;
  margin: 0 -14px;
  background: linear-gradient(180deg, rgba(247, 246, 242, 0.98), rgba(247, 246, 242, 0.92));
  backdrop-filter: blur(8px);
  display: flex;
  justify-content: center;
}

.logo {
  font-size: 22px;
  font-weight: 700;
  letter-spacing: 2px;
  color: var(--ink);
  padding: 8px 14px;
  border-radius: 999px;
  background: #fff;
  border: 1px solid rgba(31, 27, 22, 0.08);
  box-shadow: var(--shadow);
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--accent);
  color: #fff;
  padding: 6px 10px;
  border-radius: 999px;
  font-weight: 600;
  font-size: 12px;
  box-shadow: var(--shadow);
  margin-top: 10px;
}

.card {
  background: var(--surface);
  border-radius: var(--radius-lg);
  padding: 16px;
  box-shadow: var(--shadow);
  border: 1px solid rgba(31, 27, 22, 0.04);
}

.card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.card h2 {
  margin: 0 0 12px;
  font-size: 14px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 1px;
}

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

input[type="text"] {
  width: 100%;
  padding: 14px 16px;
  border-radius: 14px;
  border: 1px solid rgba(31, 27, 22, 0.12);
  background: #fff;
  font-size: 16px;
}

button {
  width: 100%;
  padding: 14px 16px;
  border-radius: 14px;
  border: none;
  background: var(--primary);
  color: #fff;
  font-weight: 600;
  font-size: 16px;
  cursor: pointer;
  box-shadow: 0 8px 18px rgba(42, 157, 143, 0.25);
}

button:active { transform: translateY(1px); }

button:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  box-shadow: none;
}

button.ghost {
  background: transparent;
  color: var(--danger);
  border: 1px solid rgba(192, 57, 43, 0.5);
  box-shadow: none;
}


button.secondary {
  width: auto;

  background: #fff;
  color: var(--muted);
  border: 1px solid rgba(31, 27, 22, 0.18);
  box-shadow: none;
  font-size: 12px;
  padding: 8px 10px;
  border-radius: 999px;
}

.hint {
  color: var(--muted);
  font-size: 13px;
  margin-top: 8px;
}

.turn {
  display: grid;
  gap: 12px;
}

.turn-name {
  font-size: 26px;
  font-weight: 700;
  color: var(--primary-strong);
}

.turn-sub {
  color: var(--muted);
  font-size: 14px;
}

.list,
.history {
  display: grid;
  gap: 10px;
}

.client {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 12px;
  align-items: center;
  padding: 14px;
  border-radius: 16px;
  background: var(--surface-alt);
  border: 1px solid rgba(31, 27, 22, 0.05);
}

.client h3 {
  margin: 0 0 6px;
  font-size: 17px;
}

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

.history-item {
  padding: 12px 14px;
  border-radius: 14px;
  background: #fff;
  border: 1px solid rgba(31, 27, 22, 0.08);
  font-size: 14px;
}


.client-actions {
  display: flex;
  gap: 8px;
  align-items: center;
}

button.danger-small {
  width: auto;
  background: transparent;
  color: var(--danger);
  border: 1px solid rgba(192, 57, 43, 0.45);
  box-shadow: none;
  font-size: 12px;
  padding: 8px 10px;
  border-radius: 999px;
}

.card.danger {
  border: 2px dashed rgba(192, 57, 43, 0.3);
}


.section-title {
  font-size: 18px;
  font-weight: 700;
  margin: 8px 2px 6px;
}

.alert {
  background: #fff4e9;
  border: 1px solid rgba(255, 122, 77, 0.35);
  border-radius: 16px;
  padding: 14px 16px;
  box-shadow: var(--shadow);
}

.alert-title {
  font-weight: 600;
  margin-bottom: 6px;
}

.screen {
  display: none;
  gap: 14px;
}

.screen.active {
  display: grid;
}

.tabbar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  background: #fff;
  border-top: 1px solid rgba(31, 27, 22, 0.08);
  display: grid;
  grid-template-columns: 1fr 1fr;
  padding: 8px 12px 16px;
  gap: 8px;
  box-shadow: 0 -8px 24px rgba(31, 27, 22, 0.12);
}

.tab {
  display: grid;
  gap: 6px;
  justify-items: center;
  background: transparent;
  color: var(--muted);
  box-shadow: none;
  padding: 10px 8px;
}

.tab.active {
  color: var(--primary-strong);
}

.tab-icon {
  font-size: 18px;
}

.tab-label {
  font-size: 12px;
  font-weight: 600;
}

@media (min-width: 720px) {
  .app { max-width: 760px; padding: 24px 24px 120px; }
  .turn { grid-template-columns: 1fr auto; align-items: center; }
  .card h2 { font-size: 15px; }
  .client { grid-template-columns: 1fr auto; align-items: center; }
  .client button { width: auto; }
  .tabbar { max-width: 760px; margin: 0 auto; left: 50%; transform: translateX(-50%); border-radius: 18px 18px 0 0; }
}
