/* ===== LUMA Creative paleta ===== */
:root {
  --ivory: #faf8f2;
  --ivory-soft: #f3efe4;
  --gold: #f5c45e;
  --gold-deep: #e0a93f;
  --glow-1: #fbe2a7;
  --glow-2: #f5c45e;
  --night: #1a1a1f;
  --night-2: #26262d;
  --whisper: #e7e4da;
  --grey: #8a8780;
  --ink: #2a2925;
  --line: #e4e0d4;
  --white: #ffffff;
  --crit: #d9534f;
  --high: #e8833a;
  --med: #d8a93a;
  --low: #6aa88a;
  --shadow: 0 12px 40px -18px rgba(40, 35, 20, 0.35);
  --radius: 16px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
body {
  font-family: "Inter", system-ui, sans-serif;
  background: var(--ivory);
  color: var(--ink);
  display: flex;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}
button { font-family: inherit; cursor: pointer; }
.hidden { display: none !important; }
.muted { color: var(--grey); font-size: 14px; }

/* ===== Sidebar ===== */
.sidebar {
  width: 250px;
  flex-shrink: 0;
  background: var(--night);
  color: var(--ivory);
  padding: 28px 22px;
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
}
.brand-luma {
  font-family: "Fraunces", serif;
  font-size: 26px;
  letter-spacing: 6px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
}
.brand-luma .dot {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--gold);
  margin-left: 3px; margin-top: -10px;
  box-shadow: 0 0 12px 2px rgba(245, 196, 94, 0.7);
}
.brand-sub {
  display: block;
  font-size: 12px; letter-spacing: 4px;
  text-transform: uppercase;
  color: var(--gold);
  margin-top: 4px;
}
.nav { margin-top: 48px; display: flex; flex-direction: column; gap: 4px; }
.nav-item {
  background: transparent; border: none; color: #cfcbc0;
  text-align: left; padding: 12px 14px; border-radius: 10px;
  font-size: 15px; display: flex; align-items: center; gap: 12px;
  transition: all 0.15s;
}
.nav-item .ic { font-size: 16px; opacity: 0.8; }
.nav-item:hover { background: var(--night-2); color: var(--ivory); }
.nav-item.active {
  background: linear-gradient(100deg, rgba(245,196,94,0.18), rgba(245,196,94,0.05));
  color: var(--gold);
  box-shadow: inset 0 0 0 1px rgba(245,196,94,0.25);
}
.sidebar-foot { margin-top: 20px; padding-top: 18px; border-top: 1px solid var(--night-2); }
.tagline {
  font-family: "Fraunces", serif; font-style: italic;
  font-size: 17px; line-height: 1.4; color: var(--ivory);
  opacity: 0.85; margin-bottom: 14px;
}
.sig { font-size: 11px; letter-spacing: 1px; color: var(--grey); text-transform: uppercase; }

/* ===== Content ===== */
.content { flex: 1; padding: 30px 40px 60px; max-width: 1200px; }
.topbar {
  display: flex; justify-content: space-between; align-items: flex-start;
  margin-bottom: 30px;
}
.topbar h1 {
  font-family: "Fraunces", serif; font-weight: 600;
  font-size: 34px; color: var(--night); letter-spacing: -0.5px;
}
.topbar-actions { display: flex; gap: 10px; }

/* ===== Buttons ===== */
.btn {
  border: none; border-radius: 10px; padding: 11px 18px;
  font-size: 14px; font-weight: 600; transition: all 0.15s;
}
.btn-gold {
  background: linear-gradient(120deg, var(--glow-2), var(--gold-deep));
  color: var(--night);
  box-shadow: 0 6px 18px -6px rgba(224, 169, 63, 0.7);
}
.btn-gold:hover { transform: translateY(-1px); box-shadow: 0 10px 24px -8px rgba(224,169,63,0.8); }
.btn-ghost { background: var(--white); color: var(--ink); box-shadow: inset 0 0 0 1px var(--line); }
.btn-ghost:hover { background: var(--ivory-soft); }
.btn-dark { background: var(--night); color: var(--ivory); }
.btn-dark:hover { background: var(--night-2); }
.btn-sm { padding: 7px 12px; font-size: 13px; }
.btn-danger { background: transparent; color: var(--crit); box-shadow: inset 0 0 0 1px rgba(217,83,79,0.3); }
.btn-danger:hover { background: rgba(217,83,79,0.08); }

