.admin-wrapper { display: none; }
.admin-wrapper.visible { 
    display: flex; 
    position: fixed;     /* Přišpendlí panel na obrazovku */
    top: 0;
    left: 0;
    width: 100vw;        /* Roztáhne ho na celou šířku */
    height: 100vh;       /* Roztáhne ho na celou výšku */
    z-index: 999999;     /* Vyhodí ho nad úplně všechny prvky na webu (včetně popupů) */
    overflow-y: auto;    /* Pokud se obsah nevejde, umožní v panelu scrollovat */
}
.admin-sidebar { width: 240px; flex-shrink: 0; background: var(--navy); min-height: calc(100vh - 68px); padding: 1.5rem 1rem; }
.admin-sidebar-title { color: rgba(255,255,255,.35); font-size: .72rem; text-transform: uppercase; letter-spacing: .1em; font-weight: 700; padding: .5rem .75rem; margin-bottom: .25rem; }
.admin-sidebar a, .admin-sidebar-link { display: flex; align-items: center; gap: .65rem; color: rgba(255,255,255,.65); font-size: .9rem; padding: .65rem .75rem; border-radius: 8px; text-decoration: none; cursor: pointer; transition: all .2s; margin-bottom: .15rem; font-family: 'Outfit', sans-serif; border: none; background: none; width: 100%; text-align: left; }
.admin-sidebar a:hover, .admin-sidebar-link:hover,
.admin-sidebar a.active, .admin-sidebar-link.active { background: rgba(255,255,255,.1); color: white; }
.admin-sidebar a.active, .admin-sidebar-link.active { color: #7eb8f7; background: rgba(126,184,247,.1); }
.admin-main { flex: 1; padding: 2rem; background: var(--off-white); min-height: calc(100vh - 68px); }
.admin-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 2rem; }
.admin-header h1 { font-size: 1.5rem; font-weight: 700; color: var(--navy); }

