/* Brand tokeny doucse.cz */
:root {
  --paper: #fef9fb;
  --soft: #fde4ef;
  --ink: #1a1a1a;
  --ink-muted: #7a7a7a;
  --pink: #ea3d84;
  --pink-dark: #c72f6e;
  --pink-soft: #fbd5e6;
  --green: #16a34a;
  --green-bg: #dcfce7;
  --green-ink: #166534;
  --amber-bg: #fef3c7;
  --amber-ink: #92400e;
  --red: #dc2626;
  --red-bg: #fee2e2;
  --red-ink: #991b1b;
  --gray-bg: #eef0f2;
  --gray-ink: #52616b;
  --radius-card: 1.25rem;
  --radius-btn: 999px;
  --font-sans: 'Inter', system-ui, -apple-system, sans-serif;
  --font-display: 'Fraunces', Georgia, serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--font-sans);
  color: var(--ink);
  background: var(--paper);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

/* ── Topbar ── */
.topbar { border-bottom: 1px solid rgba(0, 0, 0, 0.06); background: rgba(255, 255, 255, 0.6); }
.topbar-inner {
  max-width: 920px; margin: 0 auto; padding: 14px 20px;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
}
.brand { font-weight: 700; letter-spacing: -0.01em; }
.brand span { color: var(--pink); }
.userbox { display: flex; align-items: center; gap: 12px; min-width: 0; }
.user-email {
  color: var(--ink-muted); font-size: 0.9rem; max-width: 42vw;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}

/* ── Layout ── */
.wrap { max-width: 920px; margin: 0 auto; padding: 40px 20px 8px; }
.title { font-family: var(--font-display); font-weight: 600; letter-spacing: -0.01em; font-size: 2rem; margin: 0 0 8px; }
.lead { color: var(--ink-muted); margin: 0 0 24px; font-size: 1.02rem; }
.lead strong { color: var(--ink); }
.ok-word { color: var(--green); font-weight: 600; }
.bad-word { color: var(--red); font-weight: 600; }

/* ── Vyhledávání ── */
.search-row { display: flex; gap: 12px; flex-direction: column; }
@media (min-width: 560px) { .search-row { flex-direction: row; } }
#email {
  flex: 1; width: 100%; font-family: var(--font-sans); font-size: 1.05rem;
  padding: 15px 22px; border: 2px solid var(--pink-soft); border-radius: var(--radius-btn);
  background: #fff; box-shadow: 0 1px 2px rgba(0, 0, 0, 0.03); outline: none; transition: border-color 0.15s;
}
#email:focus { border-color: var(--pink); }
#email::placeholder { color: #c7b6bf; }

.btn-primary {
  border: 0; cursor: pointer; font-family: var(--font-sans); font-weight: 600; font-size: 1.05rem;
  color: #fff; background: var(--pink); padding: 15px 30px; border-radius: var(--radius-btn);
  box-shadow: 0 8px 20px -8px rgba(234, 61, 132, 0.6); transition: background 0.15s, transform 0.05s;
  white-space: nowrap;
}
.btn-primary:hover { background: var(--pink-dark); }
.btn-primary:active { transform: translateY(1px); }
.btn-primary:disabled { opacity: 0.6; cursor: default; }

.btn-ghost {
  border: 1px solid rgba(0, 0, 0, 0.12); background: #fff; cursor: pointer;
  font-family: var(--font-sans); font-size: 0.9rem; color: var(--ink);
  padding: 8px 14px; border-radius: var(--radius-btn); transition: background 0.15s;
}
.btn-ghost:hover { background: var(--soft); }

/* ── Výsledky ── */
.results { margin-top: 28px; }
.results-head { display: flex; align-items: baseline; gap: 10px; margin-bottom: 12px; flex-wrap: wrap; }
.results-head h2 { font-family: var(--font-display); font-weight: 600; font-size: 1.15rem; margin: 0; }
.results-head .count {
  background: var(--soft); color: var(--pink-dark); font-weight: 600; font-size: 0.82rem;
  padding: 2px 10px; border-radius: var(--radius-btn);
}
.results-head .q { color: var(--ink-muted); font-size: 0.92rem; }

