* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

@media (max-width: 768px) {
  .container {
    margin: 10px;
    border-radius: 10px;
  }

  .header h1 {
    font-size: 2rem;
  }

  .return-btn,
  .back-btn {
    position: static;
    margin: 10px auto 0;
    font-size: 0.9rem;
    padding: 10px 16px;
    justify-content: center;
  }

  .items-container {
    padding: 20px;
  }

  .item-content {
    flex-direction: column;
    gap: 15px;
    text-align: center;
  }
}

body {
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  min-height: 100vh;
  padding: 20px;
}

.container {
  max-width: 800px;
  margin: 0 auto;
  background: white;
  border-radius: 15px;
  box-shadow: 0 20px 40px rgba(0,0,0,0.1);
  overflow: hidden;
}

.header {
  background: linear-gradient(135deg, #ff6b6b, #ee5a24);
  color: white;
  padding: 30px;
  text-align: center;
  position: relative;
}

.header h1 {
  font-size: 2.5rem;
  margin-bottom: 10px;
  text-shadow: 0 2px 4px rgba(0,0,0,0.3);
}

.header p {
  font-size: 1.1rem;
  opacity: 0.9;
}

.return-btn {
  position: absolute;
  top: 20px;
  right: 20px;
  background: rgba(255,255,255,0.2);
  border: 2px solid rgba(255,255,255,0.3);
  color: white;
  padding: 12px 20px;
  border-radius: 25px;
  cursor: pointer;
  font-weight: 600;
  transition: all 0.3s ease;
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 8px;
}

.return-btn:hover {
  background: rgba(255,255,255,0.3);
  border-color: rgba(255,255,255,0.5);
  transform: translateY(-2px);
}

/* --- NOVÉ: tlačítko Zpět (levá strana headeru) --- */
.back-btn {
  position: absolute;
  top: 20px;
  left: 20px;
  background: rgba(255,255,255,0.2);
  border: 2px solid rgba(255,255,255,0.3);
  color: white;
  padding: 12px 20px;
  border-radius: 25px;
  cursor: pointer;
  font-weight: 600;
  transition: all 0.3s ease;
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 8px;
}

.back-btn:hover {
  background: rgba(255,255,255,0.3);
  border-color: rgba(255,255,255,0.5);
  transform: translateY(-2px);
}
/* --- /NOVÉ --- */

.items-container {
  padding: 30px;
}

.item-card {
  background: white;
  border-radius: 12px;
  margin-bottom: 15px;
  padding: 20px;
  box-shadow: 0 4px 15px rgba(0,0,0,0.08);
  border: 2px solid #f1f3f4;
  transition: all 0.3s ease;
  cursor: pointer;
  position: relative;
  overflow: hidden;
}

.item-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(0,0,0,0.15);
  border-color: #667eea;
}

.item-card.processing {
  opacity: 0.6;
  pointer-events: none;
}

.item-card.fade-out {
  animation: fadeOut 0.5s ease-out forwards;
}

@keyframes fadeOut {
  0% { opacity: 1; transform: translateY(0); }
  100% { opacity: 0; transform: translateY(-20px); }
}

.item-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 15px;
}

.item-left { flex: 1; }

.item-right {
  display: flex;
  align-items: center;
  gap: 15px;
}

.item-name {
  font-size: 1.3rem;
  font-weight: 600;
  color: #2c3e50;
  margin-bottom: 5px;
}

.item-table {
  font-size: 0.9rem;
  color: #7f8c8d;
  font-weight: 500;
}

.item-quantity {
  background: linear-gradient(135deg, #667eea, #764ba2);
  color: white;
  padding: 8px 16px;
  border-radius: 25px;
  font-weight: 600;
  font-size: 0.9rem;
  white-space: nowrap;
}

.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: #7f8c8d;
}

.empty-state i {
  font-size: 4rem;
  margin-bottom: 20px;
  color: #bdc3c7;
}

.empty-state h3 {
  font-size: 1.5rem;
  margin-bottom: 10px;
}

.loading-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0,0,0,0.5);
  display: none;
  justify-content: center;
  align-items: center;
  z-index: 1000;
}