/* STATS */
.admin-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1rem; margin-bottom: 2rem; }
.stat-card { background: var(--white); border: 1px solid var(--border); border-radius: 12px; padding: 1.25rem; display: flex; align-items: center; gap: 1rem; }
.stat-icon { width: 44px; height: 44px; border-radius: 10px; display: flex; align-items: center; justify-content: center; font-size: 1.3rem; flex-shrink: 0; }
.stat-icon.blue { background: rgba(30,95,168,.1); }
.stat-icon.green { background: rgba(26,158,92,.1); }
.stat-val { font-size: 1.6rem; font-weight: 700; color: var(--navy); line-height: 1; }
.stat-label { font-size: .8rem; color: var(--text-muted); margin-top: .2rem; }
.admin-table-wrap { background: var(--white); border: 1px solid var(--border); border-radius: 14px; overflow: hidden; margin-bottom: 2rem; }
.admin-table-head { padding: 1.25rem 1.5rem; border-bottom: 1px solid var(--border); display: flex; align-items: center; justify-content: space-between; }
.admin-table-head h3 { font-size: 1rem; font-weight: 700; color: var(--navy); }
table.admin-table { width: 100%; border-collapse: collapse; }
table.admin-table th { text-align: left; padding: .75rem 1.5rem; font-size: .78rem; text-transform: uppercase; letter-spacing: .07em; color: var(--text-muted); font-weight: 600; background: var(--off-white); border-bottom: 1px solid var(--border); }
table.admin-table td { padding: .9rem 1.5rem; font-size: .9rem; color: var(--text); border-bottom: 1px solid var(--border); }
table.admin-table tr:last-child td { border-bottom: none; }
table.admin-table tr:hover td { background: #f9fafc; }
.status-badge { padding: .25rem .7rem; border-radius: 20px; font-size: .75rem; font-weight: 700; }
.status-badge.open { background: #dcfce7; color: #15803d; }
.status-badge.closed { background: #fee2e2; color: #b91c1c; }

.admin-edit-form { background: var(--white); border: 1px solid var(--border); border-radius: 14px; padding: 2rem; margin-bottom: 1.5rem; }
.admin-edit-form h2 { font-size: 1.1rem; font-weight: 700; color: var(--navy); margin-bottom: 1.25rem; display: flex; align-items: center; gap: .6rem; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1.25rem; }
.form-group.full { grid-column: 1 / -1; }

.popup-toggle-row { display: flex; align-items: center; gap: 1rem; margin-bottom: 1.5rem; padding: 1rem 1.25rem; background: var(--off-white); border: 1px solid var(--border); border-radius: 10px; }
.toggle-switch { position: relative; display: inline-block; width: 48px; height: 26px; flex-shrink: 0; }
.toggle-switch input { opacity: 0; width: 0; height: 0; }
.toggle-slider { position: absolute; cursor: pointer; inset: 0; background: #ccc; border-radius: 26px; transition: .3s; }
.toggle-slider:before { position: absolute; content: ''; height: 18px; width: 18px; left: 4px; bottom: 4px; background: white; border-radius: 50%; transition: .3s; }
input:checked + .toggle-slider { background: var(--blue); }
input:checked + .toggle-slider:before { transform: translateX(22px); }
.toggle-label { font-size: .95rem; font-weight: 600; color: var(--navy); }
.popup-active-badge { background: #dcfce7; color: #15803d; padding: .2rem .7rem; border-radius: 20px; font-size: .75rem; font-weight: 700; }
.popup-inactive-badge { background: #f1f5f9; color: var(--text-muted); padding: .2rem .7rem; border-radius: 20px; font-size: .75rem; font-weight: 700; }
.popup-hours-section { border: 1px solid var(--border); border-radius: 10px; overflow: hidden; margin-top: 1rem; }
.popup-hours-row { display: grid; grid-template-columns: 120px 1fr 120px; gap: 1rem; align-items: center; padding: .75rem 1rem; border-bottom: 1px solid var(--border); background: var(--white); }
.popup-hours-row:last-child { border-bottom: none; }
.popup-hours-row label { font-weight: 600; color: var(--navy); font-size: .9rem; }
.popup-hours-row input[type=text] { border: 1.5px solid var(--border); border-radius: 7px; padding: .5rem .8rem; font-family: 'Outfit', sans-serif; font-size: .88rem; color: var(--text); outline: none; }
.popup-hours-row input[type=text]:focus { border-color: var(--blue); }
.popup-hours-row input[type=checkbox] { width: 16px; height: 16px; cursor: pointer; accent-color: var(--blue); }
.closed-check-label { display: flex; align-items: center; gap: .5rem; font-size: .85rem; color: var(--text-muted); cursor: pointer; }
.popup-section-title { font-size: .82rem; font-weight: 700; text-transform: uppercase; letter-spacing: .07em; color: var(--text-muted); margin: 1.25rem 0 .5rem; }

.pages-toggle-row { display: flex; justify-content: space-between; align-items: center; padding: .9rem 1.5rem; border-bottom: 1px solid var(--border); }
.pages-toggle-row:last-child { border-bottom: none; }
.pages-toggle-row span { font-size: .95rem; font-weight: 600; color: var(--navy); }

.photo-upload-area { border: 2px dashed var(--border); border-radius: 12px; padding: 2.5rem; text-align: center; cursor: pointer; transition: all .2s; background: var(--off-white); margin-bottom: 1.5rem; }
.photo-upload-area:hover { border-color: var(--blue); background: rgba(30,95,168,.03); }
.photo-upload-area p { color: var(--text-muted); font-size: .9rem; margin-top: .5rem; }
.photo-upload-area .upload-icon { font-size: 2rem; }
.admin-photo-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 1rem; margin-top: 1.5rem; }
.admin-photo-item { border: 1px solid var(--border); border-radius: 10px; overflow: hidden; background: var(--white); }
.admin-photo-item img { width: 100%; height: 130px; object-fit: cover; display: block; }
.admin-photo-item-info { padding: .6rem .75rem; }
.admin-photo-item-info input { width: 100%; border: 1px solid var(--border); border-radius: 6px; padding: .35rem .5rem; font-family: 'Outfit', sans-serif; font-size: .8rem; color: var(--text); outline: none; margin-bottom: .4rem; }
.admin-photo-item-info select { width: 100%; border: 1px solid var(--border); border-radius: 6px; padding: .35rem .5rem; font-family: 'Outfit', sans-serif; font-size: .8rem; color: var(--text); outline: none; margin-bottom: .5rem; }
.photo-actions { display: flex; gap: .4rem; }
.photo-actions button { flex: 1; padding: .3rem; border: none; border-radius: 6px; cursor: pointer; font-size: .75rem; font-family: 'Outfit', sans-serif; font-weight: 600; }
.photo-actions .btn-upd { background: var(--blue); color: white; }
.photo-actions .btn-del { background: var(--danger); color: white; }

@media (max-width: 900px) {
  .admin-stats { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 600px) {
  .admin-wrapper { flex-direction: column; }
  .admin-sidebar { width: 100%; min-height: auto; }
  .form-grid { grid-template-columns: 1fr; }
  .popup-hours-row { grid-template-columns: 100px 1fr 100px; }
}