:root{
  --bg: #1b3a66;
  --bg2:#1b3a66;
  --panel:#1f4172;
  --panel2:#234a82;
  --card:#234a82;
  --card2:#28508d;
  --stroke: rgba(255,255,255,.10);
  --stroke2: rgba(255,255,255,.16);
  --text:#eaf1ff;
  --muted: rgba(234,241,255,.72);
  --muted2: rgba(234,241,255,.52);
  --red:#EB233C;
  --cyan:#2aa6ff;
  --ok:#2ad37e;
  --warn:#ffb020;
  --radius:16px;
  --radius2:20px;
  --shadow: 0 14px 40px rgba(0,0,0,.35);
}

*{box-sizing:border-box}
html,body{height:100%}
body{
  margin:0;
  font-family: Inter, system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
}

/*
  IMPORTANT
  ---------
  This stylesheet intentionally supports TWO class naming schemes.

  A previous version used:
    .appShell / .sidebar / .rightbar / .btnSide / .filterInput / .btnClear / .fab

  The current index.php uses:
    .layout / .side / .right / .sideBtn / .filter / .clearBtn / .gearFab

  To avoid changing any PHP/HTML/JS, we alias selectors so BOTH work.
*/

/* Shell */
.appShell,
.layout{
  display:grid;
  grid-template-columns: 290px 1fr 280px;
  gap:18px;
  padding:18px;
  min-height:100vh;
}

/* Sidebar */
.sidebar,
.side{
  background: rgba(10,16,28,.20);
  border:1px solid var(--stroke);
  border-radius: var(--radius2);
  padding:16px;
  box-shadow: var(--shadow);
  position:sticky;
  top:18px;
  height: calc(100vh - 36px);
  overflow:auto;
}

.brand{
  display:flex;
  align-items:center;
  gap:12px;
  padding:8px 8px 14px 8px;
}
.appLogo,
.brandLogo{
  width:56px;
  height:56px;
  max-width:56px;
  max-height:56px;
  object-fit:contain;
  border-radius:12px;
  background: rgba(0,0,0,.14);
  border:1px solid var(--stroke);
  flex: 0 0 auto;
}
.brandText .title,
.brandText .brandTitle{
  font-weight:900;
  letter-spacing:.5px;
  font-size:16px;
}
.brandText .sub,
.brandText .brandSub{
  color: var(--muted2);
  font-size:12px;
  margin-top:3px;
}

/* Sidebar blocks (current markup) */
.sideBlock{padding:0 8px 10px}
.sideHdr{
  color: var(--muted2);
  font-size:12px;
  font-weight:800;
  letter-spacing:.12em;
  margin:14px 0 8px;
}
.sideRow{display:flex; gap:10px}

.sideHint{
  color: var(--muted2);
  font-size:12px;
  margin-top:10px;
  line-height:1.35;
}

.sideFooter,
.sideBottom{
  margin-top:auto;
  padding:12px 8px 6px;
  color: var(--muted2);
  font-size:12px;
  border-top: 1px solid rgba(255,255,255,.06);
}
.muted{color: var(--muted2)}

.sideSectionTitle{
  color: var(--muted2);
  font-size:12px;
  font-weight:800;
  letter-spacing:.12em;
  margin:14px 8px 8px;
}
.sideBtns{display:flex; flex-direction:column; gap:10px; padding:0 8px 8px;}
.btnSide,
.sideBtn{
  width:100%;
  display:flex;
  align-items:center;
  justify-content:center;
  gap:10px;
  padding:11px 12px;
  border-radius: 12px;
  background: rgba(255,255,255,.04);
  border:1px solid var(--stroke);
  color: var(--text);
  font-weight:800;
  letter-spacing:.04em;
  cursor:pointer;
}
.btnSide:hover,
.sideBtn:hover{border-color:var(--stroke2); background: rgba(255,255,255,.06)}
.btnSide i,
.sideBtn i{color: var(--cyan)}
.btnSideRed i{color: var(--red)}

.sideBtn.half{flex:1}
.sideBtn.primary{background: rgba(235,35,60,.14); border-color: rgba(235,35,60,.40)}
.sideBtn.primary i{color: var(--text)}
.btnSideSmallRow{
  display:flex;
  gap:10px;
  padding:0 8px 8px;
}
.btnSideSmall{flex:1}

