/* =====================================================================
   Backstage — administrace. Čistý, světlý, Apple-like vzhled.
   ===================================================================== */

:root {
  --bg: #f5f5f7;
  --panel: #ffffff;
  --ink: #1d1d1f;
  --muted: #6e6e73;
  --line: #e5e5ea;
  --accent: #0071e3;
  --accent-ink: #ffffff;
  --danger: #ff3b30;
  --ok: #34c759;
  --radius: 16px;
  --radius-sm: 10px;
  --shadow: 0 1px 3px rgba(0,0,0,.06), 0 8px 30px rgba(0,0,0,.06);
  --sidebar-w: 248px;
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto,
          Helvetica, Arial, sans-serif;
}

* { box-sizing: border-box; }

html, body { margin: 0; padding: 0; }

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--ink);
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ---------- Layout ---------- */
.layout { display: flex; min-height: 100vh; }

.sidebar {
  width: var(--sidebar-w);
  flex: 0 0 var(--sidebar-w);
  background: #fbfbfd;
  border-right: 1px solid var(--line);
  padding: 22px 16px;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
}

.brand {
  display: flex; align-items: center; gap: 10px;
  font-weight: 700; font-size: 19px; letter-spacing: -.02em;
  padding: 6px 10px 18px;
}
.brand .dot {
  width: 26px; height: 26px; border-radius: 50%;
  background: linear-gradient(135deg, #0a84ff, #64d2ff);
  box-shadow: inset 0 0 0 2px rgba(255,255,255,.4);
}
.brand small { display:block; font-weight:500; font-size:11px; color:var(--muted); letter-spacing:0; }

.nav { display: flex; flex-direction: column; gap: 2px; }
.nav a {
  display: flex; align-items: center; gap: 11px;
  padding: 9px 12px; border-radius: var(--radius-sm);
  color: var(--ink); font-weight: 500; text-decoration: none;
}
.nav a:hover { background: rgba(0,0,0,.04); text-decoration: none; }
.nav a.active { background: var(--accent); color: var(--accent-ink); }
.nav a.active .ic { opacity: 1; }
.nav .ic { width: 18px; text-align: center; opacity: .65; }
.nav .sep { height: 1px; background: var(--line); margin: 12px 6px; }

.main { flex: 1; min-width: 0; padding: 30px 40px 80px; }

.topbar {
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px; margin-bottom: 26px;
}
.topbar h1 { font-size: 26px; letter-spacing: -.02em; margin: 0; }
.topbar .sub { color: var(--muted); font-size: 13px; margin-top: 2px; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 7px;
  background: var(--accent); color: #fff; border: none;
  padding: 9px 16px; border-radius: 980px; font-size: 14px; font-weight: 500;
  cursor: pointer; font-family: var(--font); text-decoration: none;
  transition: transform .06s ease, opacity .15s ease;
}
.btn:hover { opacity: .9; text-decoration: none; }
.btn:active { transform: scale(.97); }
.btn.secondary { background: rgba(0,0,0,.06); color: var(--ink); }
.btn.ghost { background: transparent; color: var(--accent); padding: 9px 10px; }
.btn.danger { background: var(--danger); }
.btn.sm { padding: 6px 12px; font-size: 13px; }
.btn[disabled] { opacity: .5; cursor: not-allowed; }

/* ---------- Cards / panels ---------- */
.panel {
  background: var(--panel); border: 1px solid var(--line);
  border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 24px;
}
.panel + .panel { margin-top: 22px; }
.panel h2 { margin: 0 0 16px; font-size: 18px; letter-spacing: -.01em; }

.grid { display: grid; gap: 18px; }
.grid.cards { grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); }
.stat-grid { grid-template-columns: repeat(auto-fit, minmax(160px,1fr)); }

.stat {
  background: var(--panel); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 18px 20px; box-shadow: var(--shadow);
}
.stat .num { font-size: 30px; font-weight: 700; letter-spacing: -.02em; }
.stat .lbl { color: var(--muted); font-size: 13px; }

/* ---------- Item card (band/album/song) ---------- */
.item-card {
  background: var(--panel); border: 1px solid var(--line);
  border-radius: var(--radius); box-shadow: var(--shadow);
  overflow: hidden; display: flex; flex-direction: column;
}
.item-card .thumb {
  aspect-ratio: 1 / 1; background: #ececf0 center/cover no-repeat;
  display: flex; align-items: center; justify-content: center;
  color: #c7c7cc; font-size: 40px;
}
.item-card .body { padding: 14px 16px; }
.item-card .body h3 { margin: 0 0 3px; font-size: 16px; }
.item-card .body .meta { color: var(--muted); font-size: 13px; }
.item-card .actions {
  display: flex; gap: 8px; padding: 0 16px 16px; margin-top: auto;
}

/* ---------- Forms ---------- */
.form-row { margin-bottom: 18px; }
.form-row label { display: block; font-weight: 600; margin-bottom: 6px; font-size: 14px; }
.form-row .hint { color: var(--muted); font-size: 12px; margin-top: 5px; }
.cols { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }

input[type=text], input[type=email], input[type=password], input[type=number],
input[type=search], select, textarea {
  width: 100%; padding: 11px 13px; font-size: 15px; font-family: var(--font);
  border: 1px solid var(--line); border-radius: var(--radius-sm);
  background: #fff; color: var(--ink); transition: border-color .15s, box-shadow .15s;
}
input:focus, select:focus, textarea:focus {
  outline: none; border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(0,113,227,.18);
}
textarea { resize: vertical; min-height: 90px; }
textarea.lyrics { min-height: 240px; font-family: ui-monospace, "SF Mono", Menlo, monospace; }

