*{box-sizing:border-box}
html,body{margin:0;padding:0}

html{
  -webkit-text-size-adjust:100%;
}

body{
  font-family:system-ui,-apple-system,Segoe UI,sans-serif;
  background:#f4f6ff;
  color:#111;
}

a{text-decoration:none;color:inherit}
button{font-family:inherit}

.topbar{
  position:sticky;
  top:0;
  z-index:1000;
  background:#1565C0;
  color:#fff;
  box-shadow:0 2px 10px rgba(0,0,0,.08);
}

.topbar-main{
  min-height:56px;
  display:flex;
  align-items:center;
  justify-content:space-between;
  padding:0 14px;
}

@media (max-width:768px){
  .topbar-main{
    min-height:54px;
    padding:0 12px;
  }
}

.brand{
  display:flex;
  align-items:center;
  gap:10px;
  font-weight:800;
  font-size:18px;
  min-width:0;
}

.brand span{
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
}

.topbar-right{
  display:flex;
  align-items:center;
  gap:10px;
  flex-shrink:0;
}

.header-login-link{
  color:#fff;
  font-size:14px;
  font-weight:700;
}

.header-profile img{
  width:36px;
  height:36px;
  border-radius:50%;
  object-fit:cover;
  border:2px solid #fff;
  display:block;
}

.menu-btn{
  background:none;
  border:0;
  color:#fff;
  font-size:22px;
  cursor:pointer;
  padding:4px 8px;
  -webkit-tap-highlight-color:transparent;
}

.bell-btn{
  position:relative;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  width:38px;
  height:38px;
  border-radius:50%;
  background:rgba(255,255,255,.10);
}

.bell-icon{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  line-height:1;
  font-size:21px;
  color:#fff;
  opacity:.85;
  transition:transform .2s ease,color .2s ease,opacity .2s ease;
}

.bell-icon.active{
  color:#22c55e;
  opacity:1;
  transform:scale(1.08);
}

.bell-btn.active{
  background:rgba(25,193,95,.18);
  box-shadow:0 0 0 2px rgba(25,193,95,.22) inset;
}

.bell-status{
  position:absolute;
  top:6px;
  right:6px;
  width:12px;
  height:12px;
  border-radius:50%;
  border:2px solid #1565C0;
  box-shadow:0 0 0 1px rgba(255,255,255,.15);
}

.bell-on{background:#19c15f}
.bell-off{background:#e53935}
.bell-default{background:#f59e0b}

body.drawer-open{
  overflow:hidden;
}

.drawer-overlay{
  position:fixed;
  inset:0;
  background:rgba(0,0,0,.45);
  opacity:0;
  visibility:hidden;
  transition:opacity .25s ease, visibility .25s ease;
  z-index:1999;
  will-change:opacity;
}

.drawer-overlay.show{
  opacity:1;
  visibility:visible;
}

.drawer{
  position:fixed;
  top:0;
  right:0;
  width:78%;
  max-width:360px;
  height:100vh;
  max-height:100vh;
  background:#fff;
  z-index:2000;
  border-radius:18px 0 0 18px;
  box-shadow:-10px 0 30px rgba(0,0,0,.12);
  display:flex;
  flex-direction:column;
  overflow:hidden;
  transform:translateX(100%);
  transition:transform .25s ease;
  will-change:transform;
  overscroll-behavior:contain;
}

.drawer.show{
  transform:translateX(0);
}

.drawer-head{
  flex:0 0 auto;
  padding:calc(14px + env(safe-area-inset-top)) 16px 14px;
  display:flex;
  justify-content:space-between;
  align-items:center;
  background:#f4f6ff;
  font-weight:800;
  font-size:22px;
  position:sticky;
  top:0;
  z-index:2;
  border-bottom:1px solid #e9eefc;
}

.drawer-head button{
  border:1px solid #ddd;
  background:#fff;
  border-radius:8px;
  width:38px;
  height:38px;
  cursor:pointer;
  font-size:18px;
  -webkit-tap-highlight-color:transparent;
}

.drawer-body{
  flex:1 1 auto;
  min-height:0;
  padding:14px 14px calc(110px + env(safe-area-inset-bottom));
  overflow-y:auto;
  overflow-x:hidden;
  -webkit-overflow-scrolling:touch;
  overscroll-behavior:contain;
}

.drawer-btn{
  display:block;
  width:100%;
  padding:12px 14px;
  margin-bottom:10px;
  border:1px solid #e0e6ff;
  border-radius:14px;
  background:#fff;
  font-weight:700;
  font-size:15px;
  line-height:1.35;
  text-align:left;
  cursor:pointer;
  touch-action:pan-y;
  -webkit-tap-highlight-color:transparent;
}

.drawer-btn:last-child{
  margin-bottom:20px;
}

.container{
  max-width:1100px;
  margin:auto;
  padding:12px;
}

#pushPopup{
  position:fixed;
  inset:0;
  background:rgba(0,0,0,.45);
  z-index:99999;
  display:none;
  align-items:center;
  justify-content:center;
  padding:18px;
  overflow:auto;
}

#pushPopup.active{
  display:flex;
}

.drawer[hidden],
.drawer-overlay[hidden],
#pushPopup[hidden]{
  display:none !important;
}