.sideBottom{
  margin-top:auto;
  padding:12px 8px 6px;
  color: var(--muted2);
  font-size:12px;
  border-top: 1px solid rgba(255,255,255,.06);
}

/* Main */
.main{
  background: rgba(10,16,28,.12);
  border:1px solid var(--stroke);
  border-radius: var(--radius2);
  box-shadow: var(--shadow);
  padding:18px;
  overflow:hidden;
}

/* Main header (current markup) */
.mainTop{padding-bottom:12px}
.mainTitle{font-size:28px; font-weight:950; letter-spacing:.2px}
.mainSub{color: var(--muted2); margin-top:6px; font-size:13px}

.mainHeader{
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:12px;
  padding-bottom:12px;
}
.mainHeader h1{
  margin:0;
  font-size:28px;
  letter-spacing:.2px;
}
.mainHeader .hint{
  color: var(--muted2);
  margin-top:6px;
  font-size:13px;
}

.filterRow{
  display:flex;
  gap:10px;
  align-items:center;
  padding:10px 0 16px;
}
.filterInput,
.filter{
  flex:1;
  background: rgba(255,255,255,.04);
  border:1px solid rgba(255,255,255,.10);
  color: var(--text);
  padding:12px 14px;
  border-radius: 12px;
  outline:none;
}
.filterInput:focus,
.filter:focus{
  border-color: rgba(42,166,255,.38);
  box-shadow: 0 0 0 3px rgba(42,166,255,.12);
}
.btnClear,
.clearBtn{
  padding:12px 14px;
  border-radius:12px;
  background: rgba(255,255,255,.04);
  border:1px solid rgba(255,255,255,.10);
  color: var(--text);
  cursor:pointer;
  font-weight:800;
}
.btnClear:hover,
.clearBtn:hover{border-color: rgba(255,255,255,.18)}

/* Queue */
.queue{
  max-height: calc(100vh - 210px);
  overflow:auto;
  padding-right:6px;
}
.queue::-webkit-scrollbar{width:10px}
.queue::-webkit-scrollbar-thumb{background:rgba(255,255,255,.10); border-radius:10px}
.queue::-webkit-scrollbar-thumb:hover{background:rgba(255,255,255,.14)}

/* Hidden rows (toggled by "Show Hidden") */
.isHidden{display:none !important}

.qCat{
  background: rgba(255,255,255,.03);
  border:1px solid rgba(255,255,255,.08);
  border-radius: var(--radius);
  margin-bottom:14px;
  overflow:hidden;
}
.qCatHead{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:10px;
  padding:14px 14px;
  background: rgba(255,255,255,.03);
  border-bottom:1px solid rgba(255,255,255,.06);
}
.qCatLeft{
  display:flex;
  align-items:center;
  gap:10px;
}
.qCatToggle{
  width:36px;
  height:36px;
  border-radius:12px;
  background: rgba(255,255,255,.04);
  border:1px solid rgba(255,255,255,.10);
  color: var(--text);
  cursor:pointer;
}
.qCatTitle{
  font-weight:900;
  letter-spacing:.2px;
}
.pillTag{
  display:inline-flex;
  align-items:center;
  gap:6px;
  padding:4px 9px;
  border-radius:999px;
  background: rgba(42,166,255,.10);
  border:1px solid rgba(42,166,255,.22);
  color: var(--text);
  font-size:12px;
  font-weight:800;
}
.pillTagRed{
  background: rgba(235,35,60,.12);
  border-color: rgba(235,35,60,.30);
}
.qItems{padding:10px 12px 12px}