.loading-spinner {
  width: 50px;
  height: 50px;
  border: 5px solid #f3f3f3;
  border-top: 5px solid #667eea;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

.success-message {
  background: #2ecc71;
  color: white;
  padding: 15px;
  border-radius: 8px;
  margin-bottom: 20px;
  display: none;
  animation: slideDown 0.3s ease-out;
}

.new-item-notification {
  background: #3498db;
  color: white;
  padding: 15px;
  border-radius: 8px;
  margin-bottom: 20px;
  display: none;
  animation: slideDown 0.3s ease-out;
}

.item-card.new-item {
  animation: slideInFromTop 0.5s ease-out;
  border-color: #3498db;
  box-shadow: 0 4px 15px rgba(52, 152, 219, 0.3);
}

@keyframes slideInFromTop {
  0% { opacity: 0; transform: translateY(-30px); }
  100% { opacity: 1; transform: translateY(0); }
}

.status-indicator {
  position: fixed;
  top: 20px;
  right: 20px;
  background: rgba(0,0,0,0.8);
  color: white;
  padding: 10px 15px;
  border-radius: 25px;
  font-size: 0.9rem;
  z-index: 999;
  display: none;
}

.status-indicator.checking { background: #f39c12; }
.status-indicator.connected { background: #27ae60; }

@keyframes slideDown {
  from { opacity: 0; transform: translateY(-20px); }
  to { opacity: 1; transform: translateY(0); }
}

.return-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0,0,0,0.5);
  display: none;
  justify-content: center;
  align-items: center;
  z-index: 2000;
}

.modal-content {
  background: white;
  border-radius: 15px;
  padding: 30px;
  max-width: 600px;
  max-height: 80vh;
  overflow-y: auto;
  margin: 20px;
  box-shadow: 0 20px 40px rgba(0,0,0,0.3);
}

.modal-header {
  text-align: center;
  margin-bottom: 20px;
}

.modal-header h2 {
  color: #2c3e50;
  margin-bottom: 10px;
}

.processed-item {
  background: #f8f9fa;
  border-radius: 10px;
  padding: 15px;
  margin-bottom: 10px;
  border-left: 4px solid #e74c3c;
  cursor: pointer;
  transition: all 0.3s ease;
}

.processed-item:hover {
  background: #e9ecef;
  transform: translateX(5px);
}

.processed-item-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.modal-buttons {
  display: flex;
  gap: 10px;
  justify-content: center;
  margin-top: 20px;
}

.btn {
  padding: 12px 24px;
  border: none;
  border-radius: 25px;
  cursor: pointer;
  font-weight: 600;
  transition: all 0.3s ease;
}

.btn-primary { background: #3498db; color: white; }
.btn-primary:hover { background: #2980b9; }

.btn-secondary { background: #95a5a6; color: white; }
.btn-secondary:hover { background: #7f8c8d; }

/* ==========================================================================
   index.php — Admin panel menu
   ========================================================================== */

.menu-wrap {
    padding: 40px 30px;
    text-align: center;
}

.menu-buttons {
    display: flex;
    flex-direction: column;
    gap: 15px;
    max-width: 400px;
    margin: 30px auto;
}

.menu-btn {
    border: none;
    border-radius: 25px;
    padding: 14px;
    font-weight: 700;
    cursor: pointer;
    font-size: 1rem;
    transition: all .25s ease;
    text-decoration: none;
    display: block;
}

.menu-btn.btn-primary {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
}

.menu-btn.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(102,126,234,.35);
}

.btn-danger {
    background: linear-gradient(135deg, #e74c3c, #c0392b);
    color: white;
}

.btn-danger:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(231,76,60,.35);
}

.menu-msg {
    max-width: 400px;
    margin: 0 auto 20px;
    padding: 12px;
    border-radius: 10px;
    font-weight: 600;
    text-align: center;
    background: rgba(46,204,113,0.15);
    border: 2px solid rgba(46,204,113,0.25);
    color: #27ae60;
}

/* ==========================================================================
   prihlaseni.php — Login
   ========================================================================== */

.login-wrap {
    padding: 40px 30px;
    text-align: center;
}

.login-card {
    max-width: 420px;
    margin: 0 auto;
    background: #fff;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.15);
    padding: 25px;
    text-align: left;
}

.login-card label {
    display: block;
    font-weight: 600;
    color: #2c3e50;
    margin: 12px 0 6px;
}

.login-card input {
    width: 100%;
    padding: 12px 14px;
    border-radius: 10px;
    border: 2px solid #e9ecef;
    font-size: 1rem;
    outline: none;
}

.login-card input:focus {
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102,126,234,0.15);
}

.login-btn {
    margin-top: 18px;
    width: 100%;
    border: none;
    border-radius: 25px;
    padding: 12px;
    font-weight: 700;
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: #fff;
    cursor: pointer;
    transition: all .25s ease;
}

.login-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(102,126,234,0.35);
}

.login-msg {
    max-width: 420px;
    margin: 0 auto 20px;
    padding: 12px;
    border-radius: 10px;
    font-weight: 600;
    text-align: center;
    background: rgba(231, 76, 60, 0.12);
    border: 2px solid rgba(231, 76, 60, 0.25);
    color: #c0392b;
}

@media (max-width: 768px) {
    .login-wrap { padding: 20px; }
}

/* ==========================================================================
   prehled.php — Dashboard
   ========================================================================== */

.content {
    padding: 30px;
}

.filters {
    display: flex;
    gap: 12px;
    justify-content: center;
    align-items: center;
    margin-bottom: 18px;
    flex-wrap: wrap;
}

.filters select {
    padding: 10px 12px;
    border-radius: 12px;
    border: 2px solid #e9ecef;
    outline: none;
    font-weight: 600;
}

.filters button {
    padding: 10px 14px;
    border-radius: 25px;
    border: none;
    cursor: pointer;
    font-weight: 700;
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: #fff;
    transition: all .25s ease;
}

.filters button:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(102,126,234,.35);
}

.grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px;
    margin-bottom: 18px;
}