.table-card {
  background: #fff; border: 1px solid rgba(0, 0, 0, 0.08); border-radius: var(--radius-card);
  box-shadow: 0 10px 30px -20px rgba(0, 0, 0, 0.35); overflow: hidden;
}
.table-scroll { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; min-width: 620px; }
thead th {
  text-align: left; font-size: 0.72rem; letter-spacing: 0.04em; text-transform: uppercase;
  color: var(--ink-muted); font-weight: 600; padding: 14px 18px; background: #fcfafb;
  border-bottom: 1px solid rgba(0, 0, 0, 0.06);
}
tbody td { padding: 15px 18px; border-top: 1px solid rgba(0, 0, 0, 0.05); font-size: 0.95rem; }
tbody tr:hover { background: var(--soft); }
tbody tr:first-child td { border-top: 0; }
td.num { font-weight: 600; }
td.muted, td .muted { color: var(--ink-muted); }

.badge {
  display: inline-block; font-size: 0.78rem; font-weight: 600; padding: 4px 12px; border-radius: var(--radius-btn);
}
.badge.paid { background: var(--green-bg); color: var(--green-ink); }
.badge.unpaid { background: var(--amber-bg); color: var(--amber-ink); }
.badge.overdue { background: var(--red-bg); color: var(--red-ink); }
.badge.cancelled { background: var(--gray-bg); color: var(--gray-ink); }