.qItem{
  background: rgba(255,255,255,.03);
  border:1px solid rgba(255,255,255,.08);
  border-radius: 14px;
  padding:12px 12px;
  margin-top:10px;
}
.qItemTitle{
  font-weight:900;
  font-size:16px;
  margin-bottom:10px;
}
.qItemControls{
  display:flex;
  flex-wrap:wrap;
  gap:10px;
  align-items:center;
}
.chk{
  display:flex;
  align-items:center;
  gap:8px;
  padding:8px 10px;
  border-radius:12px;
  background: rgba(255,255,255,.03);
  border:1px solid rgba(255,255,255,.08);
  font-weight:800;
  font-size:12px;
  letter-spacing:.04em;
}
.chk input{width:16px; height:16px; accent-color: var(--cyan)}
.btnTag{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  gap:8px;
  padding:9px 12px;
  border-radius:12px;
  background: rgba(255,255,255,.03);
  border:1px solid rgba(255,255,255,.10);
  color: var(--text);
  font-weight:900;
  letter-spacing:.04em;
  cursor:pointer;
}
.btnTag:hover{border-color: rgba(255,255,255,.18)}
.btnTagHas{
  background: rgba(235,35,60,.12);
  border-color: rgba(235,35,60,.35);
}
.btnTagNote{
  min-width:132px;
}
.btnIcon{
  width:38px;
  height:38px;
  border-radius:12px;
  background: rgba(255,255,255,.03);
  border:1px solid rgba(255,255,255,.10);
  color: var(--text);
  cursor:pointer;
}
.btnIcon:hover{border-color: rgba(255,255,255,.18)}
.btnIconDanger{border-color: rgba(235,35,60,.35)}
.btnIconDanger:hover{background: rgba(235,35,60,.10)}

/* Right stats */
.rightbar,
.right{
  background: rgba(10,16,28,.20);
  border:1px solid var(--stroke);
  border-radius: var(--radius2);
  padding:16px;
  box-shadow: var(--shadow);
  position:sticky;
  top:18px;
  height: calc(100vh - 36px);
  overflow:auto;
}
.cardBig,
.statCard{
  border-radius: var(--radius2);
  border:1px solid rgba(255,255,255,.08);
  background: rgba(255,255,255,.03);
  padding:18px;
  margin-bottom:14px;
}
.cardLabel,
.statLabel{
  color: var(--muted2);
  font-weight:900;
  font-size:12px;
  letter-spacing:.14em;
}
.cardValue,
.statValue{
  font-size:40px;
  font-weight:950;
  margin-top:10px;
  color: var(--cyan);
}
.cardSub,
.statSub{
  color: var(--muted2);
  margin-top:6px;
  font-weight:800;
  letter-spacing:.08em;
  font-size:11px;
}

/* Floating gear */
.fab,
.gearFab{
  position:fixed;
  right:20px;
  bottom:20px;
  width:52px;
  height:52px;
  border-radius: 16px;
  background: rgba(235,35,60,.14);
  border:1px solid rgba(235,35,60,.40);
  color: var(--text);
  cursor:pointer;
  display:flex;
  align-items:center;
  justify-content:center;
  box-shadow: var(--shadow);
}
.fab:hover,
.gearFab:hover{background: rgba(235,35,60,.18)}

/* Backdrop & Modals */
.backdrop{
  position:fixed;
  inset:0;
  background: rgba(0,0,0,.44);
  display:none;
  align-items:center;
  justify-content:center;
  padding:18px;
  z-index:999;
}
.backdrop.open{display:flex}

.modal{
  width:min(860px, 100%);
  border-radius: var(--radius2);
  background: var(--panel);
  border:1px solid rgba(255,255,255,.12);
  box-shadow: var(--shadow);
  display:none;
}
.modal.open{display:block}
.modal.small{width:min(520px, 100%)}
.modalHead{
  display:flex;
  align-items:center;
  justify-content:space-between;
  padding:16px 18px;
  border-bottom:1px solid rgba(255,255,255,.08);
}
.modalTitle{
  font-weight:950;
  letter-spacing:.04em;
}
.iconBtn,
.iconX{
  width:42px;
  height:42px;
  border-radius:14px;
  background: rgba(255,255,255,.04);
  border:1px solid rgba(255,255,255,.10);
  color: var(--text);
  cursor:pointer;
  display:flex;
  align-items:center;
  justify-content:center;
}
.iconBtn:hover,
.iconX:hover{border-color: rgba(255,255,255,.18)}
.modalBody{padding:16px 18px}

