* {
  box-sizing: border-box;
}

html, body {
  margin: 0;
  padding: 0;
  font-family: 'Segoe UI', 'Roboto', Arial, sans-serif;
  background: linear-gradient(120deg, #f8fafc 0%, #e2e8f0 100%);
  color: #222;
  min-height: 100vh;
}

body {
  padding: 40px 20px;
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  position: relative;
}

h2 {
  font-weight: 600;
  color: #2d3748;
  margin-bottom: 20px;
  text-align: center;
}

a {
  color: #3182ce;
  text-decoration: none;
  font-weight: 500;
  transition: color 0.2s;
}
a:hover {
  color: #2b6cb0;
  text-decoration: underline;
}

form {
  background: #fff;
  padding: 24px 20px 16px 20px;
  border-radius: 12px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.06);
  margin-bottom: 32px;
  width: 100%;
  max-width: 1200px;
  margin-left: auto;
  margin-right: auto;
  display: flex;
  gap: 15px;
  align-items: flex-end;
  flex-wrap: wrap;
}

input[type="text"], input[type="password"], input[type="number"], input[type="email"], input[name], input {
  padding: 10px 12px;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  margin-bottom: 0;
  font-size: 1rem;
  transition: border 0.2s;
  background: #f9fafb;
  box-sizing: border-box;
  flex: 1;
  min-width: 150px;
}
input:focus {
  border: 1.5px solid #3182ce;
  outline: none;
  background: #fff;
}

