/* =========================================
   GLOBÁLNÍ ZÁKLAD (Distape Style)
   ========================================= */
html { box-sizing: border-box; }
*, *:before, *:after { box-sizing: inherit; margin: 0; padding: 0; }

body { 
  font-family: 'Inter', sans-serif; 
  background: #000; 
  color: #fff; 
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  line-height: 1.5;
}

a { text-decoration: none; color: inherit; transition: 0.3s; }
button { font-family: 'Inter', sans-serif; cursor: pointer; outline: none; }
hr { border: 0; border-top: 1px solid #222; margin: 25px 0; }

/* =========================================
   LOGIN & ACCESS DENIED
   ========================================= */
.login-wrapper { flex: 1; display: flex; align-items: center; justify-content: center; background: radial-gradient(circle at top, rgba(124, 58, 237, 0.15) 0%, #000 70%); padding: 20px; }
.login-card { background: #111; border: 1px solid #222; border-radius: 20px; padding: 40px; width: 100%; max-width: 400px; box-shadow: 0 10px 30px rgba(0,0,0,0.5); text-align: center; }
.login-card img { max-width: 180px; margin-bottom: 30px; }
.login-card h2 { font-size: 24px; font-weight: 800; margin-bottom: 10px; letter-spacing: 1px; }
.subtitle { color: #aaa; font-size: 14px; margin-bottom: 30px; }

.access-denied-container { display: flex; flex-direction: column; align-items: center; justify-content: center; height: 70vh; text-align: center; color: #fff; }
.access-denied-card { background: #1a1a1a; border: 1px solid #333; padding: 50px; border-radius: 25px; box-shadow: 0 20px 50px rgba(0,0,0,0.5); max-width: 500px; }
.access-denied-card h1 { margin: 0 0 15px 0; font-size: 28px; font-weight: 800; }
.access-denied-card p { color: #888; font-size: 16px; line-height: 1.6; margin-bottom: 30px; }
.icon-lock { font-size: 60px; margin-bottom: 20px; color: #7c3aed; }

/* =========================================
   LAYOUT ADMINISTRACE
   ========================================= */
.dashboard-container { display: flex; flex: 1; overflow: hidden; }

.sidebar { width: 260px; background: #0a0a0a; border-right: 1px solid #222; padding: 30px 20px; flex-shrink: 0; overflow-y: auto; }
.sidebar h3 { font-size: 11px; color: #555; text-transform: uppercase; letter-spacing: 2px; margin: 25px 0 15px 0; font-weight: 800; }
.sidebar ul { list-style: none; }
.sidebar ul li a { display: block; padding: 12px 15px; color: #aaa; border-radius: 10px; margin-bottom: 5px; font-weight: 600; transition: 0.2s; }
.sidebar ul li a:hover { background: rgba(124, 58, 237, 0.1); color: #7c3aed; }
.sidebar ul li a.active { background: #7c3aed; color: #fff; }

.main-content { flex: 1; padding: 40px; background: #000; overflow-y: auto; overflow-x: hidden; }

.admin-header, .card-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 30px; }
.card-header { padding-bottom: 15px; border-bottom: 1px solid #222; }
.card-header h1 { margin: 0; font-size: 24px; color: #fff; font-weight: 800; }

/* KARTY (Sjednoceno) */
.content-card, .log-card, .settings-card { background: #151515; border: 1px solid #252525; border-radius: 24px; padding: 30px; margin-bottom: 25px; box-shadow: 0 20px 50px rgba(0,0,0,0.5); }
.settings-container { display: flex; justify-content: center; align-items: center; padding: 40px 20px; }
.settings-card { width: 100%; max-width: 400px; animation: fadeInSlide 0.4s ease-out; }
@keyframes fadeInSlide { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: translateY(0); } }

/* =========================================
   TABULKY (Upraveno pro lepší responzivitu)
   ========================================= */
.table-responsive { width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; margin-bottom: 15px; }

.admin-table, .log-table, .user-table, .event-table { width: 100%; border-collapse: collapse; min-width: 650px; }
.admin-table th, .log-table th, .user-table th, .event-table th { text-align: left; color: #666; font-size: 11px; text-transform: uppercase; padding: 15px; letter-spacing: 1.5px; border-bottom: 2px solid #222; font-weight: 800; }
.admin-table td, .log-table td, .user-table td, .event-table td { padding: 15px; border-bottom: 1px solid #1f1f1f; color: #ccc; font-size: 14px; vertical-align: middle; }
.admin-table tr:hover td, .log-table tr:hover td, .user-table tr:hover td, .event-table tr:hover td { background: rgba(255,255,255,0.02); }

.table-row-storno { opacity: 0.4; }
.table-row-storno td { text-decoration: line-through; }
.table-row-storno .no-strike { text-decoration: none !important; display: inline-block; }

.event-thumb { width: 50px; height: 50px; border-radius: 10px; object-fit: cover; background: #222; margin-right: 15px; border: 1px solid #333; }

/* =========================================
   FORMULÁŘE & INPUTY
   ========================================= */
.form-row { display: flex; gap: 15px; margin-bottom: 20px; flex-wrap: wrap; }
/* Oprava flexboxu na mobilech - zvětšen min-width na 200px */
.form-group { flex: 1; min-width: 200px; margin-bottom: 20px; text-align: left; }
.form-group label { display: block; font-size: 10px; font-weight: 800; color: #555; text-transform: uppercase; margin-bottom: 8px; letter-spacing: 0.5px; }

input, select { width: 100%; padding: 14px 16px; background: #050505; border: 1px solid #222; color: #fff; border-radius: 12px; font-size: 14px; box-sizing: border-box; outline: none; transition: 0.3s; }
input:focus, select:focus { border-color: #7c3aed; background: #080808; box-shadow: 0 0 0 4px rgba(124, 58, 237, 0.1); }

select { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='%237c3aed' viewBox='0 0 16 16'%3E%3Cpath d='M7.247 11.14 2.451 5.658C1.885 5.013 2.345 4 3.204 4h9.592a1 1 0 0 1 .753 1.659l-4.796 5.48a1 1 0 0 1-1.506 0z'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 18px center; cursor: pointer; }

/* Custom Toggle Status */
.status-picker { display: flex; background: #050505; border: 1px solid #222; border-radius: 14px; padding: 4px; gap: 4px; }
.status-option { flex: 1; position: relative; }
.status-option input { position: absolute; opacity: 0; cursor: pointer; height: 0; width: 0; }
.status-label { display: block; padding: 12px; text-align: center; border-radius: 10px; font-size: 12px; font-weight: 800; color: #444; cursor: pointer; transition: 0.3s; text-transform: uppercase; }
.status-option input[value="1"]:checked + .status-label { background: rgba(25, 224, 64, 0.15); color: #19e040; }
.status-option input[value="0"]:checked + .status-label { background: #222; color: #fff; }

/* Search Box */
.search-box { position: relative; display: flex; align-items: center; }
.search-box input { padding: 10px 15px 10px 40px; background: #0a0a0a; border: 1px solid #333; width: 220px; transition: 0.3s; }
.search-box input:focus { width: 280px; }
.search-icon { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: #444; font-size: 14px; pointer-events: none; }

/* =========================================
   TLAČÍTKA
   ========================================= */
.btn-login, .btn-primary, .btn-add, .btn-update, .btn-back { width: 100%; padding: 14px; background: #7c3aed; border: none; border-radius: 12px; color: #fff; font-weight: 800; font-size: 14px; text-transform: uppercase; letter-spacing: 1px; transition: 0.3s; text-align: center; display: inline-block; cursor: pointer; }
.btn-add, .btn-back { width: auto; padding: 12px 24px; }
.btn-login:hover, .btn-primary:hover, .btn-add:hover, .btn-update:hover, .btn-back:hover { background: #6d28d9; transform: translateY(-2px); box-shadow: 0 8px 20px rgba(124, 58, 237, 0.3); }

.btn-save { background: #19e040; color: #000; width: 100%; padding: 16px; border-radius: 14px; font-weight: 800; border: none; text-transform: uppercase; letter-spacing: 1px; margin-top: 10px; transition: 0.3s; }
.btn-save:hover { background: #15c538; transform: translateY(-2px); box-shadow: 0 8px 20px rgba(25, 224, 64, 0.3); }

/* Malá tabulková tlačítka */
.btn-action { padding: 8px 12px; border-radius: 10px; font-weight: 700; font-size: 11px; display: inline-flex; align-items: center; transition: 0.2s; border: 1px solid transparent; }
.btn-edit { background: #222; color: #fff; border-color: #333; margin-right: 5px; }
.btn-edit:hover { background: #7c3aed; border-color: #7c3aed; }
.btn-delete { background: rgba(239, 68, 68, 0.05); color: #ef4444; border-color: rgba(239, 68, 68, 0.2); }
.btn-delete:hover { background: #ef4444; color: #fff; border-color: #ef4444; box-shadow: 0 4px 12px rgba(239, 68, 68, 0.3); }
.action-view { color: #666; transition: 0.2s; display: inline-block; }
.action-view:hover { color: #7c3aed; transform: scale(1.1); }

.btn-reset { background: transparent; color: #666; border: 1px solid #222; width: 100%; padding: 12px; margin-bottom: 25px; border-radius: 12px; font-size: 12px; font-weight: 700; display: block; text-align: center; transition: 0.2s; }
.btn-reset:hover { border-color: #7c3aed; color: #fff; }

/* =========================================
   MODÁLNÍ OKNA (Opraveno pro display: block)
   ========================================= */
.modal { display: none; position: fixed; z-index: 1000; left: 0; top: 0; width: 100%; height: 100%; background: rgba(0,0,0,0.85); backdrop-filter: blur(10px); overflow-y: auto; padding: 20px; }

/* Změna - vycentrování pomocí marginu místo flexboxu, plynulý pop-up pomocí keyframes */
.modal-content { background: #0f0f0f; width: 100%; max-width: 500px; margin: 5vh auto; border: 1px solid #222; border-radius: 30px; display: flex; flex-direction: column; overflow: hidden; animation: modalPop 0.3s cubic-bezier(0.16, 1, 0.3, 1); }

@keyframes modalPop { 
  from { transform: translateY(30px) scale(0.95); opacity: 0; } 
  to { transform: translateY(0) scale(1); opacity: 1; } 
}

.modal-header { padding: 30px; text-align: center; border-bottom: 1px solid #1a1a1a; }
.modal-body { padding: 30px; overflow-y: auto; scrollbar-width: thin; scrollbar-color: #333 #0f0f0f; }

/* =========================================
   BADGES & NOTIFIKACE
   ========================================= */
.badge, .status-pill, .status-badge { padding: 4px 10px; border-radius: 6px; font-size: 10px; font-weight: 800; text-transform: uppercase; margin-right: 5px; border: 1px solid rgba(255,255,255,0.05); display: inline-block; letter-spacing: 0.5px; }

.bg-event { background: rgba(124, 58, 237, 0.1); color: #a78bfa; border-color: rgba(124, 58, 237, 0.2); }
.bg-user { background: rgba(59, 130, 246, 0.1); color: #60a5fa; border-color: rgba(59, 130, 246, 0.2); }
.bg-storno, .badge-storno { background: rgba(239, 68, 68, 0.1); color: #f87171; border-color: rgba(239, 68, 68, 0.2); }
.badge-ok { background: rgba(16, 185, 129, 0.1); color: #10b981; border-color: rgba(16, 185, 129, 0.2); }

.alert-toast { position: fixed; top: 20px; left: 50%; transform: translateX(-50%); background: #19e040; color: #000; padding: 12px 28px; border-radius: 50px; font-weight: 800; box-shadow: 0 10px 40px rgba(25, 224, 64, 0.25); z-index: 9999; animation: slideDown 0.4s cubic-bezier(0.18, 0.89, 0.32, 1.28) forwards; transition: opacity 0.3s ease; }
@keyframes slideDown { from { top: -80px; opacity: 0; } to { top: 20px; opacity: 1; } }

.msg { padding: 12px; border-radius: 12px; margin-bottom: 25px; font-size: 13px; font-weight: 700; text-align: center; }
.msg-success { background: rgba(25, 224, 64, 0.1); color: #19e040; border: 1px solid rgba(25, 224, 64, 0.2); }
.msg-error, .error-msg { background: rgba(239, 68, 68, 0.1); color: #ef4444; border: 1px solid rgba(239, 68, 68, 0.2); }

/* =========================================
   REPORTY A STATISTIKY
   ========================================= */
.report-section { background: #1a1a1a; border: 1px solid #333; border-radius: 16px; padding: 25px; margin-bottom: 25px; }
.report-section h2 { margin-top: 0; font-size: 15px; color: #7c3aed; border-bottom: 1px solid #222; padding-bottom: 15px; margin-bottom: 20px; text-transform: uppercase; letter-spacing: 1px; }
.stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 20px; }
.stat-item { display: flex; flex-direction: column; }
.stat-label { font-size: 11px; color: #888; text-transform: uppercase; margin-bottom: 5px; font-weight: 800; }
.stat-value { font-size: 28px; font-weight: 800; color: #fff; }
.money-green { color: #19e040 !important; }
.highlight-purple { color: #a855f7 !important; }
.warning-red { color: #ef4444 !important; }
.sub-detail { font-size: 12px; color: #555; margin-top: 6px; font-style: italic; }

/* =========================================
   FOOTER & RESPONSIVITA
   ========================================= */
footer { border-top: 1px solid #222; text-align: center; padding: 25px; color: #666; font-size: 13px; margin-top: auto; }

@media (max-width: 850px) {
  .dashboard-container { flex-direction: column; overflow: visible; }
  .sidebar { width: 100%; border-right: none; border-bottom: 1px solid #222; padding: 20px; }
  .sidebar ul { display: flex; flex-wrap: wrap; gap: 10px; }
  .sidebar ul li { flex: 1; min-width: 120px; }
  .main-content { padding: 20px; overflow-x: hidden; }
  /* Full-width search input on small mobile screens */
  .search-box input { width: 100%; }
  .search-box input:focus { width: 100%; }
}