input[type=file] {
  width: 100%; padding: 10px; border: 1px dashed var(--line);
  border-radius: var(--radius-sm); background: #fafafc; font-size: 14px;
}

.switch { display: inline-flex; align-items: center; gap: 10px; cursor: pointer; }
.switch input { display: none; }
.switch .track {
  width: 46px; height: 28px; background: #d1d1d6; border-radius: 980px;
  position: relative; transition: background .2s;
}
.switch .track::after {
  content: ""; position: absolute; top: 3px; left: 3px;
  width: 22px; height: 22px; background: #fff; border-radius: 50%;
  box-shadow: 0 1px 3px rgba(0,0,0,.3); transition: transform .2s;
}
.switch input:checked + .track { background: var(--ok); }
.switch input:checked + .track::after { transform: translateX(18px); }

.form-actions { display: flex; gap: 10px; align-items: center; margin-top: 8px; }

/* ---------- Table ---------- */
.table { width: 100%; border-collapse: collapse; }
.table th, .table td { padding: 12px 10px; text-align: left; border-bottom: 1px solid var(--line); }
.table th { font-size: 12px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }
.table tr:last-child td { border-bottom: none; }
.table .tcover { width: 44px; height: 44px; border-radius: 8px; object-fit: cover; background:#ececf0; }

/* ---------- Badges ---------- */
.badge {
  display: inline-block; padding: 2px 9px; border-radius: 980px;
  font-size: 11px; font-weight: 600; background: rgba(0,0,0,.06); color: var(--muted);
}
.badge.public { background: rgba(52,199,89,.15); color: #1f8a3b; }
.badge.private { background: rgba(255,149,0,.15); color: #b25e00; }

/* ---------- Flash ---------- */
.flash-wrap { margin-bottom: 20px; display: flex; flex-direction: column; gap: 10px; }
.flash {
  padding: 12px 16px; border-radius: var(--radius-sm); font-weight: 500;
  border: 1px solid transparent;
}
.flash.success { background: rgba(52,199,89,.12); color: #1f8a3b; border-color: rgba(52,199,89,.3); }
.flash.error   { background: rgba(255,59,48,.10);  color: #c4271d; border-color: rgba(255,59,48,.3); }
.flash.info    { background: rgba(0,113,227,.10);  color: #0058b0; border-color: rgba(0,113,227,.3); }

.empty {
  text-align: center; padding: 60px 20px; color: var(--muted);
}
.empty .big { font-size: 44px; margin-bottom: 10px; }

/* ---------- Auth pages ---------- */
.auth-wrap {
  min-height: 100vh; display: flex; align-items: center; justify-content: center;
  background: radial-gradient(1200px 600px at 50% -10%, #e8f0ff, var(--bg));
  padding: 24px;
}
.auth-card {
  width: 100%; max-width: 400px; background: var(--panel);
  border: 1px solid var(--line); border-radius: 22px; box-shadow: var(--shadow);
  padding: 36px 32px;
}
.auth-card .brand { justify-content: center; padding: 0 0 14px; }
.auth-card h1 { font-size: 22px; text-align: center; margin: 0 0 4px; letter-spacing: -.02em; }
.auth-card p.lead { text-align: center; color: var(--muted); margin: 0 0 24px; font-size: 14px; }
.auth-card .btn { width: 100%; justify-content: center; padding: 12px; }

/* ---------- Drag & drop organizer ---------- */
.organize { display: grid; gap: 18px; grid-template-columns: repeat(auto-fill, minmax(300px,1fr)); align-items: start; }
.bucket {
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow); display: flex; flex-direction: column; min-height: 120px;
}
.bucket > header {
  padding: 14px 16px; border-bottom: 1px solid var(--line);
  display: flex; align-items: center; gap: 10px; font-weight: 600;
}
.bucket > header img { width: 34px; height: 34px; border-radius: 7px; object-fit: cover; background:#ececf0; }
.bucket .drop {
  padding: 10px; display: flex; flex-direction: column; gap: 8px; min-height: 60px;
  flex: 1; transition: background .15s;
}
.bucket .drop.dragover { background: rgba(0,113,227,.08); }
.chip {
  display: flex; align-items: center; gap: 10px; padding: 9px 12px;
  background: #fbfbfd; border: 1px solid var(--line); border-radius: var(--radius-sm);
  cursor: grab; user-select: none;
}
.chip:active { cursor: grabbing; }
.chip.dragging { opacity: .4; }
.chip .grip { color: #c7c7cc; }
.chip .ctitle { flex: 1; font-weight: 500; font-size: 14px; }
.chip .cdur { color: var(--muted); font-size: 12px; }
.bucket .empty-drop { color: var(--muted); font-size: 13px; text-align: center; padding: 16px; }

/* ---------- Misc ---------- */
.muted { color: var(--muted); }
.row-between { display: flex; align-items: center; justify-content: space-between; gap: 14px; }
.preview-img { max-width: 140px; border-radius: 10px; margin-top: 10px; display: block; }
hr.soft { border: none; border-top: 1px solid var(--line); margin: 24px 0; }

@media (max-width: 820px) {
  .sidebar { position: fixed; transform: translateX(-100%); z-index: 50; transition: transform .25s; }
  .sidebar.open { transform: none; }
  .main { padding: 20px 18px 80px; }
  .cols { grid-template-columns: 1fr; }
  .menu-toggle { display: inline-flex !important; }
}
.menu-toggle { display: none; }
