:root {
  --bg: #f4f6f8;
  --card: #fff;
  --text: #18202a;
  --muted: #667085;
  --primary: #1f6feb;
  --danger: #d92d20;
  --border: #d0d5dd;
}

* {
  box-sizing: border-box;
}

html,
body {
  min-height: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: Arial, Helvetica, sans-serif;
  background: var(--bg);
  color: var(--text);
  display: flex;
  flex-direction: column;
}

.topbar {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
  background: #101828;
  color: #fff;
  padding: 12px 20px;
}

.brand {
  font-weight: 700;
  margin-right: 10px;
}

nav {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

nav a {
  color: #fff;
  text-decoration: none;
  font-size: 14px;
  opacity: .9;
}

nav a:hover {
  opacity: 1;
  text-decoration: underline;
}

.logout {
  margin-left: auto;
}

.logout button {
  background: #344054;
  color: #fff;
  border: 0;
  border-radius: 8px;
  padding: 8px 12px;
}

.container {
  width: 100%;
  max-width: 1280px;
  margin: 24px auto;
  padding: 0 16px;
  flex: 1 0 auto;
}

.footer {
  margin-top: auto;
  padding: 14px 20px;
  background: #101828;
  color: #e5e7eb;
  font-size: 14px;
  border-top: 1px solid #344054;
  flex-shrink: 0;
  width: 100%;
  display: flex;
  gap: 12px;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  text-align: left;
}

.footer strong {
  color: #ffffff;
}

.site-footer {
  margin-top: auto;
  padding: 14px 20px;
  background: #101828;
  color: #e5e7eb;
  font-size: 14px;
  border-top: 1px solid #344054;
  flex-shrink: 0;
  width: 100%;
}

.site-footer-inner {
  max-width: 1280px;
  margin: 0 auto;
  display: flex;
  gap: 12px;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
}

.site-footer strong {
  color: #ffffff;
}

.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 18px;
  margin: 16px 0;
  box-shadow: 0 2px 10px rgba(16, 24, 40, .04);
}

.narrow {
  max-width: 420px;
}

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

.stats .card span {
  display: block;
  font-size: 34px;
  font-weight: 700;
  margin-top: 12px;
}

.actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin: 16px 0;
}

.btn,
button {
  display: inline-block;
  border: 1px solid var(--border);
  background: #fff;
  color: var(--text);
  padding: 9px 13px;
  border-radius: 9px;
  text-decoration: none;
  cursor: pointer;
}

.btn.primary,
button.primary {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
}

.btn.danger,
button.danger {
  background: var(--danger);
  border-color: var(--danger);
  color: #fff;
}

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

label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-weight: 600;
}

input,
select,
textarea {
  width: 100%;
  padding: 10px;
  border: 1px solid var(--border);
  border-radius: 9px;
  background: #fff;
}

textarea {
  min-height: 90px;
}

.full {
  grid-column: 1 / -1;
}

table {
  width: 100%;
  border-collapse: collapse;
  background: #fff;
  border-radius: 12px;
  overflow: hidden;
  margin: 16px 0;
}

th,
td {
  padding: 10px;
  border-bottom: 1px solid var(--border);
  text-align: left;
  vertical-align: top;
}

th {
  background: #eef2f6;
}

.flash {
  padding: 12px;
  border-radius: 10px;
  margin: 12px 0;
}

.flash.error {
  background: #fee4e2;
}

.flash.success {
  background: #dcfae6;
}

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

@media (max-width: 720px) {
  .topbar {
    align-items: flex-start;
  }

  .logout {
    margin-left: 0;
  }

  table {
    font-size: 13px;
    display: block;
    overflow-x: auto;
  }

  .container {
    margin: 12px auto;
  }

  .site-footer-inner {
    flex-direction: column;
    align-items: flex-start;
  }
}

.filters-form {
  align-items: end;
}

.pagination,
.pagination-info {
  margin: 12px 0;
}

.pagination .btn.primary {
  cursor: default;
}


.table-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin: 0;
}

.table-actions form {
  display: inline-block;
  margin: 0;
}

.table-actions .btn,
.table-actions button {
  white-space: nowrap;
}


/* Jednotné rozložení filtrů a stránkování */
.filters-form {
  align-items: end;
}

.pagination {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin: 12px 0;
}

.pagination-info {
  color: var(--muted);
  margin: 12px 0;
}

.pagination .btn.primary {
  cursor: default;
}

.filter-actions {
  display: flex;
  gap: 8px;
  align-items: end;
  flex-wrap: wrap;
}