/* ===== Cards / Stats ===== */
.stat-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 28px; }
.stat {
  background: var(--white); border-radius: var(--radius); padding: 22px;
  box-shadow: var(--shadow); position: relative; overflow: hidden;
}
.stat::after {
  content: ""; position: absolute; right: -30px; top: -30px;
  width: 90px; height: 90px; border-radius: 50%;
  background: radial-gradient(circle, rgba(245,196,94,0.25), transparent 70%);
}
.stat .num { font-family: "Fraunces", serif; font-size: 40px; font-weight: 600; color: var(--night); line-height: 1; }
.stat .lbl { font-size: 13px; color: var(--grey); margin-top: 8px; text-transform: uppercase; letter-spacing: 1px; }
.stat.accent { background: linear-gradient(130deg, #fff6e2, #faecc8); }

.panel {
  background: var(--white); border-radius: var(--radius); padding: 24px;
  box-shadow: var(--shadow); margin-bottom: 20px;
}
.panel h2 {
  font-family: "Fraunces", serif; font-size: 20px; font-weight: 600;
  color: var(--night); margin-bottom: 4px;
}
.panel .eyebrow { font-size: 11px; letter-spacing: 2px; text-transform: uppercase; color: var(--gold-deep); font-weight: 600; }
.panel-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }

/* bars */
.bar-row { display: flex; align-items: center; gap: 12px; margin: 12px 0; font-size: 14px; }
.bar-row .bname { width: 110px; flex-shrink: 0; color: var(--ink); }
.bar-track { flex: 1; height: 10px; background: var(--ivory-soft); border-radius: 6px; overflow: hidden; }
.bar-fill { height: 100%; border-radius: 6px; background: linear-gradient(90deg, var(--glow-1), var(--gold)); }
.bar-row .bval { width: 28px; text-align: right; font-weight: 600; color: var(--night); }

/* ===== Projects ===== */
.proj-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 18px; }
.proj-card {
  background: var(--white); border-radius: var(--radius); padding: 22px;
  box-shadow: var(--shadow); cursor: pointer; transition: all 0.18s;
  border-top: 3px solid var(--gold);
}
.proj-card:hover { transform: translateY(-3px); }
.proj-card h3 { font-family: "Fraunces", serif; font-size: 19px; color: var(--night); margin-bottom: 6px; }
.proj-card p { font-size: 14px; color: var(--grey); min-height: 38px; }
.proj-meta { display: flex; gap: 16px; margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--line); font-size: 13px; }
.proj-meta b { color: var(--night); }

/* ===== Bug list ===== */
.filters { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 18px; align-items: center; }
.filters select, .filters input {
  font-family: inherit; font-size: 14px; padding: 9px 12px; border-radius: 9px;
  border: 1px solid var(--line); background: var(--white); color: var(--ink);
}
.bug-list { display: flex; flex-direction: column; gap: 10px; }
.bug-row {
  background: var(--white); border-radius: 12px; padding: 16px 18px;
  box-shadow: var(--shadow); display: flex; align-items: center; gap: 16px;
  cursor: pointer; transition: all 0.15s; border-left: 4px solid var(--line);
}
.bug-row:hover { transform: translateX(2px); }
.bug-row.sev-Kritická { border-left-color: var(--crit); }
.bug-row.sev-Vysoká { border-left-color: var(--high); }
.bug-row.sev-Stredná { border-left-color: var(--med); }
.bug-row.sev-Nízka { border-left-color: var(--low); }
.bug-main { flex: 1; min-width: 0; }
.bug-title { font-weight: 600; color: var(--night); font-size: 15px; }
.bug-sub { font-size: 13px; color: var(--grey); margin-top: 3px; }