.card {
    background: #fff;
    border: 2px solid #f1f3f4;
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.08);
    padding: 16px;
}

.card .k {
    color: #7f8c8d;
    font-weight: 700;
    font-size: .9rem;
}

.card .v {
    color: #2c3e50;
    font-weight: 800;
    font-size: 1.6rem;
    margin-top: 6px;
}

.card .i {
    color: #e67e22;
    margin-right: 6px;
}

.section {
    margin-top: 18px;
}

.section h2 {
    color: #2c3e50;
    margin: 0 0 10px;
    font-size: 1.2rem;
}

.content table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    overflow: hidden;
    border-radius: 12px;
    border: 2px solid #f1f3f4;
    background: #fff;
    box-shadow: 0 4px 15px rgba(0,0,0,0.08);
}

.content th,
.content td {
    padding: 10px 12px;
    text-align: left;
    border-bottom: 1px solid #f1f3f4;
    font-size: .95rem;
}

.content th {
    background: #f8f9fa;
    font-weight: 800;
    color: #2c3e50;
}

.content tr:last-child td {
    border-bottom: none;
}

.chart-wrap {
    background: #fff;
    border: 2px solid #f1f3f4;
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.08);
    padding: 16px;
}

.live-indicator {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    color: #fff;
    font-weight: 700;
    opacity: .9;
    margin-top: 8px;
}

.dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #2ecc71;
    box-shadow: 0 0 0 rgba(46, 204, 113, 0.6);
    animation: pulse 1.6s infinite;
}

@keyframes pulse {
    0% { box-shadow: 0 0 0 0 rgba(46,204,113,.6); }
    70% { box-shadow: 0 0 0 10px rgba(46,204,113,0); }
    100% { box-shadow: 0 0 0 0 rgba(46,204,113,0); }
}

@media (max-width: 900px) {
    .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 768px) {
    .content { padding: 20px; }
}

/* ==========================================================================
   zmenhesl.php — Zmena hesla
   ========================================================================== */

.form-wrap {
    padding: 30px;
    text-align: center;
}

.form-card {
    max-width: 420px;
    margin: 0 auto;
    background: #fff;
    border: 2px solid #f1f3f4;
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.08);
    padding: 22px;
    text-align: left;
}

.form-card label {
    display: block;
    font-weight: 600;
    color: #2c3e50;
    margin: 10px 0 6px;
}

.form-card input[type="password"] {
    width: 100%;
    padding: 12px 14px;
    border-radius: 10px;
    border: 2px solid #e9ecef;
    outline: none;
    font-size: 1rem;
}

.form-card input[type="password"]:focus {
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102,126,234,0.15);
}

.actions {
    display: flex;
    gap: 10px;
    justify-content: center;
    margin-top: 16px;
}

.btn-pill {
    border: none;
    border-radius: 25px;
    padding: 12px 20px;
    font-weight: 700;
    cursor: pointer;
    transition: all .25s ease;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.btn-pill.btn-primary {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: #fff;
    box-shadow: 0 8px 20px rgba(102,126,234,0.25);
}

.btn-pill.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 25px rgba(102,126,234,0.35);
}

.msg {
    max-width: 420px;
    margin: 0 auto 14px;
    border-radius: 10px;
    padding: 12px 14px;
    font-weight: 600;
    text-align: center;
}

.msg.ok {
    background: rgba(46, 204, 113, 0.14);
    border: 2px solid rgba(46, 204, 113, 0.25);
    color: #1e7e34;
}

.msg.err {
    background: rgba(231, 76, 60, 0.12);
    border: 2px solid rgba(231, 76, 60, 0.22);
    color: #c0392b;
}
