/* CerberMC – Premium Dark/Fire UI */
:root{
  --bg0:#050000;
  --card:rgba(12,0,0,.86);
  --text:#fff;
  --muted:#d0d0d0;
  --accent1:#ff0000;
  --accent2:#ff7a00;
  --shadow: rgba(255, 0, 0, .18);
  --border: rgba(255,0,0,.18);
}

*{box-sizing:border-box}
body{
  margin:0;
  font-family: "Segoe UI", system-ui, -apple-system, Arial, sans-serif;
  color:var(--text);
  line-height:1.45;
  min-height:100vh;
  background: radial-gradient(circle at 15% 0%, #1b0000, var(--bg0) 65%);
}

.topnav{
  position:sticky; top:0; z-index:50;
  display:flex; align-items:center; justify-content:space-between;
  gap:18px; padding:16px 28px;
  background: linear-gradient(180deg, rgba(10,0,0,.92), rgba(10,0,0,.70));
  border-bottom:1px solid rgba(255,0,0,.15);
  backdrop-filter: blur(8px);
}

.brand{display:flex;align-items:center;gap:12px}
.brand-icon{width:44px;height:44px;border-radius:12px;object-fit:cover;box-shadow:0 0 18px var(--shadow)}
.brand-title{font-weight:900;letter-spacing:.3px;color:#ff2a2a;font-size:18px;line-height:1}
.brand-sub{font-size:12px;color:#bdbdbd;margin-top:2px}

.navlinks{display:flex;align-items:center;gap:10px;flex-wrap:nowrap;justify-content:space-between}

.navlinks a{
  color:#e6e6e6; text-decoration:none;
  padding:10px 14px; border-radius:999px;
  border:1px solid transparent; transition:.2s ease;
}
.navlinks a:hover{
  border-color: rgba(255,0,0,.22);
  background: rgba(255,255,255,.03);
}

/* Desktop NAV layout */
.nav-left{
  display:flex;
  align-items:center;
  gap:10px;
  flex:1 1 auto;
  min-width:0;
  overflow-x:auto;
  scrollbar-width:none;
}
.nav-left::-webkit-scrollbar{ display:none; }

.nav-right{
  display:flex;
  align-items:center;
  gap:10px;
  flex:0 0 auto;
  white-space:nowrap;
}

.pill{
  background: linear-gradient(90deg, var(--accent1), var(--accent2));
  border:0 !important; font-weight:800;
}
.pill:hover{filter:brightness(1.05)}
.pill.danger{ background: linear-gradient(90deg, #2a0000, #ff2a2a); }

.who{display:flex;align-items:center;gap:10px;padding:0 10px}
.badge{
  display:inline-block; padding:6px 10px; border-radius:999px;
  border:1px solid rgba(255,0,0,.22); background: rgba(0,0,0,.35);
  color:#ffd2d2; font-size:12px; font-weight:800;
}
.nick{color:#fff;font-weight:800;font-size:13px;opacity:.95}
.chip{
  display:inline-block;
  padding:4px 8px;
  border-radius:999px;
  border:1px solid rgba(255,0,0,.20);
  background: rgba(0,0,0,.35);
  font-size:12px;
  margin-left:6px;
}

.container{max-width:1120px;margin:0 auto;padding:26px 22px}
.card{
  background: var(--card);
  border:1px solid var(--border);
  border-radius:18px;
  box-shadow: 0 0 26px var(--shadow);
  padding:22px;
}

.grid{display:grid;grid-template-columns: 1.4fr .6fr; gap:18px;}
@media (max-width: 920px){ .grid{grid-template-columns:1fr} }

.hero{position:relative; overflow:hidden; min-height:320px;}
.hero::before{
  content:""; position:absolute; inset:0;
  background:
    radial-gradient(circle at 10% 20%, rgba(255,0,0,.22), transparent 55%),
    radial-gradient(circle at 70% 50%, rgba(255,122,0,.18), transparent 55%),
    url("img/hero.png") right 30px center / 720px auto no-repeat;
  opacity:.45; pointer-events:none;
}
.hero::after{
  content:""; position:absolute; inset:0;
  background: linear-gradient(90deg, rgba(0,0,0,.78) 0%, rgba(0,0,0,.42) 60%, rgba(0,0,0,.20) 100%);
  pointer-events:none;
}
.hero > *{position:relative; z-index:2}

.h1{font-size:38px;margin:0 0 8px;font-weight:900}
.sub{color:var(--muted);margin:0 0 18px}
.small{font-size:12px;color:#bbb}

.btnrow{display:flex;gap:10px;flex-wrap:nowrap;margin-top:16px}
.btn{
  display:inline-block; padding:12px 16px; border-radius:999px;
  text-decoration:none; font-weight:900; color:#fff;
  background: linear-gradient(90deg, var(--accent1), var(--accent2));
  border:none; cursor:pointer;
}
.btn.ghost{ background:transparent; border:1px solid rgba(255,0,0,.22); }

.kpi{display:flex;flex-direction:column;gap:10px}
.kpi .item{
  padding:12px 14px; border:1px solid rgba(255,0,0,.14);
  border-radius:14px; background: rgba(0,0,0,.35);
}
.kpi .label{color:#cfcfcf;font-size:12px}
.kpi .value{font-weight:900;font-size:18px;margin-top:2px}

.table{width:100%;border-collapse:collapse;margin-top:12px}
.table th,.table td{padding:10px 10px;border-bottom:1px solid rgba(255,0,0,.12);text-align:left;vertical-align:top}
.table th{color:#ffd2d2;font-size:12px;text-transform:uppercase;letter-spacing:.5px}
.table select{ padding:8px 10px;border-radius:12px;border:1px solid rgba(255,0,0,.18); background:#0b0000;color:#fff }

.input, textarea{
  width:100%; padding:12px 14px; border-radius:14px;
  border:1px solid rgba(255,0,0,.18);
  background:#0b0000; color:#fff;
}
textarea{min-height:120px;resize:vertical}
.actions{margin-top:12px;display:flex;gap:10px;flex-wrap:nowrap}

.flash{
  max-width:1120px;
  margin:12px auto 0;
  padding:12px 14px;
  border-radius:14px;
  border:1px solid rgba(255,0,0,.20);
  background: rgba(0,0,0,.45);
}
.flash.success{border-color: rgba(80,255,80,.25)}
.flash.error{border-color: rgba(255,80,80,.25)}
.flash.info{border-color: rgba(120,160,255,.25)}

.cards{
  display:grid;
  grid-template-columns: repeat(3, 1fr);
  gap:14px;
}
@media (max-width: 980px){ .cards{grid-template-columns:1fr 1fr} }
@media (max-width: 640px){ .cards{grid-template-columns:1fr} }

.product{
  border:1px solid rgba(255,0,0,.14);
  background: rgba(0,0,0,.35);
  border-radius:16px;
  padding:16px;
}
.product h3{margin:0 0 8px;font-size:16px}
.product .price{font-weight:900;font-size:18px;margin:10px 0}
hr.sep{border:0;border-top:1px solid rgba(255,0,0,.10);margin:14px 0}


/* === Admin tabs layout === */
.admin-layout{
  display:grid;
  grid-template-columns: 260px 1fr;
  gap:18px;
  margin-top:18px;
  align-items:start;
}
.admin-menu{
  position:sticky;
  top:96px;
  padding:14px;
}
.admin-link{
  display:flex;
  align-items:center;
  gap:10px;
  padding:12px 12px;
  border-radius:16px;
  border:1px solid rgba(255,255,255,.10);
  background: rgba(0,0,0,.18);
  color: rgba(255,255,255,.92);
  text-decoration:none;
  margin-bottom:10px;
  transition: transform .12s ease, background .12s ease, border-color .12s ease;
}
.admin-link:hover{
  transform: translateY(-1px);
  border-color: rgba(255,255,255,.22);
}
.admin-link.active{
  background: linear-gradient(90deg, rgba(255,55,55,.95), rgba(255,140,0,.92));
  border-color: transparent;
  color:#fff;
}
.admin-ico{ width:26px; text-align:center; font-size:16px; }
.admin-label{ font-weight:800; }

.admin-content .card{ margin-bottom:18px; }
.admin-head{ margin-bottom:0; }

@media (max-width: 920px){
  .admin-layout{ grid-template-columns: 1fr; }
  .admin-menu{ position:relative; top:auto; display:flex; flex-wrap:nowrap; gap:10px; }
  .admin-link{ margin-bottom:0; flex: 1 1 160px; justify-content:center; }
}


/* badges status */
.badge.status-ok{border-color:rgba(0,255,120,.25); box-shadow:0 0 0 1px rgba(0,255,120,.14) inset;}
.badge.status-warn{border-color:rgba(255,210,0,.28); box-shadow:0 0 0 1px rgba(255,210,0,.12) inset;}
.badge.status-bad{border-color:rgba(255,80,80,.28); box-shadow:0 0 0 1px rgba(255,80,80,.12) inset;}
.badge.status-muted{opacity:.85}

/* tables */
.table th, .table td{padding:10px 10px;border-bottom:1px solid rgba(255,0,0,.10);vertical-align:top}
.table thead th{font-size:12px;letter-spacing:.08em;text-transform:uppercase;color:rgba(255,255,255,.78)}
.table td.small{font-size:12px;color:rgba(255,255,255,.72)}
.table td .badge{display:inline-flex;justify-content:center;min-width:92px}

/* mobile: allow wrap */
@media (max-width: 820px){
  .table{display:block;overflow-x:auto}
  .table td .badge{min-width:auto}
}


/* footer */
.footer{padding:22px 18px;text-align:center;color:rgba(255,255,255,.72);font-size:13px}
.footer .small{margin-top:6px;color:rgba(255,255,255,.55);font-size:12px}


/* === Sklep: obrazki dopasowane do ramki (niezależnie od rozmiaru) === */
.shop-img{width:100%;aspect-ratio:16/9;overflow:hidden;border-radius:14px;background:rgba(0,0,0,0.25);border:1px solid rgba(255,80,0,.12);margin-bottom:10px
  padding: 8px;
  box-sizing: border-box;
}
.shop-img img{width:100%;height:100%;object-fit: contain;object-position:center;display:block;opacity:.97
  box-sizing: border-box;
  border-radius: 12px;
}
.shop-img .ph{width:100%;height:100%;display:flex;align-items:center;justify-content:center;color:rgba(255,255,255,.55);font-weight:800}

/* Admin: podgląd obrazka produktu */
.media-frame{width:100%;aspect-ratio:16/9;overflow:hidden;border-radius:14px;background:rgba(255,255,255,.03);border:1px solid rgba(255,80,0,.12);margin-top:10px}
.media-frame img{width:100%;height:100%;object-fit:cover;object-position:center;display:block;opacity:.97}


/* Admin - mniejszy podgląd obrazka produktu */
.media-frame.media-sm{
  width:100%;
  max-width: 760px;
  height: 180px;
  overflow:hidden;
  border-radius:18px;
  background: rgba(255,255,255,0.03);
  border:1px solid rgba(255,80,0,0.20);
  margin-top: 10px;
}
.media-frame.media-sm img{
  width:100%;
  height:100%;
  object-fit: cover;
  display:block;
}

/* Filtry kategorii */
.cat-tabs{display:flex;gap:10px;flex-wrap:nowrap;margin:10px 0 16px}
.cat-tabs a{display:inline-flex;align-items:center;gap:8px;padding:10px 14px;border-radius:999px;border:1px solid rgba(255,80,0,.25);background:rgba(0,0,0,.25);color:#fff;text-decoration:none;font-weight:800}
.cat-tabs a.active{background:linear-gradient(90deg,#ff2a00,#ff8a00);border-color:transparent}



/* ===== Mobile menu (telefon) ===== */
.nav-toggle{
  display:none;
  width:44px;height:44px;
  border-radius:14px;
  border:1px solid rgba(255,0,0,.22);
  background: rgba(0,0,0,.35);
  cursor:pointer;
  align-items:center;
  justify-content:center;
  gap:5px;
}
.nav-toggle span{
  display:block;
  width:18px;height:2px;
  background: rgba(255,255,255,.9);
  border-radius:99px;
  box-shadow: 0 0 10px rgba(255,0,0,.18);
}
.nav-backdrop{
  position:fixed; inset:0;
  background: rgba(0,0,0,.55);
  backdrop-filter: blur(10px);
  opacity:0; pointer-events:none;
  transition: .18s ease;
  z-index:49;
}
.nav-backdrop.show{opacity:1; pointer-events:auto;}
.no-scroll{overflow:hidden;}

@media (max-width: 860px){
  .topnav{padding:12px 14px;}
  .brand-icon{width:40px;height:40px;border-radius:12px;}
  .brand-sub{display:none;}
  .nav-toggle{display:inline-flex;}
  .navlinks{
    position:fixed;
    left:12px; right:12px;
    top:76px;
    display:none;
    flex-direction:column;
    align-items:stretch;
    gap:10px;
    padding:14px;
    border-radius:18px;
    background: rgba(10,0,0,.86);
    border:1px solid rgba(255,0,0,.18);
    box-shadow: 0 0 34px rgba(0,0,0,.65);
    backdrop-filter: blur(12px);
    max-height: calc(100vh - 92px);
    overflow:auto;
    z-index:50;
  }
  .topnav.open .navlinks{display:flex;}
  .navlinks a{
    width:100%;
    border-radius:14px;
    padding:12px 14px;
    border:1px solid rgba(255,255,255,.06);
    background: rgba(255,255,255,.02);
    font-size:16px;
  }
  .navlinks a.pill{
    text-align:center;
    border:0;
  }
  .who{
    width:100%;
    padding:12px 14px;
    border-radius:14px;
    border:1px solid rgba(255,0,0,.18);
    background: rgba(0,0,0,.28);
    justify-content:space-between;
  }
  .chip{float:right}
}

/* ===== Mobile polish (global) ===== */
@media (max-width: 860px){
  /* Menu czytelniejszy — bez przebijania tła strony */
  .navlinks{
    left:0 !important;
    right:0 !important;
    top:64px !important;
    bottom:0 !important;
    max-height:none !important;
    border-radius:0 !important;
    padding:14px 12px 18px !important;
    background: rgba(5,0,0,.96) !important;
    border-left:0 !important;
    border-right:0 !important;
    border-bottom:1px solid rgba(255,0,0,.18) !important;
    box-shadow: 0 18px 60px rgba(0,0,0,.70) !important;
    backdrop-filter: blur(16px) !important;
  }
  .nav-backdrop{ background: rgba(0,0,0,.65) !important; }
  .no-scroll{ overflow:hidden; height:100vh; }
}

@media (max-width: 600px){
  body{ font-size:15px; }
  .container{ padding:16px 12px; }
  .card{ padding:16px; border-radius:16px; }

  .topnav{ padding:10px 12px; gap:12px; }
  .brand-icon{ width:38px; height:38px; border-radius:12px; }
  .brand-title{ font-size:16px; }

  /* Hero */
  .hero{ min-height:unset; }
  .hero::before{
    background:
      radial-gradient(circle at 10% 20%, rgba(255,0,0,.24), transparent 60%),
      radial-gradient(circle at 70% 50%, rgba(255,122,0,.20), transparent 60%);
    opacity:.55;
  }
  .h1{ font-size:28px; line-height:1.12; }
  .sub{ font-size:14px; line-height:1.35; }

  /* Przyciski i akcje */
  .btnrow{ flex-direction:column; align-items:stretch; }
  .btn{ width:100%; text-align:center; }
  .actions{ flex-direction:column; align-items:stretch; }
  .actions .btn{ width:100%; }

  /* Gridy i listy */
  .grid{ gap:14px; }
  .cards{ gap:12px; }
  .product{ padding:14px; border-radius:14px; }

  /* Flash i stopka */
  .flash{ margin:10px 12px 0; border-radius:14px; }
  .footer{ padding:18px 14px; }

  /* Tabele */
  .table th,.table td{ padding:10px 8px; }

  /* Profile: key/value na telefonie jeden pod drugim */
  .profile-grid .kv{ grid-template-columns:1fr !important; }
  .profile-grid .kv .k{ margin-top:10px; }
}

@media (max-width: 420px){
  .h1{ font-size:24px; }
  .navlinks a{ font-size:15px; padding:11px 12px; }
  .nav-toggle{ width:42px; height:42px; }
}

/* ===== Mobile NAV hotfix (Android/Chrome blur + z-index) ===== */
@media (max-width: 860px){
  /* Na części telefonów backdrop-filter robi "rozmycie całej strony" i wygląda jak bug.
     Wyłączamy blur, dajemy solidniejsze tło i poprawiamy warstwy. */
  .topnav{ z-index: 1000 !important; }

  .nav-backdrop{
    z-index: 998 !important;
    background: rgba(0,0,0,.72) !important;
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
  }

  .navlinks{
    z-index: 999 !important;
    background: rgba(7,0,0,.98) !important;
    border: 1px solid rgba(255,0,0,.18) !important;
    box-shadow: 0 18px 60px rgba(0,0,0,.75) !important;
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
  }

  /* Gdyby jakaś wersja NAV trzymała display:flex cały czas, chowamy menu animacją.
     (Działa z toggle klasą .open na .topnav) */
  .navlinks{ 
    opacity: 0; 
    transform: translateY(-8px);
    pointer-events: none;
    transition: opacity .18s ease, transform .18s ease;
  }
  .topnav.open .navlinks{
    opacity: 1;
    transform: none;
    pointer-events: auto;
    display: flex !important;
  }
}

/* ===== Mobile NAV fix: pokaż wszystkie zakładki (nav-scroll -> kolumna) ===== */
@media (max-width: 860px){
  /* menu ukryte dopóki nie jest otwarte (inline #topnav .navlinks nie może tego zepsuć) */
  #topnav .navlinks{
    display:none !important;
    position:fixed !important;
    left:12px !important;
    right:12px !important;
    top:72px !important;
    bottom:auto !important;
    flex-direction:column !important;
    align-items:stretch !important;
    gap:10px !important;
    padding:14px 12px 16px !important;
    border-radius:18px !important;
    background: rgba(7,0,0,.98) !important;
    border: 1px solid rgba(255,0,0,.18) !important;
    box-shadow: 0 18px 60px rgba(0,0,0,.75) !important;
    max-height: calc(100vh - 92px) !important;
    overflow:auto !important;
    z-index: 999 !important;
  }
  #topnav.open .navlinks{ display:flex !important; }

  /* Najważniejsze: linki w pionie, bez poziomego scrolla */
  #topnav .nav-left,
  #topnav .nav-right{
    display:flex !important;
    flex-direction:column !important;
    align-items:stretch !important;
    width:100% !important;
    gap:10px !important;
    margin-left:0 !important;
  }
  #topnav .nav-scroll{
    display:flex !important;
    flex-direction:column !important;
    align-items:stretch !important;
    width:100% !important;
    overflow:visible !important;
  }

  #topnav .navlinks a,
  #topnav .nav-dd-summary,
  #topnav .pill,
  #topnav .who{
    width:100% !important;
  }
  #topnav .navlinks a,
  #topnav .nav-dd-summary,
  #topnav .who{
    justify-content:space-between !important;
  }
  #topnav .pill{ justify-content:center !important; }

  /* Dropdown w menu mobilnym: normalnie w środku listy */
  #topnav .nav-dd{ width:100% !important; }
  #topnav .nav-dd-menu{
    position:static !important;
    top:auto !important;
    right:auto !important;
    min-width:0 !important;
    margin-top:8px !important;
    padding:8px !important;
    border-radius:16px !important;
    background: rgba(0,0,0,.35) !important;
    border:1px solid rgba(255,0,0,.14) !important;
    box-shadow:none !important;
  }
  #topnav .nav-dd-menu a{ margin-top:6px !important; }

  /* Backdrop bez blur (Android/Chrome) */
  #navBackdrop.nav-backdrop{
    backdrop-filter:none !important;
    -webkit-backdrop-filter:none !important;
    background: rgba(0,0,0,.72) !important;
    z-index: 998 !important;
  }
}


/* =====================================================
   CerberUI v2 (RED) — global premium components
   ===================================================== */

/* NAV layout fixes (desktop) */
.topnav-inner{
  width:100%;
  max-width: 1220px;
  margin:0 auto;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:18px;
}

/* override old navlinks structure to support nav-left/nav-right */
.navlinks{
  flex:1;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:14px;
  flex-wrap: nowrap;
  min-width: 0;
}
.nav-left,
.nav-right{
  display:flex;
  align-items:center;
  gap:10px;
  flex-wrap: nowrap;
}
.nav-right{ justify-content:flex-end; }

/* IMPORTANT: allow dropdown/mega menu to overflow outside nav (otherwise it gets clipped) */
.navlinks{ overflow: visible; }
.nav-left{ overflow: visible !important; }

/* Desktop hover support (multi-head style) */
@media (hover:hover) and (pointer:fine){
  .nav-mega:hover .nav-mega-menu{
    opacity: 1;
    transform: none;
    pointer-events: auto;
  }
  .nav-mega:hover .nav-mega-summary{
    border-color: rgba(255,0,0,.26);
    background: rgba(0,0,0,.28);
  }
  .nav-mega:hover .caret{ transform: rotate(180deg) translateY(-1px); }
}

/* details dropdown */
.nav-dd{ position:relative; }
.nav-dd summary{ list-style:none; }
.nav-dd summary::-webkit-details-marker{ display:none; }
.nav-dd-summary{
  cursor:pointer;
  user-select:none;
  display:inline-flex;
  align-items:center;
  gap:8px;
  color:#e6e6e6;
  text-decoration:none;
  padding:10px 14px;
  border-radius:999px;
  border:1px solid transparent;
  transition:.2s ease;
}

.nav-link{
  display:inline-flex;
  align-items:center;
  gap:8px;
  color:#e6e6e6;
  text-decoration:none;
  padding:10px 14px;
  border-radius:999px;
  border:1px solid transparent;
  transition:.2s ease;
  white-space:nowrap;
}
.nav-link:hover{
  border-color: rgba(255,0,0,.22);
  background: rgba(255,255,255,.03);
}
.nav-dd-summary:hover{
  border-color: rgba(255,0,0,.22);
  background: rgba(255,255,255,.03);
}
.nav-dd[open] .nav-dd-summary{
  border-color: rgba(255,0,0,.26);
  background: rgba(0,0,0,.28);
}
.caret{ opacity:.9; transform: translateY(1px); }
.nav-dd[open] .caret{ transform: rotate(180deg) translateY(-1px); }

.nav-dd-menu{
  position:absolute;
  right:0;
  top: calc(100% + 10px);
  min-width: 260px;
  padding:10px;
  border-radius:18px;
  background: rgba(7,0,0,.95);
  border:1px solid rgba(255,0,0,.18);
  box-shadow: 0 22px 70px rgba(0,0,0,.70);
  z-index: 60;
}
.nav-dd-menu a{
  display:flex;
  align-items:center;
  justify-content:space-between;
  width:100%;
  padding:12px 12px;
  border-radius:14px;
  border:1px solid rgba(255,255,255,.06);
  background: rgba(255,255,255,.02);
}
.nav-dd-menu a:hover{
  border-color: rgba(255,0,0,.22);
  background: rgba(255,0,0,.08);
}

/* ===== Mega dropdown (jak multi-head) ===== */
.nav-mega{ position:relative; }
.nav-mega summary{ list-style:none; }
.nav-mega summary::-webkit-details-marker{ display:none; }

/* reuse .nav-dd-summary look */
.nav-mega[open] .nav-mega-summary{
  border-color: rgba(255,0,0,.26);
  background: rgba(0,0,0,.28);
}
.nav-mega[open] .caret{ transform: rotate(180deg) translateY(-1px); }

.nav-mega-menu{
  position:absolute;
  left:0;
  top: calc(100% + 12px);
  width: min(820px, 92vw);
  padding:14px;
  border-radius:20px;
  background: rgba(7,0,0,.96);
  border:1px solid rgba(255,0,0,.18);
  box-shadow: 0 24px 80px rgba(0,0,0,.72);
  z-index: 80;
  transform: translateY(-8px);
  opacity: 0;
  pointer-events: none;
  transition: opacity .16s ease, transform .16s ease;
}
.nav-mega[open] .nav-mega-menu{
  opacity: 1;
  transform: none;
  pointer-events: auto;
}

.nav-mega-menu::before{
  content:"";
  position:absolute;
  inset:-40px;
  background:
    radial-gradient(circle at 20% 20%, rgba(255,0,0,.18), transparent 58%),
    radial-gradient(circle at 80% 25%, rgba(255,138,0,.12), transparent 55%);
  opacity:.8;
  pointer-events:none;
}
.nav-mega-menu > *{ position:relative; z-index:1; }

.nav-mega-menu-right{ left:auto; right:0; }

.mega-grid{
  display:grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap:12px;
}
.mega-grid-compact{ grid-template-columns: repeat(2, minmax(0, 1fr)); }

.mega-tile{
  display:flex;
  align-items:center;
  gap:12px;
  padding:14px 14px;
  border-radius:18px;
  border:1px solid rgba(255,255,255,.06);
  background: rgba(255,255,255,.02);
  text-decoration:none;
  color:#fff;
  min-width: 0;
  transition: .18s ease;
}
.mega-tile:hover{
  border-color: rgba(255,0,0,.24);
  background: rgba(255,0,0,.08);
}

.mega-ico{
  position:relative;
  width:44px; height:44px;
  flex:0 0 44px;
}
.mega-ico::before{
  content:"";
  position:absolute;
  inset:0;
  transform: rotate(45deg);
  border-radius:14px;
  background: rgba(255,0,0,.10);
  border:1px solid rgba(255,0,0,.24);
  box-shadow: 0 0 24px rgba(255,0,0,.16);
}
.mega-ico span{
  position:relative;
  z-index:1;
  width:100%; height:100%;
  display:flex;
  align-items:center;
  justify-content:center;
  font-size:18px;
}

.mega-meta{ min-width:0; display:flex; flex-direction:column; gap:2px; }
.mega-title{ font-weight:950; display:flex; align-items:center; gap:8px; min-width:0; }
.mega-desc{ opacity:.78; font-size:12px; line-height:1.25; }

/* Mobile: mega menu w środku listy */
@media (max-width: 860px){
  .nav-mega-menu{
    position:static !important;
    left:auto !important;
    right:auto !important;
    top:auto !important;
    width:100% !important;
    margin-top:8px !important;
    padding:10px !important;
    border-radius:16px !important;
    box-shadow:none !important;
    transform:none !important;
    opacity:1 !important;
    pointer-events:auto !important;
  }
  .mega-grid{ grid-template-columns:1fr; }
}

/* user chip */
.who{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  padding:8px 10px;
  border-radius:999px;
  border:1px solid rgba(255,0,0,.14);
  background: rgba(0,0,0,.22);
}
.who:hover{ border-color: rgba(255,0,0,.22); background: rgba(255,255,255,.03); }
.who-left{ display:flex; align-items:center; gap:10px; }
.nav-avatar{
  width:28px;
  height:28px;
  border-radius:50%;
  object-fit:cover;
  border:1px solid rgba(255,0,0,.18);
  background: rgba(0,0,0,.25);
}
.nav-avatar.fallback{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  font-weight:900;
  font-size:13px;
  color:#fff;
}

/* remove blur everywhere (Android/Chrome glitch) */
.nav-backdrop{
  backdrop-filter:none !important;
  -webkit-backdrop-filter:none !important;
}

/* Badge for unread PM */
.pm-badge{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  min-width:20px;
  height:20px;
  padding:0 7px;
  border-radius:999px;
  font-size:12px;
  font-weight:900;
  color:#fff;
  background: linear-gradient(90deg, #ff2a00, #ff8a00);
  border:1px solid rgba(0,0,0,.35);
  box-shadow: 0 0 18px rgba(255,0,0,.18);
}

/* ===== Stats widget (dashboard) ===== */
.stats-pro{
  position:relative;
  overflow:hidden;
}
.stats-pro::before{
  content:"";
  position:absolute;
  inset:-40px;
  background:
    radial-gradient(circle at 20% 20%, rgba(255,0,0,.20), transparent 55%),
    radial-gradient(circle at 80% 35%, rgba(255,138,0,.16), transparent 55%);
  opacity:.85;
  pointer-events:none;
}
.stats-pro > *{ position:relative; z-index:1; }

.stats-pro-head{
  display:flex;
  align-items:flex-end;
  justify-content:space-between;
  gap:14px;
  margin-bottom:14px;
}
.stats-pro-title{
  display:flex;
  align-items:center;
  gap:10px;
  font-weight:900;
  font-size:22px;
}
.stats-pro-mark{
  width:34px;height:34px;
  display:flex;align-items:center;justify-content:center;
  border-radius:12px;
  background: rgba(0,0,0,.35);
  border:1px solid rgba(255,0,0,.18);
  box-shadow: 0 0 22px rgba(255,0,0,.14);
}
.stats-pro-sub{ opacity:.85; }

.stats-pro-grid{
  display:grid;
  grid-template-columns: repeat(2, 1fr);
  gap:14px;
}
@media (max-width: 640px){
  .stats-pro-grid{ grid-template-columns:1fr; }
}

.stat-tile{
  border:1px solid rgba(255,0,0,.14);
  background: rgba(0,0,0,.28);
  border-radius:18px;
  padding:16px 16px 18px;
  text-align:center;
  box-shadow: 0 0 0 1px rgba(0,0,0,.35) inset;
}
.stat-ico{ position:relative; width:52px; height:52px; margin:6px auto 10px; }
.stat-ico::before{
  content:"";
  position:absolute;
  inset:0;
  transform: rotate(45deg);
  border-radius:14px;
  background: rgba(255,0,0,.10);
  border:1px solid rgba(255,0,0,.22);
  box-shadow: 0 0 26px rgba(255,0,0,.16);
}
.stat-ico span{ position:relative; z-index:1; display:flex; align-items:center; justify-content:center; width:100%; height:100%; font-size:22px; }
.stat-num{ font-size:30px; font-weight:950; letter-spacing:.2px; margin-top:2px; }
.stat-lbl{ opacity:.78; font-weight:800; margin-top:4px; }
.stat-mini{ opacity:.85; font-weight:900; margin-left:6px; }

.stat-last{
  grid-column: 1 / -1;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:14px;
  padding:16px;
  border-radius:18px;
  border:1px solid rgba(255,0,0,.14);
  background: rgba(0,0,0,.24);
}
.last-ava{
  width:56px;height:56px;border-radius:50%;
  overflow:hidden;
  border:1px solid rgba(255,0,0,.22);
  background: rgba(0,0,0,.32);
  display:flex;align-items:center;justify-content:center;
  font-weight:950;
  font-size:22px;
}
.last-ava img{width:100%;height:100%;object-fit:cover;display:block;}
.last-meta{ flex:1; min-width: 0; }
.last-name{ font-weight:950; font-size:18px; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.last-actions{ display:flex; gap:10px; flex-wrap:nowrap; justify-content:flex-end; }
.smallbtn{ padding:10px 14px; font-size:13px; }

.stats-online{ margin-top:14px; }
.stats-online summary{
  cursor:pointer;
  list-style:none;
  padding:12px 14px;
  border-radius:14px;
  border:1px solid rgba(255,0,0,.14);
  background: rgba(0,0,0,.22);
  font-weight:900;
}
.stats-online summary::-webkit-details-marker{ display:none; }
.stats-online-list{ padding:10px 6px 0; display:flex; flex-direction:column; gap:10px; }
.stats-online-row{ display:flex; justify-content:space-between; gap:10px; padding:10px 12px; border-radius:14px; border:1px solid rgba(255,255,255,.06); background: rgba(255,255,255,.02); }

/* ===== Messages (PM) UI ===== */
.notice{
  padding:12px 14px;
  border-radius:14px;
  border:1px solid rgba(255,255,255,.10);
  background: rgba(0,0,0,.30);
  margin:12px 0;
}
.notice.ok{ border-color: rgba(80,255,80,.22); }
.notice.err{ border-color: rgba(255,80,80,.22); }

.pm-compose{ overflow:hidden; }
.pm-compose-head{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  margin-bottom:12px;
}
.pm-compose-head h3{ margin:0; font-size:18px; }
.pm-search-form{ display:flex; gap:10px; align-items:center; flex-wrap:nowrap; }
.pm-search-input{ flex:1; min-width: 220px; }
.pm-search-results{ margin-top:12px; display:flex; flex-direction:column; gap:10px; }
.pm-user-row{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  padding:12px;
  border-radius:16px;
  border:1px solid rgba(255,0,0,.12);
  background: rgba(0,0,0,.22);
}
.pm-user-left{ display:flex; align-items:center; gap:12px; min-width:0; }
.pm-user-meta{ min-width:0; }
.pm-user-name{ font-weight:950; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.pm-user-id{ opacity:.7; font-size:12px; margin-top:2px; }
.pm-user-actions{ display:flex; gap:10px; flex-wrap:nowrap; justify-content:flex-end; }

.pm-layout{ display:grid; grid-template-columns: 340px 1fr; gap:18px; align-items:start; }
@media (max-width: 980px){ .pm-layout{ grid-template-columns: 1fr; } }

.pm-convos{ display:flex; flex-direction:column; gap:10px; margin-top:12px; }
.pm-convo-row{ display:flex; gap:10px; }
.pm-convo-main{
  flex:1;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:10px;
  padding:12px 12px;
  border-radius:16px;
  border:1px solid rgba(255,0,0,.12);
  background: rgba(0,0,0,.22);
}
.pm-convo-main:hover{ border-color: rgba(255,0,0,.22); background: rgba(255,255,255,.03); }
.pm-convo-row.active .pm-convo-main{ background: rgba(255,0,0,.10); border-color: rgba(255,0,0,.26); }
.pm-convo-left{ display:flex; align-items:center; gap:10px; min-width:0; }
.pm-convo-left .name{ font-weight:950; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.pm-convo-main .hint{ opacity:.75; font-size:12px; white-space:nowrap; }
.pm-convo-prof{
  width:44px;
  display:flex;
  align-items:center;
  justify-content:center;
  border-radius:16px;
  border:1px solid rgba(255,0,0,.12);
  background: rgba(0,0,0,.22);
  text-decoration:none;
}
.pm-convo-prof:hover{ border-color: rgba(255,0,0,.22); background: rgba(255,0,0,.08); }

.pm-avatar{
  width:36px; height:36px;
  border-radius:50%;
  object-fit:cover;
  border:1px solid rgba(255,0,0,.18);
  background: rgba(0,0,0,.35);
  display:inline-flex;
  align-items:center;
  justify-content:center;
  font-weight:950;
  color:#fff;
}
.pm-avatar.fallback{ font-size:15px; }

.pm-thread-head{ display:flex; justify-content:space-between; align-items:center; gap:12px; margin-bottom:12px; }
.pm-prof-link{ color:#fff; font-weight:950; text-decoration:none; border-bottom:1px dashed rgba(255,255,255,.18); }
.pm-prof-link:hover{ border-bottom-color: rgba(255,0,0,.55); }

.pm-thread{
  height: 430px;
  overflow:auto;
  padding:12px;
  border-radius:18px;
  border:1px solid rgba(255,0,0,.12);
  background: rgba(0,0,0,.20);
}
@media (max-width: 640px){ .pm-thread{ height: 380px; } }

.pm-msg{
  max-width: 78%;
  margin:10px 0;
  padding:10px 12px;
  border-radius:16px;
  border:1px solid rgba(255,255,255,.06);
  background: rgba(255,255,255,.02);
}
.pm-msg .meta{ opacity:.65; font-size:12px; margin-bottom:6px; }
.pm-msg .body{ white-space:normal; }
.pm-msg.mine{ margin-left:auto; background: rgba(255,0,0,.10); border-color: rgba(255,0,0,.18); }
.pm-msg.theirs{ margin-right:auto; }

.pm-send-actions{ margin-top:10px; display:flex; justify-content:flex-end; }

/* Small button variant */
.btn.sm{ padding:10px 14px; font-size:13px; }

/* ===== Mobile global polish v2 ===== */
@media (max-width: 860px){
  .navlinks{ justify-content:flex-start; }
  .nav-right{ margin-top:2px; }
}

/* Brand as link (home) */
a.brand{ text-decoration:none; color:inherit; }
a.brand:hover{ filter: brightness(1.02); }

/* ===== Shared card head (premium) ===== */
.card-head{ display:flex; align-items:center; justify-content:space-between; gap:14px; }
.card-head-left{ display:flex; align-items:center; gap:12px; }

.card-head-right{
  display:flex;
  align-items:center;
  gap:8px;
  flex-wrap:wrap;
  justify-content:flex-end;
}
.card-title{ font-weight:950; font-size:18px; line-height:1.1; }

.diamond{
  width:44px; height:44px;
  display:grid; place-items:center;
  border-radius:14px;
  border:1px solid rgba(255,0,0,.18);
  background: rgba(255,0,0,.10);
  box-shadow: 0 0 22px rgba(255,0,0,.12);
}
.diamond > span{ font-size:18px; }

/* ===== Dashboard quick actions (replaces ugly KPI box) ===== */
.quick-card{ padding:18px; }
.quick-grid{ display:grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap:12px; }

.quick-tile{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  padding:14px 14px;
  border-radius:18px;
  border:1px solid rgba(255,255,255,.06);
  background: rgba(255,255,255,.02);
  text-decoration:none;
  color:#fff;
  transition: .18s ease;
}
.quick-tile:hover{
  border-color: rgba(255,0,0,.22);
  background: rgba(255,0,0,.08);
  transform: translateY(-1px);
}

.quick-left{ display:flex; align-items:center; gap:12px; min-width:0; }
.quick-ico{
  width:44px; height:44px;
  display:grid; place-items:center;
  border-radius:16px;
  border:1px solid rgba(255,0,0,.18);
  background: rgba(0,0,0,.25);
  box-shadow: inset 0 0 0 1px rgba(255,0,0,.06);
  flex:0 0 auto;
}
.quick-meta{ display:flex; flex-direction:column; min-width:0; }
.quick-title{ font-weight:950; letter-spacing:.2px; }
.quick-desc{ font-size:12px; color:#cfcfcf; margin-top:2px; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.quick-right{ font-weight:950; color:#ffd2d2; font-size:13px; flex:0 0 auto; }

.quick-mini{
  display:flex;
  gap:10px;
  flex-wrap:nowrap;
  padding:10px 12px;
  border-radius:16px;
  border:1px solid rgba(255,0,0,.12);
  background: rgba(0,0,0,.22);
}
.quick-mini .mini{ font-size:12px; color:#d8d8d8; }
.quick-mini .mini b{ color:#fff; }

@media (max-width: 920px){
  .quick-desc{ white-space:normal; }
}


/* Quick grid responsive */
@media (max-width: 640px){
  .quick-grid{ grid-template-columns: 1fr; }
}

/* Typography tuning for readability */
@media (max-width: 640px){
  .h1{ font-size:28px; }
  .hero{ min-height:260px; }
  .container{ padding:18px 14px; }
}