/* Form bits inside modals (current markup) */
.field{width:100%; margin-bottom:12px}
.label{color: var(--muted2); font-weight:900; font-size:12px; letter-spacing:.12em; margin:0 0 8px 2px}
.input{
  width:100%;
  background: rgba(255,255,255,.04);
  border:1px solid rgba(255,255,255,.10);
  color: var(--text);
  border-radius: 14px;
  padding:12px 12px;
  outline:none;
}
.input:focus{border-color: rgba(42,166,255,.38); box-shadow: 0 0 0 3px rgba(42,166,255,.12)}

.row{display:flex; gap:10px; align-items:center; flex-wrap:wrap}
.spacer{flex:1}

.btn{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  gap:8px;
  padding:11px 14px;
  border-radius: 14px;
  background: rgba(255,255,255,.04);
  border:1px solid rgba(255,255,255,.10);
  color: var(--text);
  cursor:pointer;
  font-weight:950;
  letter-spacing:.04em;
}
.btn:hover{border-color: rgba(255,255,255,.18)}
.btn.primary{background: rgba(235,35,60,.14); border-color: rgba(235,35,60,.40)}
.btn.danger{background: rgba(235,35,60,.16); border-color: rgba(235,35,60,.48)}
.btn.full{width:100%}

.callout{
  border-radius: 16px;
  border:1px solid rgba(255,255,255,.10);
  background: rgba(255,255,255,.03);
  padding:12px 14px;
  margin-bottom:14px;
  color: var(--muted);
  font-weight:700;
  line-height:1.35;
}

.textarea, .importArea{
  width:100%;
  background: rgba(255,255,255,.04);
  border:1px solid rgba(255,255,255,.10);
  color: var(--text);
  border-radius: 14px;
  padding:12px 12px;
  outline:none;
}
.textarea:focus, .importArea:focus{
  border-color: rgba(42,166,255,.38);
  box-shadow: 0 0 0 3px rgba(42,166,255,.12);
}
.noteMeta{
  color: var(--muted);
  font-weight:800;
  font-size:12px;
  margin-bottom:10px;
}
.modalActions{
  display:flex;
  gap:10px;
  flex-wrap:wrap;
  margin-top:12px;
}
.btnMain{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  gap:8px;
  padding:11px 14px;
  border-radius: 14px;
  background: rgba(255,255,255,.04);
  border:1px solid rgba(255,255,255,.10);
  color: var(--text);
  cursor:pointer;
  font-weight:950;
  letter-spacing:.04em;
}
.btnMain:hover{border-color: rgba(255,255,255,.18)}
.btnPrimary{
  background: rgba(235,35,60,.14);
  border-color: rgba(235,35,60,.40);
}
.btnDanger{
  background: rgba(235,35,60,.16);
  border-color: rgba(235,35,60,.48);
}
.toast{
  display:none;
  margin-top:10px;
  padding:10px 12px;
  border-radius: 14px;
  border:1px solid rgba(255,255,255,.12);
  background: rgba(255,255,255,.04);
  color: var(--text);
  font-weight:800;
}
.toast.show{display:block}
.toast.ok{border-color: rgba(42,211,126,.28)}
.toast.bad{border-color: rgba(235,35,60,.34)}

.exportGrid{
  display:grid;
  grid-template-columns: 1fr 1fr;
  gap:14px;
}
.exportBox{
  border-radius: 16px;
  border:1px solid rgba(255,255,255,.10);
  background: rgba(255,255,255,.03);
  padding:14px;
}
.boxTitle{margin:0 0 10px 0; font-size:14px; letter-spacing:.04em; font-weight:950}
.exportBox h3{margin:0 0 10px 0; font-size:14px; letter-spacing:.04em}
.smallText{color: var(--muted2); font-size:12px; line-height:1.35}

/* Responsive */
@media (max-width: 1100px){
  .appShell,
  .layout{grid-template-columns: 270px 1fr; }
  .rightbar,
  .right{display:none}
}
@media (max-width: 860px){
  .appShell,
  .layout{grid-template-columns: 1fr; }
  .sidebar,
  .side{position:relative; height:auto}
  .main{padding:14px}
  .queue{max-height:none}
  .btnTagNote{min-width: 120px}
  .fab,
  .gearFab{right:14px; bottom:14px}
  .exportGrid{grid-template-columns: 1fr}
}

/* Prevent any accidental horizontal overflow */
body{overflow-x:hidden}