button, input[type="submit"] {
  background: linear-gradient(90deg, #3182ce 0%, #63b3ed 100%);
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: 10px 22px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 2px 6px rgba(49,130,206,0.08);
  transition: background 0.2s, box-shadow 0.2s;
  margin: 0;
  white-space: nowrap;
}
button:hover, input[type="submit"]:hover {
  background: linear-gradient(90deg, #2563eb 0%, #4299e1 100%);
  box-shadow: 0 4px 12px rgba(49,130,206,0.13);
}



table {
  width: 100%;
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.06);
  border-collapse: separate;
  border-spacing: 0;
  overflow: hidden;
  margin-bottom: 0; /* Odstránené, lebo je v .table-container */
}
table th, table td {
  padding: 8px 12px;
  text-align: left;
  font-size: 0.9rem;
}
table th {
  background: #e2e8f0;
  color: #2d3748;
  font-weight: 600;
  padding: 10px 12px;
}
table tr:nth-child(even) td {
  background: #f7fafc;
}
table tr:hover td {
  background: #ebf8ff;
}

/* Zvýraznenie neodoslaných záznamov */
table tr.neposlane td {
  background: #f8fafc !important;
}
table tr.neposlane:nth-child(even) td {
  background: #f1f5f9 !important;
}
table tr.neposlane:hover td {
  background: #e2e8f0 !important;
}
table td {
  border-bottom: 1px solid #e2e8f0;
}
table tr:last-child td {
  border-bottom: none;
}

p {
  margin: 10px 0;
  color: #e53e3e;
  font-weight: 500;
}

/* Špeciálny štýl pre login formulár */
body form:not([action="add.php"]) {
  max-width: 400px;
  display: block;
  text-align: center;
}

body form:not([action="add.php"]) input {
  width: 100%;
  margin-bottom: 15px;
  display: block;
}

body form:not([action="add.php"]) button {
  width: 100%;
  margin-top: 10px;
}

/* Odhlásiť sa link vpravo hore */
a[href="logout.php"] {
  align-self: flex-end;
  background: #e53e3e;
  color: #fff;
  padding: 8px 16px;
  border-radius: 8px;
  font-weight: 600;
  margin-bottom: 20px;
  transition: background 0.2s;
}
a[href="logout.php"]:hover {
  background: #c53030;
}

/* Hover efekt pre tlačidlo Odoslať */
a[href*="update_status.php"]:hover {
  background: linear-gradient(90deg, #2563eb 0%, #4299e1 100%) !important;
  box-shadow: 0 4px 12px rgba(49,130,206,0.13) !important;
}

/* --- TOPBAR --- */
.topbar {
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}
.menu {
  display: flex;
  gap: 10px;
  align-items: center;
}
.logout-btn {
  background: #e53e3e;
  color: #fff;
  padding: 8px 16px;
  border-radius: 8px;
  font-weight: 600;
  text-decoration: none;
  transition: background 0.2s;
}
.logout-btn:hover {
  background: #c53030;
}

/* --- LOGOUT ABSOLÚTNE VPRAVO HORE --- */
.logout-btn-absolute {
  position: absolute;
  top: 24px;
  right: 32px;
  background: #e53e3e;
  color: #fff;
  padding: 8px 16px;
  border-radius: 8px;
  font-weight: 600;
  text-decoration: none;
  transition: background 0.2s;
  z-index: 100;
}
.logout-btn-absolute:hover {
  background: #c53030;
}

/* --- PRIHLÁSENÝ UŽÍVATEĽ VPRAVO HORE --- */
.user-info-absolute {
  position: fixed;
  top: 8px;
  right: 32px;
  color: #666;
  font-size: 0.95rem;
  background: rgba(255,255,255,0.85);
  padding: 2px 12px;
  border-radius: 6px;
  z-index: 110;
}

/* Hamburger menu pre mobily */
.mobile-menu-toggle {
  display: none;
  flex-direction: column;
  cursor: pointer;
  padding: 10px;
  position: absolute;
  top: 20px;
  left: 20px;
  z-index: 200;
}

.mobile-menu-toggle span {
  width: 25px;
  height: 3px;
  background: #3182ce;
  margin: 3px 0;
  transition: 0.3s;
  border-radius: 2px;
}

.mobile-menu-toggle.active span:nth-child(1) {
  transform: rotate(-45deg) translate(-5px, 6px);
}

.mobile-menu-toggle.active span:nth-child(2) {
  opacity: 0;
}

.mobile-menu-toggle.active span:nth-child(3) {
  transform: rotate(45deg) translate(-5px, -6px);
}

/* Responsive dizajn pre mobilné zariadenia */
@media (max-width: 768px) {
  body {
    padding: 20px 10px;
    max-width: 100%;
  }
  
  h2 {
    font-size: 1.5rem;
    margin-bottom: 15px;
  }
  
  /* Hamburger menu zobrazenie */
  .mobile-menu-toggle {
    display: flex;
  }
  
  .menu-container {
    position: fixed;
    top: 0;
    left: -100%;
    width: 280px;
    height: 100vh;
    background: #fff;
    box-shadow: 2px 0 10px rgba(0,0,0,0.1);
    transition: left 0.3s ease;
    z-index: 150;
    flex-direction: column;
    justify-content: flex-start;
    padding-top: 80px;
    border-radius: 0;
  }
  
  .menu-container.mobile-open {
    left: 0;
  }
  
  .main-menu {
    flex-direction: column;
    width: 100%;
    gap: 0;
  }
  
  .main-menu a {
    width: 100%;
    padding: 15px 20px;
    border-radius: 0;
    border-bottom: 1px solid #e2e8f0;
    text-align: left;
  }
  
  .main-menu a:hover, .main-menu a.active {
    background: #3182af;
    color: #fff;
  }
  
  .logout-link {
    position: absolute;
    bottom: 20px;
    left: 20px;
    right: 20px;
    text-align: center;
    transform: none;
  }
  
  form {
    padding: 20px 15px;
    max-width: 100%;
    flex-direction: column;
    gap: 10px;
  }
  
  input[type="text"], input[type="password"], input[type="number"], input[type="email"], input[name], input {
    width: 100%;
    min-width: auto;
  }
  
  button, input[type="submit"] {
    width: 100%;
    padding: 12px 16px;
  }
  
  table {
    font-size: 0.8rem;
    margin-bottom: 20px;
    overflow-x: auto;
    display: block;
    min-width: 800px; /* Minimálna šírka pre správne zobrazenie */
  }
  
  table th, table td {
    padding: 8px 6px;
    font-size: 0.75rem;
    white-space: nowrap;
  }
  
  /* Skrytie stĺpcov na mobilných zariadeniach */
  .mobile-hide {
    display: none;
  }
  
  /* Zmenšenie tlačidiel v tabuľke */
  a[href*="update_status.php"] {
    padding: 6px 10px !important;
    font-size: 0.75rem !important;
    white-space: nowrap;
  }
  
  /* Upravenie logout tlačidla */
  a[href="logout.php"] {
    padding: 6px 12px;
    font-size: 0.8rem;
  }
  
  /* Touch-friendly tlačidlá */
  button, input[type="submit"], a[href*="update_status.php"] {
    min-height: 44px;
    min-width: 44px;
  }
  
  /* Filtre pre mobily */
  .filters-container {
    padding: 15px;
    margin-bottom: 15px;
  }
  
  .filter-row {
    flex-direction: column;
    gap: 12px;
    align-items: stretch;
  }
  
  .filter-select {
    width: 100%;
    min-width: auto;
    padding: 0 12px;
    font-size: 16px; /* Zabráni zoom na iOS */
  }
  
  .filter-checkbox {
    justify-content: center;
    padding: 8px 0;
  }
  
  .filter-btn, .clear-filters-btn {
    width: 100%;
    font-size: 1rem;
    min-height: 44px;
  }
  
  /* Horizontálny scroll pre tabuľky */
  .table-container {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    width: 100%;
  }
  
  .table-container table {
    width: 100%;
    min-width: 800px; /* Minimálna šírka pre správne zobrazenie */
  }
}

/* Ešte menšie obrazovky */
@media (max-width: 480px) {
  body {
    padding: 15px 8px;
  }
  
  h2 {
    font-size: 1.3rem;
    margin-bottom: 12px;
  }
  
  .mobile-menu-toggle {
    top: 15px;
    left: 15px;
  }
  
  .menu-container {
    width: 100%;
    left: -100%;
  }
  
  .menu-container.mobile-open {
    left: 0;
  }
  
  table th, table td {
    padding: 6px 4px;
    font-size: 0.7rem;
  }
}

.main-menu {
  width: auto;
  display: flex;
  gap: 20px;
  background: none;
  padding: 0;
  border-radius: 0;
  margin-bottom: 0;
  justify-content: center;
  align-items: center;
}
.main-menu a {
  color: #2d3748;
  font-weight: 600;
  text-decoration: none;
  padding: 8px 18px;
  border-radius: 6px;
  transition: background 0.2s, color 0.2s;
}
.main-menu a:hover, .main-menu a.active {
  background: #3182ce;
  color: #fff;
}

.menu-container {
  background: #fff;
  padding: 12px 0;
  border-radius: 0;
  margin-bottom: 24px;
  width: 100%;
  max-width: none;
  margin-left: 0;
  margin-right: 0;
  border-radius: 12px;
  display: flex;
  justify-content: center;
  align-items: center;
  box-shadow: 0 2px 8px rgba(0,0,0,0.06);
  position: relative;
}
.logout-link {
  background: #e53e3e;
  color: #fff;
  padding: 8px 16px;
  border-radius: 8px;
  font-weight: 600;
  transition: background 0.2s;
  text-decoration: none;
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
}
.logout-link:hover {
  background: #c53030;
  text-decoration: none;
}

/* Filtre */
.filters-container {
  background: #fff;
  padding: 20px;
  border-radius: 12px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.06);
  margin-bottom: 20px;
  width: 100%;
  max-width: none;
  margin-left: 0;
  margin-right: 0;
}

.filters-container h3 {
  margin: 0 0 15px 0;
  color: #2d3748;
  font-size: 1.1rem;
  font-weight: 600;
}

.results-count {
  color: #6b7280;
  font-weight: 400;
  font-size: 0.9rem;
}

.active-filters {
  color: #3182ce;
  font-weight: 500;
  font-size: 0.85rem;
}

.filters-form {
  width: 100%;
}

.filter-row {
  display: flex;
  gap: 15px;
  align-items: center;
  justify-content: center;
}

.filter-select {
  padding: 8px 18px;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  background: #f9fafb;
  font-size: 0.9rem;
  min-width: 150px;
  transition: border 0.2s, background 0.2s;
}

.filter-select:focus {
  border: 1.5px solid #3182ce;
  outline: none;
  background: #fff;
}

.filter-checkbox {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  font-size: 0.9rem;
  color: #374151;
  white-space: nowrap;
  padding: 8px 0;
}

.filter-checkbox input[type="checkbox"] {
  width: 16px;
  height: 16px;
  cursor: pointer;
}

.filter-btn {
  background: linear-gradient(90deg, #3182ce 0%, #63b3ed 100%);
  color: #fff;
  border: none;
  border-radius: 6px;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s;
  white-space: nowrap;
  padding: 8px 18px;
}

.filter-btn:hover {
  background: linear-gradient(90deg, #2563eb 0%, #4299e1 100%);
}

.clear-filters-btn {
  background: #6b7280;
  color: #fff;
  border-radius: 6px;
  font-size: 0.9rem;
  font-weight: 600;
  text-decoration: none;
  transition: background 0.2s;
  white-space: nowrap;
  padding: 8px 18px;
}

.clear-filters-btn:hover {
  background: #4b5563;
  text-decoration: none;
}