.push-modal{
  width:100%;
  max-width:420px;
  max-height:90vh;
  overflow-y:auto;
  background:#fff;
  border-radius:18px;
  padding:20px;
  box-shadow:0 10px 30px rgba(0,0,0,.18);
  text-align:left;
  color:#111;
}

#categoryCheckboxWrap{
  display:grid;
  gap:12px;
}

.push-cat-row{
  display:grid;
  grid-template-columns:26px 1fr;
  align-items:center;
  gap:12px;
  color:#111;
  font-size:16px;
  font-weight:700;
  line-height:1.35;
}

.push-cat-row input[type="checkbox"]{
  width:20px;
  height:20px;
  margin:0;
  accent-color:#1565C0;
  cursor:pointer;
}

.push-cat-text{
  display:flex;
  align-items:center;
  gap:10px;
  color:#111;
  word-break:break-word;
}

#pushDeniedMsg,
#pushStatusMsg{
  display:none;
  margin:12px 0 0;
  font-size:14px;
  text-align:center;
  line-height:1.5;
}

#pushDeniedMsg{color:#c62828}
#pushStatusMsg{color:#177a35}

.push-progress-wrap{
  margin-top:14px;
}

.push-progress-text{
  font-size:14px;
  color:#1565C0;
  margin-bottom:8px;
  text-align:left;
}

.push-progress-bar{
  width:100%;
  height:10px;
  background:#e8eefc;
  border-radius:999px;
  overflow:hidden;
  position:relative;
}

.push-progress-fill{
  position:absolute;
  top:0;
  left:0;
  width:35%;
  height:100%;
  background:#1565C0;
  border-radius:999px;
  animation:pushLoadingBar 1.1s linear infinite;
}

@keyframes pushLoadingBar{
  0%{left:-35%}
  100%{left:100%}
}

.global-form-loader{
  position:fixed;
  inset:0;
  background:rgba(255,255,255,.88);
  display:flex;
  align-items:center;
  justify-content:center;
  z-index:100000;
  opacity:0;
  visibility:hidden;
  pointer-events:none;
  transition:opacity .18s ease, visibility .18s ease;
}

.global-form-loader.show{
  opacity:1;
  visibility:visible;
  pointer-events:auto;
}

.loader-box{
  background:#fff;
  padding:22px 26px;
  border-radius:18px;
  box-shadow:0 10px 30px rgba(0,0,0,.12);
  text-align:center;
  min-width:180px;
}

.loader-spinner{
  width:46px;
  height:46px;
  border:4px solid #e5e7eb;
  border-top:4px solid #1565C0;
  border-radius:50%;
  margin:0 auto 12px;
  animation:spin .8s linear infinite;
}

.loader-text{
  font-size:15px;
  font-weight:600;
  color:#222;
}

body.form-loading{
  overflow:hidden;
}

@keyframes spin{
  100%{transform:rotate(360deg)}
}

.field-error{
  min-height:18px;
  margin-top:4px;
  margin-bottom:6px;
  font-size:13px;
  color:#dc2626;
  font-weight:700;
}

.input-error{
  border-color:#dc2626 !important;
  background:#fff6f6;
}

.input-error:focus{
  border-color:#dc2626;
  box-shadow:0 0 0 3px rgba(220,38,38,.12);
}

.app-startup-loader{
  position:fixed;
  inset:0;
  background:rgba(244,246,255,.82);
  display:flex;
  align-items:center;
  justify-content:center;
  z-index:999999;
  opacity:1;
  visibility:visible;
  transition:opacity .4s ease, visibility .4s ease;
}

.app-startup-loader.hide{
  opacity:0;
  visibility:hidden;
  pointer-events:none;
}

.app-startup-inner{
  position:relative;
  width:190px;
  height:235px;
  display:flex;
  flex-direction:column;
  align-items:center;
  justify-content:center;
  text-align:center;
}

.app-startup-ring{
  position:absolute;
  top:0;
  left:50%;
  transform:translateX(-50%);
  width:180px;
  height:180px;
  border-radius:50%;
  border:3px solid rgba(21,101,192,.14);
  border-top-color:#1565C0;
  border-right-color:rgba(21,101,192,.35);
  animation:rrAppSpin 1.05s linear infinite;
  box-shadow:0 0 0 6px rgba(21,101,192,.03);
  will-change:transform;
}

.app-startup-logo{
  position:absolute;
  top:54px;
  left:50%;
  transform:translateX(-50%);
  width:76px;
  height:76px;
  display:flex;
  align-items:center;
  justify-content:center;
}

.app-startup-logo img{
  width:76px;
  height:76px;
  object-fit:contain;
  display:block;
  filter:drop-shadow(0 6px 14px rgba(21,101,192,.12));
}

.app-startup-text{
  position:absolute;
  bottom:18px;
  left:50%;
  transform:translateX(-50%);
  width:240px;
  font-size:15px;
  font-weight:800;
  color:#1565C0;
  letter-spacing:.2px;
}

.app-startup-subtext{
  position:absolute;
  bottom:-2px;
  left:50%;
  transform:translateX(-50%);
  width:240px;
  font-size:12px;
  font-weight:600;
  color:#5f6b7a;
  opacity:.9;
}

@keyframes rrAppSpin{
  to{
    transform:translateX(-50%) rotate(360deg);
  }
}