/* badges */
.badge {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 12px; font-weight: 600; padding: 4px 11px; border-radius: 20px;
  white-space: nowrap;
}
.badge-status { background: var(--ivory-soft); color: var(--ink); box-shadow: inset 0 0 0 1px var(--line); }
.st-Nová { background: #eef1f5; color: #4a5568; }
.st-Otvorená { background: #fdeedd; color: #b9621a; }
.st-Vriešení, .st-V.riešení { }
.badge[data-st="V riešení"] { background: #e7f0fb; color: #2b6cb0; }
.badge[data-st="Na overenie"] { background: #f3e8fd; color: #7c3aed; }
.badge[data-st="Vyriešená"] { background: #e3f5ea; color: #2f855a; }
.badge[data-st="Zatvorená"] { background: #ecebe8; color: #6b6760; }
.badge[data-st="Znovuotvorená"] { background: #fde6e6; color: #c53030; }
.badge[data-st="Nová"] { background: #eef1f5; color: #4a5568; }
.badge[data-st="Otvorená"] { background: #fdeedd; color: #b9621a; }
.sev { font-size: 12px; font-weight: 600; padding: 4px 10px; border-radius: 20px; }
.sev[data-sev="Kritická"] { background: #fae3e2; color: var(--crit); }
.sev[data-sev="Vysoká"] { background: #fceada; color: var(--high); }
.sev[data-sev="Stredná"] { background: #f8f0d8; color: #a07a18; }
.sev[data-sev="Nízka"] { background: #e3f1ea; color: var(--low); }
.prio { font-size: 12px; font-weight: 700; color: var(--grey); }
.env-badge { background: var(--night); color: var(--gold); }

.empty { text-align: center; padding: 60px 20px; color: var(--grey); }
.empty .big { font-family: "Fraunces", serif; font-size: 22px; color: var(--night); margin-bottom: 6px; }

/* ===== Modal ===== */
.modal-overlay {
  position: fixed; inset: 0; background: rgba(26, 26, 31, 0.55);
  backdrop-filter: blur(3px); display: flex; align-items: flex-start; justify-content: center;
  padding: 50px 20px; z-index: 50; overflow-y: auto;
}
.modal {
  background: var(--ivory); border-radius: 20px; width: 100%; max-width: 640px;
  box-shadow: 0 30px 80px -20px rgba(0,0,0,0.5); overflow: hidden;
  animation: pop 0.18s ease;
}
@keyframes pop { from { transform: translateY(10px) scale(0.98); opacity: 0; } }
.modal-head {
  background: var(--night); color: var(--ivory); padding: 22px 26px;
  display: flex; justify-content: space-between; align-items: flex-start;
}
.modal-head h2 { font-family: "Fraunces", serif; font-weight: 600; font-size: 22px; }
.modal-head .eyebrow { color: var(--gold); font-size: 11px; letter-spacing: 2px; text-transform: uppercase; }
.modal-close { background: none; border: none; color: var(--ivory); font-size: 26px; line-height: 1; opacity: 0.7; }
.modal-close:hover { opacity: 1; }
.modal-body { padding: 26px; }
.modal-foot { padding: 18px 26px; display: flex; justify-content: flex-end; gap: 10px; border-top: 1px solid var(--line); }

/* forms */
.field { margin-bottom: 16px; }
.field label { display: block; font-size: 13px; font-weight: 600; color: var(--ink); margin-bottom: 6px; }
.field input, .field textarea, .field select {
  width: 100%; font-family: inherit; font-size: 14px; padding: 11px 13px;
  border-radius: 10px; border: 1px solid var(--line); background: var(--white); color: var(--ink);
}
.field textarea { resize: vertical; min-height: 78px; }
.field input:focus, .field textarea:focus, .field select:focus {
  outline: none; border-color: var(--gold); box-shadow: 0 0 0 3px rgba(245,196,94,0.2);
}
.field-row { display: flex; gap: 14px; }
.field-row .field { flex: 1; }

/* bug detail */
.detail-meta { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 18px; }
.detail-sec { margin-bottom: 18px; }
.detail-sec h4 { font-size: 12px; letter-spacing: 1px; text-transform: uppercase; color: var(--gold-deep); margin-bottom: 6px; }
.detail-sec p { font-size: 14px; color: var(--ink); white-space: pre-wrap; line-height: 1.5; }

/* lifecycle timeline */
.timeline { border-left: 2px solid var(--whisper); margin-left: 8px; padding-left: 18px; }
.tl-item { position: relative; padding-bottom: 16px; }
.tl-item::before {
  content: ""; position: absolute; left: -25px; top: 3px;
  width: 12px; height: 12px; border-radius: 50%;
  background: var(--gold); box-shadow: 0 0 0 3px var(--ivory);
}
.tl-item .tl-status { font-weight: 600; color: var(--night); font-size: 14px; }
.tl-item .tl-note { font-size: 13px; color: var(--grey); }
.tl-item .tl-time { font-size: 12px; color: var(--grey); }

/* transition control */
.transition-box {
  background: linear-gradient(130deg, #fff6e2, #faecc8); border-radius: 12px;
  padding: 16px; margin-bottom: 18px;
}
.transition-box label { font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: 1px; color: var(--gold-deep); }
.transition-row { display: flex; gap: 10px; margin-top: 10px; }
.transition-row select { flex: 1; }
.transition-row input { flex: 2; }

/* toast */
.toast-wrap { position: fixed; bottom: 24px; right: 24px; display: flex; flex-direction: column; gap: 10px; z-index: 80; }
.toast {
  background: var(--night); color: var(--ivory); padding: 14px 18px; border-radius: 12px;
  box-shadow: var(--shadow); font-size: 14px; border-left: 3px solid var(--gold);
  animation: slide 0.2s ease;
}
.toast.err { border-left-color: var(--crit); }
@keyframes slide { from { transform: translateX(20px); opacity: 0; } }

/* ===== Lišta používateľa ===== */
#user-bar { margin-top: auto; padding-bottom: 18px; display: flex; flex-direction: column; gap: 8px; }
.user-chip { display: flex; align-items: center; gap: 10px; padding: 8px; border-radius: 12px; background: var(--night-2); margin-bottom: 4px; }
.avatar {
  width: 34px; height: 34px; flex-shrink: 0; border-radius: 50%;
  background: linear-gradient(135deg, var(--glow-1), var(--gold-deep));
  color: var(--night); font-weight: 700; display: flex; align-items: center; justify-content: center; font-size: 15px;
}
.avatar.sm { width: 30px; height: 30px; font-size: 13px; }
.user-info { display: flex; flex-direction: column; line-height: 1.3; min-width: 0; }
.user-info b { color: var(--ivory); font-size: 14px; }
.user-info span { color: var(--gold); font-size: 11px; text-transform: uppercase; letter-spacing: 1px; }
.user-btn {
  background: transparent; border: none; color: #cfcbc0; text-align: left;
  padding: 9px 12px; border-radius: 9px; font-size: 13px;
}
.user-btn:hover { background: var(--night-2); color: var(--ivory); }

/* správa používateľov */
.user-list { display: flex; flex-direction: column; gap: 8px; }
.user-row { display: flex; align-items: center; gap: 12px; padding: 10px 12px; background: var(--white); border-radius: 10px; box-shadow: inset 0 0 0 1px var(--line); }
.user-main { flex: 1; display: flex; flex-direction: column; gap: 2px; }
.user-main b { color: var(--night); font-size: 14px; }
.role-tag { font-size: 11px; padding: 1px 8px; border-radius: 12px; width: fit-content; font-weight: 600; }
.role-tag.admin { background: #fceada; color: var(--high); }
.role-tag.tester { background: #e3f1ea; color: var(--low); }
.role-tag.riesitel { background: #e7f0fb; color: #2b6cb0; }

/* prílohy */
.attach-grid { display: flex; flex-wrap: wrap; gap: 10px; margin: 8px 0; }
.attach-thumb { position: relative; width: 92px; height: 92px; border-radius: 10px; overflow: hidden; box-shadow: inset 0 0 0 1px var(--line); }
.attach-thumb img { width: 100%; height: 100%; object-fit: cover; cursor: zoom-in; display: block; background: var(--ivory-soft); }
.attach-del {
  position: absolute; top: 4px; right: 4px; width: 22px; height: 22px; border-radius: 50%;
  border: none; background: rgba(26,26,31,0.75); color: #fff; font-size: 16px; line-height: 1; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
}
.attach-del:hover { background: var(--crit); }
.attach-add {
  display: inline-flex; align-items: center; gap: 6px; cursor: pointer;
  padding: 9px 14px; border-radius: 9px; font-size: 13px; font-weight: 600;
  color: var(--gold-deep); background: var(--ivory-soft); box-shadow: inset 0 0 0 1px var(--line);
}
.attach-add:hover { background: #f6eccd; }

/* ===== Login ===== */
body.login-mode { align-items: center; justify-content: center; background: var(--night); }
#login-screen {
  position: fixed; inset: 0; display: flex; align-items: center; justify-content: center;
  background: radial-gradient(circle at 50% 30%, #2a2a32, var(--night));
}
.login-card {
  background: var(--ivory); border-radius: 22px; padding: 40px 36px; width: 360px;
  box-shadow: 0 40px 100px -30px rgba(0,0,0,0.7); text-align: center;
}
.login-brand { margin-bottom: 6px; }
.login-brand .brand-luma { color: var(--night); font-size: 30px; }
.login-brand .brand-sub { color: var(--gold-deep); }
.login-tag { font-family: "Fraunces", serif; font-style: italic; color: var(--grey); margin: 8px 0 26px; }
.login-card .field { text-align: left; }
.login-err { color: var(--crit); font-size: 13px; margin-top: 12px; min-height: 18px; }

/* Mobilná horná lišta + hamburger + backdrop — viditeľné len na mobile */
.mobile-header { display: none; }
.hamburger { display: none; }
.nav-backdrop { display: none; }
body.login-mode .mobile-header, body.login-mode .nav-backdrop { display: none !important; }

@media (max-width: 820px) {
  /* Sidebar ako vysúvací panel zľava */
  .sidebar {
    position: fixed; top: 0; left: 0; height: 100vh; z-index: 60;
    transform: translateX(-100%); transition: transform 0.25s ease;
    box-shadow: 0 0 60px rgba(0,0,0,0.5);
  }
  body.nav-open .sidebar { transform: translateX(0); }

  .nav-backdrop {
    display: block; position: fixed; inset: 0; z-index: 55;
    background: rgba(26,26,31,0.5); opacity: 0; pointer-events: none;
    transition: opacity 0.25s ease;
  }
  body.nav-open .nav-backdrop { opacity: 1; pointer-events: auto; }

  /* Horná lišta s logom a názvom (fixná, cez celú šírku) */
  .mobile-header {
    display: flex; align-items: center; gap: 12px;
    position: fixed; top: 0; left: 0; right: 0; z-index: 65;
    height: 58px; padding: 0 14px;
    background: var(--night); box-shadow: 0 2px 16px -6px rgba(0,0,0,0.5);
  }
  .mobile-brand { display: flex; align-items: baseline; gap: 8px; }
  .mobile-brand .brand-luma { color: var(--ivory); font-size: 22px; letter-spacing: 4px; }
  .mobile-brand .brand-sub { margin-top: 0; color: var(--gold); font-size: 11px; }

  /* Hamburger tlačidlo (vnútri lišty) */
  .hamburger {
    display: flex; flex-direction: column; justify-content: center; gap: 5px;
    width: 40px; height: 40px; flex-shrink: 0; padding: 0 9px; border: none; border-radius: 10px;
    background: var(--night-2);
  }
  .hamburger span { display: block; height: 2px; background: var(--gold); border-radius: 2px; transition: 0.25s; }
  body.nav-open .hamburger span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
  body.nav-open .hamburger span:nth-child(2) { opacity: 0; }
  body.nav-open .hamburger span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

  .content { padding: 20px; padding-top: 74px; }
  .stat-grid { grid-template-columns: repeat(2, 1fr); }
  .panel-grid { grid-template-columns: 1fr; }
  .topbar { flex-direction: column; gap: 14px; }
  .filters { gap: 8px; }
  .filters select { flex: 1 1 45%; }
  .modal-overlay { padding: 16px 10px; }
}