.empty, .hint {
  background: #fff; border: 1px dashed rgba(0, 0, 0, 0.12); border-radius: var(--radius-card);
  padding: 26px; color: var(--ink-muted); text-align: center;
}
.hint.error { border-color: var(--red); color: var(--red-ink); background: #fff6f6; border-style: solid; }

.foot { max-width: 920px; margin: 40px auto; padding: 0 20px; color: var(--ink-muted); font-size: 0.82rem; }

/* ── Login ── */
.login-body { display: flex; align-items: center; justify-content: center; min-height: 100vh; padding: 20px; }
.login-card {
  background: #fff; border: 1px solid var(--pink-soft); border-radius: var(--radius-card);
  box-shadow: 0 30px 60px -30px rgba(234, 61, 132, 0.35); padding: 40px 36px; max-width: 440px; width: 100%; text-align: center;
}
.brand-lg { font-weight: 700; font-size: 1.05rem; margin-bottom: 18px; }
.brand-lg span { color: var(--pink); }
.login-card .title { font-size: 1.6rem; }
.login-card .lead { margin-bottom: 22px; }
.btn-google {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px; width: 100%;
  text-decoration: none; color: var(--ink); font-weight: 600; font-size: 1rem;
  padding: 14px 20px; border: 1.5px solid rgba(0, 0, 0, 0.14); border-radius: var(--radius-btn);
  background: #fff; transition: background 0.15s, border-color 0.15s;
}
.btn-google:hover { background: var(--soft); border-color: var(--pink-soft); }
.fineprint { color: var(--ink-muted); font-size: 0.82rem; margin: 20px 0 0; }
.notice-error, .notice-warn { border-radius: 12px; padding: 12px 14px; font-size: 0.9rem; margin-bottom: 16px; text-align: left; }
.notice-error { background: var(--red-bg); color: var(--red-ink); }
.notice-warn { background: var(--amber-bg); color: var(--amber-ink); }
.notice-error[data-show=""], .notice-warn[data-show=""] { display: none; }

/* Výrazná poznámka na loginu o novém způsobu přihlášení */
.notice-login {
  background: var(--soft);
  border: 2px solid var(--pink);
  color: var(--ink);
  border-radius: 14px;
  padding: 14px 16px;
  margin-bottom: 18px;
  font-size: 0.95rem;
  text-align: left;
  line-height: 1.45;
}
.notice-login strong { color: var(--pink-dark); }

/* Mobil: plynulý horizontální scroll tabulky + viditelný náznak */
.table-scroll { -webkit-overflow-scrolling: touch; scrollbar-width: thin; }
.table-scroll::-webkit-scrollbar { height: 8px; }
.table-scroll::-webkit-scrollbar-thumb { background: var(--pink-soft); border-radius: 8px; }
.scroll-hint {
  display: none;
  color: var(--pink-dark);
  font-size: 0.85rem;
  font-weight: 600;
  margin: 10px 2px 0;
  text-align: center;
}
@media (max-width: 640px) {
  .user-email { display: none; } /* na mobilu šetříme místo v hlavičce */
  .scroll-hint { display: none; }
  .title { font-size: 1.5rem; }
  .lead { font-size: 0.92rem; }
  .admin-page .title { font-size: 1.1rem; }

  /* Tabulka faktur → KARTY: každá faktura má všechny údaje pod sebou, jen svislé rolování */
  .table-card { background: transparent; border: 0; box-shadow: none; border-radius: 0; overflow: visible; }
  .inv-table { min-width: 0; }
  .inv-table thead { display: none; }
  .inv-table, .inv-table tbody, .inv-table tr, .inv-table td { display: block; width: 100%; }
  .inv-table tr {
    background: #fff; border: 1px solid rgba(0, 0, 0, 0.08); border-radius: 14px;
    margin-bottom: 12px; box-shadow: 0 8px 20px -16px rgba(0, 0, 0, 0.45); overflow: hidden;
  }
  .inv-table tbody tr:hover { background: #fff; }
  .inv-table td {
    display: flex; align-items: center; justify-content: space-between; gap: 14px;
    padding: 11px 16px; border-top: 1px solid rgba(0, 0, 0, 0.06); text-align: right;
  }
  .inv-table td:first-child { border-top: 0; }
  .inv-table td::before {
    content: attr(data-label);
    color: var(--ink-muted); font-weight: 600; font-size: 0.76rem;
    text-transform: uppercase; letter-spacing: 0.03em; text-align: left; margin-right: auto;
  }
  .inv-table td.num { font-size: 1.05rem; }
}

/* Admin: horní posuvník tabulky (synchronizovaný s dolním) */
.hscroll-top { overflow-x: auto; overflow-y: hidden; }
.hscroll-top-inner { height: 1px; }
.hscroll-top::-webkit-scrollbar { height: 8px; }
.hscroll-top::-webkit-scrollbar-thumb { background: var(--pink-soft); border-radius: 8px; }

/* Admin: stránkování (číslíčka dole) */
.pagination { display: flex; gap: 6px; flex-wrap: wrap; justify-content: center; margin-top: 18px; }
.pg {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 38px; height: 38px; padding: 0 10px; border-radius: 10px;
  border: 1px solid rgba(0, 0, 0, 0.1); background: #fff; color: var(--ink);
  text-decoration: none; font-size: 0.92rem; transition: background 0.15s;
}
.pg:hover { background: var(--soft); }
.pg.cur { background: var(--pink); color: #fff; border-color: var(--pink); font-weight: 600; }
.pg.dots { border: 0; background: transparent; }

/* Admin: kompaktní zobrazení — menší písma i tabulka (platí i na mobilu) */
.admin-page .title { font-size: 1.2rem; margin: 20px 0 10px; }
.admin-page .lead { font-size: 0.84rem; margin-bottom: 14px; }
.admin-page table { min-width: 540px; }
.admin-page thead th { padding: 7px 12px; font-size: 0.64rem; }
.admin-page tbody td { padding: 7px 12px; font-size: 0.79rem; }
.admin-page .brand { font-size: 0.92rem; }
.admin-page .btn-ghost { font-size: 0.8rem; padding: 6px 11px; }
.admin-page .pg { min-width: 32px; height: 32px; font-size: 0.84rem; }
