@import url('https://fonts.googleapis.com/css2?family=Montserrat:wght@400;500;600;700;800;900&display=swap');

*{
  margin:0;
  padding:0;
  box-sizing:border-box;
  font-family:'Montserrat', sans-serif;
}

:root{
  --black:#050505;
  --black2:#0b0b0b;
  --card:rgba(18,18,18,0.86);
  --card2:#111;
  --gold:#c9a227;
  --gold-light:#f3d77b;
  --muted:#9b9b9b;
  --white:#f8f8f8;
  --line:rgba(201,162,39,0.28);
  --soft-line:rgba(255,255,255,0.08);
  --green:#16a34a;
  --red:#dc2626;
  --orange:#d97706;
}

body{
  min-height:100vh;
  color:var(--white);
  background:
    radial-gradient(circle at 10% 0%, rgba(201,162,39,0.22), transparent 28%),
    radial-gradient(circle at 90% 10%, rgba(243,215,123,0.10), transparent 28%),
    linear-gradient(135deg,#020202 0%,#0b0b0b 45%,#030303 100%);
}

/* Premium background pattern */
body::before{
  content:"";
  position:fixed;
  inset:0;
  pointer-events:none;
  background-image:
    linear-gradient(rgba(255,255,255,0.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.025) 1px, transparent 1px);
  background-size:42px 42px;
  mask-image:linear-gradient(to bottom, black, transparent 85%);
}

/* LOGIN / REGISTER */

.login-container{
  min-height:100vh;
  display:flex;
  align-items:center;
  justify-content:center;
  padding:24px;
}

.login-box{
  width:440px;
  position:relative;
  background:linear-gradient(180deg,rgba(24,24,24,.92),rgba(7,7,7,.96));
  border:1px solid var(--line);
  border-radius:28px;
  padding:46px 38px;
  box-shadow:
    0 40px 100px rgba(0,0,0,.65),
    inset 0 1px 0 rgba(255,255,255,.08);
  backdrop-filter:blur(18px);
  overflow:hidden;
}

.login-box::before{
  content:"";
  position:absolute;
  top:0;
  left:0;
  width:100%;
  height:5px;
  background:linear-gradient(90deg,transparent,var(--gold),var(--gold-light),var(--gold),transparent);
}

.login-box h1{
  text-align:center;
  font-size:31px;
  letter-spacing:2px;
  color:var(--gold-light);
  margin-bottom:9px;
}

.login-box p{
  text-align:center;
  color:var(--muted);
  font-size:14px;
  margin-bottom:34px;
}

.login-box input,
.login-box select{
  width:100%;
  padding:15px 16px;
  margin-bottom:15px;
  background:rgba(0,0,0,.46);
  border:1px solid var(--soft-line);
  border-radius:14px;
  color:white;
  font-size:15px;
  outline:none;
}

.login-box input:focus,
.login-box select:focus{
  border-color:var(--gold);
  box-shadow:0 0 0 4px rgba(201,162,39,.10);
}

.login-box button,
.admin-header button,
.dashboard-header button{
  border:0;
  border-radius:14px;
  padding:14px 22px;
  cursor:pointer;
  font-weight:800;
  color:#111;
  background:linear-gradient(135deg,#a87f17,#f3d77b,#c9a227);
  box-shadow:0 10px 30px rgba(201,162,39,.22);
}

.login-box button{
  width:100%;
  margin-top:6px;
  font-size:16px;
}

.login-box a{
  display:block;
  text-align:center;
  margin-top:24px;
  color:var(--gold-light);
  text-decoration:none;
  font-size:14px;
}

/* ADMIN / DASHBOARD */

.admin-container,
.dashboard-container{
  width:100%;
  min-height:100vh;
  padding:34px;
}

.admin-header,
.dashboard-header{
  position:relative;
  display:flex;
  justify-content:space-between;
  align-items:center;
  padding:26px 32px;
  margin-bottom:28px;
  border-radius:26px;
  background:linear-gradient(135deg,rgba(22,22,22,.92),rgba(6,6,6,.95));
  border:1px solid var(--line);
  box-shadow:0 30px 80px rgba(0,0,0,.45);
  overflow:hidden;
}

.admin-header::before,
.dashboard-header::before{
  content:"";
  position:absolute;
  top:0;
  left:0;
  width:100%;
  height:4px;
  background:linear-gradient(90deg,transparent,var(--gold),var(--gold-light),transparent);
}

.admin-header h1,
.dashboard-header h1{
  font-size:30px;
  letter-spacing:2px;
  color:var(--gold-light);
  margin-bottom:7px;
  font-weight:800;
text-transform:uppercase; 
}

.admin-header p,
.dashboard-header p{
  color:var(--muted);
  font-size:14px;
}

.admin-card,
.dashboard-card{
  position:relative;
  padding:28px;
  margin-bottom:28px;
  border-radius:26px;
  background:linear-gradient(180deg,rgba(18,18,18,.9),rgba(8,8,8,.94));
  border:1px solid var(--soft-line);
  box-shadow:0 26px 70px rgba(0,0,0,.42);
}

.admin-card h2,
.dashboard-card h2{
  font-size:23px;
  color:var(--gold-light);
  margin-bottom:24px;
  padding-bottom:15px;
  border-bottom:1px solid var(--line);
}

/* USER CARDS */

.user-row{
  position:relative;
  display:flex;
  justify-content:space-between;
  gap:24px;
  padding:22px;
  margin-bottom:18px;
  border-radius:22px;
  background:
    linear-gradient(135deg,rgba(255,255,255,.055),rgba(255,255,255,.018)),
    #0d0d0d;
  border:1px solid rgba(255,255,255,.075);
  box-shadow:0 18px 45px rgba(0,0,0,.32);
}

.user-row::before{
  content:"";
  position:absolute;
  left:0;
  top:18px;
  bottom:18px;
  width:4px;
  border-radius:10px;
  background:linear-gradient(var(--gold-light),var(--gold));
}

.user-info{
  padding-left:10px;
}

.user-info h3{
  font-size:21px;
  color:white;
  margin-bottom:13px;
}

.user-info p{
  color:var(--muted);
  font-size:14px;
  margin:7px 0;
  line-height:1.5;
}

.user-info strong{
  color:var(--gold-light);
}

.user-actions{
  display:flex;
  flex-wrap:wrap;
  align-items:flex-start;
  justify-content:flex-end;
  gap:10px;
  min-width:260px;
}

.approve-btn,
.reject-btn,
.deactivate-btn,
.delete-btn{
  border:0;
  color:white;
  padding:11px 16px;
  border-radius:12px;
  cursor:pointer;
  font-weight:800;
  box-shadow:0 8px 22px rgba(0,0,0,.24);
}

.approve-btn{background:linear-gradient(135deg,#15803d,#22c55e);}
.reject-btn{background:linear-gradient(135deg,#991b1b,#ef4444);}
.deactivate-btn{background:linear-gradient(135deg,#92400e,#f59e0b);}
.delete-btn{background:linear-gradient(135deg,#450a0a,#991b1b);}

.muted{
  color:var(--muted);
  padding:18px;
  border-radius:18px;
  background:rgba(255,255,255,.035);
  border:1px dashed var(--line);
}

/* DASHBOARD */

.dashboard-card p{
  padding:17px 18px;
  margin-bottom:14px;
  border-radius:16px;
  color:var(--muted);
  background:rgba(255,255,255,.04);
  border:1px solid rgba(255,255,255,.07);
}

.dashboard-card span{
  color:white;
  font-weight:800;
}

/* HOVER */

button{
  transition:.22s ease;
}

button:hover{
  transform:translateY(-2px);
  filter:brightness(1.08);
}

/* MOBILE */

@media(max-width:768px){ 
  .admin-container,
  .dashboard-container{
    padding:18px;
  }

  .admin-header,
  .dashboard-header{
    flex-direction:column;
    align-items:flex-start;
    gap:18px;
  }

  .user-row{
    flex-direction:column;
  }

  .user-actions{
    justify-content:flex-start;
    min-width:unset;
    width:100%;
  }

  .login-box{
    width:100%;
    padding:38px 24px;
  }
}

.upload-grid{
  display:grid;
  grid-template-columns:repeat(auto-fit,minmax(220px,1fr));
  gap:14px;
  margin-bottom:18px;
}

.upload-grid input,
.upload-grid select{
  width:100%;
  padding:14px 15px;
  border-radius:14px;
  border:1px solid rgba(255,255,255,0.08);
  background:rgba(0,0,0,0.45);
  color:white;
  outline:none;
}

.upload-grid input:focus,
.upload-grid select:focus{
  border-color:var(--gold);
}

.upload-btn{
  border:0;
  border-radius:14px;
  padding:14px 22px;
  cursor:pointer;
  font-weight:800;
  color:#111;
  background:linear-gradient(135deg,#a87f17,#f3d77b,#c9a227);
}


.admin-shell{
  min-height:100vh;
  display:grid;
  grid-template-columns:280px 1fr;
  gap:24px;
  padding:24px;
}

.admin-sidebar{
  position:sticky;
  top:24px;
  height:calc(100vh - 48px);
  background:linear-gradient(180deg,rgba(18,18,18,.96),rgba(4,4,4,.98));
  border:1px solid var(--line);
  border-radius:26px;
  padding:24px;
  box-shadow:0 30px 80px rgba(0,0,0,.45);
}

.brand-box{
  padding-bottom:24px;
  margin-bottom:22px;
  border-bottom:1px solid var(--line);
}

.brand-box h1{
  color:var(--gold-light);
  font-size:30px;
  letter-spacing:3px;
}

.brand-box p{
  color:var(--muted);
  margin-top:6px;
}

.menu-btn{
  width:100%;
  text-align:left;
  margin-bottom:12px;
  padding:15px 16px;
  border-radius:16px;
  border:1px solid rgba(255,255,255,.08);
  background:rgba(255,255,255,.035);
  color:#ddd;
  font-weight:700;
  cursor:pointer;
}

.menu-btn.active{
  color:#111;
  background:linear-gradient(135deg,#a87f17,#f3d77b,#c9a227);
  box-shadow:0 12px 30px rgba(201,162,39,.2);
}

.sidebar-logout{
  position:absolute;
  left:24px;
  right:24px;
  bottom:24px;
  border:0;
  border-radius:16px;
  padding:14px;
  font-weight:800;
  background:linear-gradient(135deg,#a87f17,#f3d77b,#c9a227);
  color:#111;
  cursor:pointer;
}

.admin-main{
  min-width:0;
}

.admin-topbar{
  background:linear-gradient(135deg,rgba(22,22,22,.92),rgba(6,6,6,.95));
  border:1px solid var(--line);
  border-radius:26px;
  padding:26px 32px;
  margin-bottom:24px;
  box-shadow:0 30px 80px rgba(0,0,0,.38);
}

.admin-topbar h2{
  color:var(--gold-light);
  font-size:28px;
  letter-spacing:.6px;
}

.admin-topbar p{
  color:var(--muted);
  margin-top:8px;
}

.menu-section{
  display:none;
}

.menu-section.active-section{
  display:block;
}

#uploadSection input,
#uploadSection select{
  width:100%;
  min-height:52px;
  font-size:14px;
}

#uploadStatus{
  margin-top:16px;
}

@media(max-width:900px){
  .admin-shell{
    grid-template-columns:1fr;
  }

  .admin-sidebar{
    position:relative;
    top:0;
    height:auto;
  }

  .sidebar-logout{
    position:relative;
    left:auto;
    right:auto;
    bottom:auto;
    width:100%;
    margin-top:18px;
  }
}


.doc-card{
  display:flex;
  justify-content:space-between;
  align-items:center;
  gap:18px;
  padding:18px;
  margin-bottom:14px;
  border-radius:18px;
  background:rgba(255,255,255,.04);
  border:1px solid rgba(255,255,255,.08);
}

.doc-card h3{
  color:var(--gold-light);
  margin-bottom:8px;
}

.doc-card p{
  padding:0;
  margin:4px 0;
  background:none;
  border:none;
  color:var(--muted);
}

.doc-card strong{
  color:var(--gold-light);
}

.view-doc-btn{
  border:0;
  border-radius:14px;
  padding:12px 18px;
  cursor:pointer;
  font-weight:800;
  color:#111;
  background:linear-gradient(135deg,#a87f17,#f3d77b,#c9a227);
  white-space:nowrap;
}

@media(max-width:768px){
  .doc-card{
    flex-direction:column;
    align-items:flex-start;
  }
}


.viewer-body{
  min-height:100vh;
  background:#050505;
  overflow:hidden;
  user-select:none;
}

.viewer-header{
  height:86px;
  display:flex;
  justify-content:space-between;
  align-items:center;
  padding:18px 28px;
  background:linear-gradient(135deg,rgba(18,18,18,.96),rgba(4,4,4,.98));
  border-bottom:1px solid rgba(201,162,39,.35);
  color:white;
  position:relative;
  z-index:20;
}

.viewer-header h1{
  color:var(--gold-light);
  font-size:24px;
}

.viewer-header p{
  color:var(--muted);
  font-size:13px;
  margin-top:6px;
}

.viewer-header button{
  border:0;
  border-radius:14px;
  padding:13px 18px;
  cursor:pointer;
  font-weight:800;
  color:#111;
  background:linear-gradient(135deg,#a87f17,#f3d77b,#c9a227);
}

.secure-viewer{
  position:relative;
  width:100%;
  height:calc(100vh - 86px);
  background:#111;
  overflow:hidden;
}

#documentFrame{
  width:100%;
  height:100%;
  border:none;
  background:#ffffff;
  position:relative;
  z-index:1;
}

#watermarkLayer{
  position:absolute;
  inset:0;
  z-index:10;
  pointer-events:none;
  display:grid;
  grid-template-columns:repeat(6, 1fr);
  grid-auto-rows:90px;
  opacity:.42;
  mix-blend-mode:multiply;
  animation:watermarkMove 18s linear infinite;
}

.watermark-text{
  color:rgba(80,0,0,.88);
  font-size:13px;
  font-weight:900;
  transform:rotate(-28deg);
  white-space:nowrap;
  text-transform:uppercase;
}

#protectionOverlay{
  position:absolute;
  inset:0;
  z-index:12;
  pointer-events:none;
  background:
    repeating-linear-gradient(
      -30deg,
      rgba(201,162,39,.06) 0px,
      rgba(201,162,39,.06) 1px,
      transparent 1px,
      transparent 22px
    );
}

.viewer-blur .secure-viewer{
  filter:blur(18px);
}

@keyframes watermarkMove{
  from{
    transform:translate(-40px,-40px);
  }
  to{
    transform:translate(40px,40px);
  }
}

.viewer-body{
  min-height:100vh;
  background:#050505;
  overflow:hidden;
  user-select:none;
}

.viewer-header{
  height:86px;
  display:flex;
  justify-content:space-between;
  align-items:center;
  padding:18px 28px;
  background:linear-gradient(135deg,rgba(18,18,18,.96),rgba(4,4,4,.98));
  border-bottom:1px solid rgba(201,162,39,.35);
  color:white;
  position:relative;
  z-index:50;
}

.viewer-header h1{
  color:var(--gold-light);
  font-size:24px;
}

.viewer-header p{
  color:var(--muted);
  font-size:13px;
  margin-top:6px;
}

.viewer-header button{
  border:0;
  border-radius:14px;
  padding:13px 18px;
  cursor:pointer;
  font-weight:800;
  color:#111;
  background:linear-gradient(135deg,#a87f17,#f3d77b,#c9a227);
}

.secure-viewer{
  position:relative;
  width:100%;
  height:calc(100vh - 86px);
  background:#0b0b0b;
  overflow:auto;
  padding:28px;
}

#pdfCanvasContainer{
  position:relative;
  z-index:5;
  max-width:1050px;
  margin:0 auto;
}

.pdf-page-wrap{
  background:#111;
  padding:18px;
  margin-bottom:28px;
  border-radius:18px;
  border:1px solid rgba(255,255,255,.08);
  box-shadow:0 18px 50px rgba(0,0,0,.45);
}

.pdf-page-canvas{
  width:100%;
  height:auto;
  display:block;
  border-radius:10px;
  background:white;
  pointer-events:none;
}

#screenshotWatermark{
  position:fixed;
  inset:86px 0 0 0;
  z-index:25;
  pointer-events:none;
  display:grid;
  grid-template-columns:repeat(6,1fr);
  grid-auto-rows:90px;
  opacity:0;
  transition:.18s ease;
  background:rgba(255,255,255,.06);
}

#screenshotWatermark.watermark-active{
  opacity:.92;
}

.screenshot-watermark-text{
  color:rgba(110,0,0,.95);
  font-size:13px;
  font-weight:900;
  transform:rotate(-28deg);
  white-space:nowrap;
  text-transform:uppercase;
  mix-blend-mode:multiply;
}

#protectionOverlay{
  position:fixed;
  inset:86px 0 0 0;
  z-index:20;
  pointer-events:none;
  background:
    repeating-linear-gradient(
      -30deg,
      rgba(201,162,39,.035) 0px,
      rgba(201,162,39,.035) 1px,
      transparent 1px,
      transparent 24px
    );
}

.viewer-blur .secure-viewer{
  filter:blur(18px);
}


.erp-layout{
  min-height:100vh;
  display:grid;
  grid-template-columns:280px 1fr;
  background:#f3f4f6;
  color:#172033;
}

.erp-sidebar{
  width:265px;
  height:100vh;
  background:#050505;
  display:flex;
  flex-direction:column;
  padding:26px 18px;
  position:sticky;
  top:0;
  overflow:hidden;
}

.erp-menu{
  flex:1;
  overflow-y:auto;
  padding-right:4px;
}

/* premium scrollbar */

.erp-menu::-webkit-scrollbar{
  width:6px;
}

.erp-menu::-webkit-scrollbar-track{
  background:transparent;
}

.erp-menu::-webkit-scrollbar-thumb{
  background:#c9a227;
  border-radius:20px;
}

.erp-brand{
  display:flex;
  align-items:center;
  gap:14px;
  padding:10px 8px 28px;
  border-bottom:1px solid rgba(255,255,255,.12);
  margin-bottom:22px;
}

.brand-mark{
  width:48px;
  height:48px;
  border-radius:14px;
  background:linear-gradient(135deg,#a87f17,#f3d77b,#c9a227);
  color:#111;
  display:flex;
  align-items:center;
  justify-content:center;
  font-weight:900;
  font-size:24px;
}

.erp-brand h2{
  font-size:22px;
  letter-spacing:1px;
}

.erp-brand p{
  font-size:12px;
  opacity:.75;
}

.erp-menu{
  display:flex;
  flex-direction:column;
  gap:8px;
}

.erp-menu .menu-btn{
  width:100%;
  border:0;
  background:transparent;
  color:rgba(255,255,255,.78);
  text-align:left;
  padding:14px 16px;
  border-radius:12px;
  cursor:pointer;
  font-weight:700;
}

.erp-menu .menu-btn:hover,
.erp-menu .menu-btn.active{
  background:linear-gradient(135deg,#a87f17,#f3d77b,#c9a227);
  color:#111;
  box-shadow:0 10px 24px rgba(201,162,39,.22);
}

.erp-logout{
  margin-top:auto;
  border:0;
  padding:14px;
  border-radius:12px;
  background:#f6c94c;
  color:#1f2f46;
  font-weight:900;
  cursor:pointer;
}

.erp-main{
  padding:28px;
  min-width:0;
}

.erp-topbar{
  background:white;
  border-radius:20px;
  padding:22px 26px;
  display:flex;
  justify-content:space-between;
  align-items:center;
  box-shadow:0 10px 30px rgba(31,47,70,.08);
  margin-bottom:24px;
}

.erp-topbar h1{
  color:#1f2f46;
  font-size:28px;
}

.erp-topbar p{
  color:#7b8495;
  margin-top:6px;
}

.topbar-profile{
  background:#f4f6fb;
  padding:12px 18px;
  border-radius:999px;
  color:#1f2f46;
  font-weight:800;
}

.stats-grid{
  display:grid;
  grid-template-columns:repeat(auto-fit,minmax(210px,1fr));
  gap:18px;
  margin-bottom:24px;
}

.stat-card{
  background:white;
  border-radius:20px;
  padding:22px;
  box-shadow:0 10px 30px rgba(31,47,70,.08);
  border-left:5px solid #c9a227;
}

.stat-card p{
  color:#7b8495;
  font-weight:700;
}

.stat-card h3{
  color:#1f2f46;
  font-size:34px;
  margin-top:10px;
}

.erp-card{
  background:white;
  border-radius:22px;
  padding:26px;
  box-shadow:0 12px 34px rgba(31,47,70,.08);
  margin-bottom:22px;
}

.erp-card h2{
  color:#1f2f46;
  font-size:22px;
  margin-bottom:22px;
}

.form-grid{
  display:grid;
  grid-template-columns:repeat(auto-fit,minmax(230px,1fr));
  gap:16px;
  margin-bottom:18px;
}

.form-grid input,
.form-grid select{
  width:100%;
  min-height:52px;
  border:1px solid #d9deea;
  border-radius:12px;
  padding:0 14px;
  outline:none;
  color:#172033;
  background:#fff;
}

.primary-btn{
  border:0;
  border-radius:12px;
  padding:14px 22px;
  background:linear-gradient(135deg,#a87f17,#f3d77b,#c9a227);
  color:#111;
  font-weight:900;
  cursor:pointer;
  box-shadow:0 10px 30px rgba(201,162,39,.18);
}

.primary-btn:hover{
  background:#151515;
}

.menu-section{
  display:none;
}

.menu-section.active-section{
  display:block;
}

.user-row{
  background:#f8fafc !important;
  color:#172033 !important;
  border:1px solid #e2e8f0 !important;
  box-shadow:none !important;
  border-radius:16px !important;
}

.user-row::before{
  background:#f6c94c !important;
}

.user-info h3{
  color:#1f2f46 !important;
}

.user-info p{
  color:#596477 !important;
}

.user-info strong{
  color:#1f2f46 !important;
}

.muted{
  background:#f8fafc !important;
  color:#7b8495 !important;
  border:1px dashed #d9deea !important;
}

.section-subtitle{
  color:#1f2f46;
  margin:24px 0 16px;
}

.approve-btn,
.reject-btn,
.deactivate-btn,
.delete-btn{
  box-shadow:none !important;
}

@media(max-width:900px){
  .erp-layout{
    grid-template-columns:1fr;
  }

  .erp-sidebar{
    position:relative;
    height:auto;
  }

  .erp-main{
    padding:18px;
  }

  .erp-topbar{
    flex-direction:column;
    align-items:flex-start;
    gap:14px;
  }
}


/* ERP SIDEBAR DROPDOWN */

.menu-group{
  width:100%;
}

.menu-parent{
  width:100%;
  min-height:46px;
  border:0;
  border-radius:12px;
  padding:0 16px;
  background:transparent;
  color:rgba(255,255,255,.82);
  text-align:left;
  font-size:13px;
  font-weight:800;
  cursor:pointer;
  display:flex;
  align-items:center;
  justify-content:space-between;
  transition:.22s ease;
}

.menu-parent:hover{
  background:rgba(255,255,255,.08);
  color:white;
}

.menu-arrow{
  font-size:14px;
  transition:.25s ease;
}

.menu-group.open .menu-arrow{
  transform:rotate(90deg);
}

.submenu{
  display:none;
  padding:8px 0 10px 14px;
}

.menu-group.open .submenu{
  display:flex;
  flex-direction:column;
  gap:4px;
}

.submenu-btn{
  width:100%;
  min-height:38px;
  border:0;
  border-radius:10px;
  background:transparent;
  color:rgba(255,255,255,.62);
  text-align:left;
  padding:0 14px;
  font-size:12px;
  font-weight:700;
  cursor:pointer;
  transition:.2s ease;
}

.submenu-btn:hover{
  background:rgba(201,162,39,.10);
  color:var(--gold-light);
}

.submenu-btn.active{
  background:linear-gradient(
    135deg,
    rgba(168,127,23,.22),
    rgba(243,215,123,.16),
    rgba(201,162,39,.18)
  );

  color:var(--gold-light);

  border:1px solid rgba(201,162,39,.18);
}

/* DOCUMENT AREA */

.section-note{
  color:#7b8495;
  font-size:13px;
  margin-top:-10px;
  margin-bottom:18px;
}

/* DOCUMENT CARD REFINEMENT */

.doc-card{
  background:#fff;
  border:1px solid #edf0f5;
  border-radius:16px;
  padding:18px;
  margin-bottom:14px;
  display:flex;
  justify-content:space-between;
  align-items:center;
  gap:16px;
  transition:.2s ease;
  box-shadow:0 8px 24px rgba(0,0,0,.04);
}

.doc-card:hover{
  transform:translateY(-2px);
  box-shadow:0 14px 30px rgba(0,0,0,.08);
}

.doc-card h3{
  color:#0b1730;
  font-size:17px;
  margin-bottom:8px;
}

.doc-card p{
  color:#6b7280;
  font-size:12px;
  margin:4px 0;
}

.doc-card strong{
  color:#0b1730;
}

.view-doc-btn{
  border:0;
  border-radius:12px;
  padding:12px 16px;
  background:linear-gradient(135deg,#a87f17,#f3d77b,#c9a227);
  color:#111;
  font-size:12px;
  font-weight:900;
  cursor:pointer;
  transition:.2s ease;
  white-space:nowrap;
}

.view-doc-btn:hover{
  transform:translateY(-1px);
  box-shadow:0 12px 24px rgba(201,162,39,.25);
}

/* BETTER ERP LOOK */

.erp-sidebar{
  overflow-y:auto;
}

.erp-main{
  overflow-x:hidden;
}

.erp-card{
  transition:.2s ease;
}

.erp-card:hover{
  box-shadow:0 16px 36px rgba(0,0,0,.06);
}



.profile-area{
  position:relative;
}

.profile-dropdown{
  display:none;
  position:absolute;
  right:0;
  top:52px;
  width:320px;
  background:#fff;
  border:1px solid #e5e7eb;
  border-radius:18px;
  padding:18px;
  box-shadow:0 18px 50px rgba(0,0,0,.14);
  z-index:100;
}

.profile-dropdown.show-profile{
  display:block;
}

.profile-dropdown h3{
  margin-bottom:14px;
  color:#0b1730;
}

.profile-dropdown p{
  font-size:13px;
  margin:8px 0;
  color:#596477;
}

.profile-dropdown strong{
  color:#0b1730;
}

.profile-dropdown small{
  display:block;
  margin-top:14px;
  color:#7b8495;
}

.dashboard-home-grid{
  display:grid;
  grid-template-columns:repeat(auto-fit,minmax(320px,1fr));
  gap:18px;
}

.recent-doc-row{
  padding:14px;
  border-radius:14px;
  background:#f8fafc;
  border:1px solid #e5e7eb;
  margin-bottom:10px;
}

.recent-doc-row strong{
  color:#0b1730;
  font-size:14px;
}

.recent-doc-row p{
  color:#7b8495;
  font-size:12px;
  margin-top:5px;
}


/* SMALLER ERP FEEL */

.erp-topbar h1{
  font-size:18px;
}

.erp-topbar p{
  font-size:12px;
}

.stat-card{
  padding:18px;
}

.stat-card p{
  font-size:11px;
}

.stat-card h3{
  font-size:20px;
}

.erp-card h2{
  font-size:17px;
}

.doc-card h3{
  font-size:15px;
}

/* COLORFUL DASHBOARD */

.dashboard-home-grid{
  display:grid;
  grid-template-columns:repeat(auto-fit,minmax(280px,1fr));
  gap:18px;
}

.announcement-card{
  background:linear-gradient(135deg,#fff7e0,#ffffff);
  border-left:5px solid #f4b400;
}

.recent-card{
  background:linear-gradient(135deg,#eef7ff,#ffffff);
  border-left:5px solid #2196f3;
}

.access-card{
  background:linear-gradient(135deg,#eefcf3,#ffffff);
  border-left:5px solid #16a34a;
}

.docs-card{
  background:linear-gradient(135deg,#fff1f2,#ffffff);
  border-left:5px solid #e11d48;
}

.card-icon{
  width:54px;
  height:54px;
  border-radius:16px;
  display:flex;
  align-items:center;
  justify-content:center;
  font-size:26px;
  margin-bottom:16px;
  background:white;
  box-shadow:0 10px 24px rgba(0,0,0,.06);
}

.announcement-text{
  color:#596477;
  font-size:13px;
  line-height:1.6;
  margin-top:8px;
}

/* RECENT DOC */

.recent-doc-row{
  background:white;
  border-radius:12px;
  padding:12px;
  margin-top:10px;
  border:1px solid #e5e7eb;
}

.recent-doc-row strong{
  font-size:13px;
  color:#0b1730;
}

.recent-doc-row p{
  font-size:11px;
  color:#7b8495;
  margin-top:5px;
}


.announcement-textarea{
  width:100%;
  min-height:140px;
  border:1px solid #d9deea;
  border-radius:14px;
  padding:16px;
  resize:none;
  outline:none;
  font-size:13px;
}

.announcement-textarea:focus{
  border-color:#c9a227;
  box-shadow:0 0 0 3px rgba(201,162,39,.12);
}

.section-divider{
  border:none;
  border-top:1px solid #e5e7eb;
  margin:28px 0;
}

.announcement-row{
  display:flex;
  gap:16px;
  align-items:flex-start;
  padding:18px;
  border-radius:16px;
  background:#fff;
  border:1px solid #edf0f5;
  margin-bottom:14px;
  box-shadow:0 8px 24px rgba(0,0,0,.04);
}

.announcement-badge{
  min-width:90px;
  height:34px;
  border-radius:999px;
  display:flex;
  align-items:center;
  justify-content:center;
  font-size:11px;
  font-weight:900;
}

.announcement-badge.normal{
  background:#eef7ff;
  color:#2563eb;
}

.announcement-badge.important{
  background:#fff7e0;
  color:#d97706;
}

.announcement-badge.urgent{
  background:#fff1f2;
  color:#dc2626;
}

.announcement-content h3{
  font-size:15px;
  color:#072e81;
  margin-bottom:8px;
}

.announcement-content p{
  font-size:13px;
  color:#596477;
  line-height:1.7;
}

/* BUTTON FIX */

.primary-btn,
.upload-btn,
#uploadDocBtn,
#publishAnnouncementBtn{
  border:0 !important;
  outline:none !important;
  background:linear-gradient(
    135deg,
    #a87f17,
    #f3d77b,
    #c9a227
  ) !important;

  color:#111 !important;

  transition:.2s ease;
}

.primary-btn:hover,
.upload-btn:hover,
#uploadDocBtn:hover,
#publishAnnouncementBtn:hover{
  transform:translateY(-1px);

  box-shadow:0 12px 24px rgba(201,162,39,.25);
}

.primary-btn:focus,
.primary-btn:active,
.upload-btn:focus,
.upload-btn:active,
#uploadDocBtn:focus,
#uploadDocBtn:active,
#publishAnnouncementBtn:focus,
#publishAnnouncementBtn:active{

  background:linear-gradient(
    135deg,
    #a87f17,
    #f3d77b,
    #c9a227
  ) !important;

  color:#111 !important;

  outline:none !important;
}

.announcement-content{
  flex:1;
}

.announcement-content small{
  display:inline-block;
  margin-top:10px;
  padding:6px 10px;
  border-radius:999px;
  background:#f8fafc;
  color:#596477;
  font-size:11px;
  font-weight:800;
}

.announcement-row .delete-announcement-btn{
  align-self:flex-start;
  white-space:nowrap;
}


.user-announcement-row{
  display:flex;
  gap:12px;
  align-items:flex-start;
  padding:12px;
  border-radius:14px;
  background:white;
  border:1px solid #e5e7eb;
  margin-top:10px;
}

.user-announcement-row strong{
  color:#0b1730;
  font-size:13px;
}

.user-announcement-row p{
  color:#596477;
  font-size:12px;
  margin-top:5px;
  line-height:1.5;
}

/* DASHBOARD CARD HEIGHT FIX */

.dashboard-home-grid{
  align-items:start !important;
}

.dashboard-home-grid .erp-card{
  height:auto !important;
  min-height:0 !important;
  align-self:start !important;
}

.announcement-card,
.recent-card{
  max-height:360px;
  overflow:hidden;
}

.access-card,
.docs-card{
  min-height:190px !important;
  max-height:220px !important;
}

#userAnnouncements,
#recentDocuments{
  max-height:245px;
  overflow-y:auto;
  padding-right:4px;
  padding-bottom:12px;
  box-sizing:border-box;
}

.user-announcement-row:nth-child(n+4),
.recent-doc-row:nth-child(n+4){
  display:none;
}

#userAnnouncements::-webkit-scrollbar,
#recentDocuments::-webkit-scrollbar{
  width:5px;
}

#userAnnouncements::-webkit-scrollbar-thumb,
#recentDocuments::-webkit-scrollbar-thumb{
  background:#c9a227;
  border-radius:999px;
}

.recent-card,
.announcement-card{
  padding-bottom:20px !important;
}

.recent-card,
.announcement-card{
  max-height:390px !important;
  padding-bottom:28px !important;
}

#recentDocuments,
#userAnnouncements{
  max-height:270px !important;
  padding-bottom:22px !important;
}


/* FULL RESPONSIVE FIX */

@media(max-width:1200px){
  .erp-layout{
    grid-template-columns:230px 1fr;
  }

  .erp-main{
    padding:20px;
  }

  .stats-grid{
    grid-template-columns:repeat(2,1fr);
  }
}

@media(max-width:900px){
  .erp-layout{
    grid-template-columns:1fr;
  }

  .erp-sidebar{
    position:relative;
    width:100%;
    height:auto;
    min-height:auto;
    border-right:none;
    border-bottom:1px solid rgba(255,255,255,.08);
  }

  .erp-menu{
    flex-direction:row;
    overflow-x:auto;
    gap:8px;
    padding-bottom:8px;
  }

  .menu-btn,
  .menu-parent{
    min-width:150px;
    white-space:nowrap;
  }

  .submenu{
    position:absolute;
    background:#080808;
    z-index:50;
    border-radius:14px;
    padding:10px;
    margin-top:6px;
    box-shadow:0 18px 40px rgba(0,0,0,.35);
  }

  .erp-logout{
    margin-top:16px;
    width:100%;
  }

  .erp-topbar{
    flex-direction:column;
    align-items:flex-start;
    gap:14px;
  }

  .profile-area{
    width:100%;
  }

  .topbar-profile{
    width:100%;
    justify-content:center;
    text-align:center;
  }

  .profile-dropdown{
    right:auto;
    left:0;
    width:100%;
  }

  .stats-grid,
  .dashboard-home-grid,
  .form-grid,
  .upload-grid{
    grid-template-columns:1fr;
  }

  .user-row,
  .doc-card,
  .announcement-row{
    flex-direction:column;
    align-items:flex-start;
  }

  .user-actions{
    width:100%;
    justify-content:flex-start;
  }
}

@media(max-width:600px){
  body{
    overflow-x:hidden;
  }

  .erp-sidebar{
    padding:14px;
  }

  .erp-brand{
    padding-bottom:14px;
  }

  .brand-mark{
    width:40px;
    height:40px;
    font-size:18px;
  }

  .erp-brand h2{
    font-size:18px;
  }

  .erp-main{
    padding:14px;
  }

  .erp-topbar{
    padding:16px;
    border-radius:16px;
  }

  .erp-topbar h1{
    font-size:17px;
  }

  .erp-card,
  .stat-card{
    padding:16px;
    border-radius:16px;
  }

  .stat-card h3{
    font-size:18px;
    word-break:break-word;
  }

  .form-grid input,
  .form-grid select,
  .upload-grid input,
  .upload-grid select,
  .announcement-textarea{
    font-size:13px;
  }

  .primary-btn,
  .upload-btn,
  #uploadDocBtn,
  #publishAnnouncementBtn{
    width:100%;
  }

  .view-doc-btn{
    width:100%;
  }

  .login-box{
    width:92%;
    padding:28px 22px;
  }
}

/* VIEWER RESPONSIVE */

@media(max-width:768px){
  .viewer-header{
    height:auto;
    min-height:86px;
    flex-direction:column;
    align-items:flex-start;
    gap:12px;
  }

  .viewer-header button{
    width:100%;
  }

  .secure-viewer{
    height:calc(100vh - 130px);
    padding:12px;
  }

  #pdfCanvasContainer{
    max-width:100%;
  }

  .pdf-page-wrap{
    padding:8px;
    border-radius:12px;
  }

  #screenshotWatermark,
  #protectionOverlay{
    inset:130px 0 0 0;
  }
}

/* TABLET / MOBILE SCROLL SAFETY */

.erp-menu::-webkit-scrollbar{
  height:4px;
}

.erp-menu::-webkit-scrollbar-thumb{
  background:#c9a227;
  border-radius:999px;
}

html, body{
  max-width:100%;
  overflow-x:hidden;
}


.mandatory-overlay{
  display:none;
  position:fixed;
  inset:0;
  background:rgba(0,0,0,.72);
  z-index:9999;
  align-items:center;
  justify-content:center;
  padding:20px;
}

.mandatory-overlay.show{
  display:flex;
}

.mandatory-modal{
  width:100%;
  max-width:620px;
  background:#fff;
  border-radius:22px;
  padding:28px;
  box-shadow:0 30px 90px rgba(0,0,0,.35);
  border-top:6px solid #c9a227;
}

.mandatory-modal h2{
  color:#0b1730;
  margin-bottom:14px;
}

.mandatory-modal p{
  color:#596477;
  line-height:1.7;
  margin-bottom:18px;
}

.agree-btn:disabled{
  opacity:.45;
  cursor:not-allowed;
}

.mandatory-warning{
  margin-top:16px;
  font-size:12px;
  color:#dc2626 !important;
}

.log-controls{
  display:grid;
  grid-template-columns:220px 1fr;
  gap:14px;
  margin-bottom:20px;
}

.log-controls select,
.log-controls input{
  min-height:48px;
  border:1px solid #d9deea;
  border-radius:12px;
  padding:0 14px;
  outline:none;
  background:#fff;
  color:#0b1730;
}

.log-layout{
  display:grid;
  grid-template-columns:340px 1fr;
  gap:18px;
}

.log-user-list,
.log-detail-panel{
  background:#f8fafc;
  border:1px solid #e5e7eb;
  border-radius:18px;
  padding:16px;
  min-height:420px;
}

.log-user-list h3,
.log-detail-panel h3{
  color:#0b1730;
  font-size:16px;
  margin-bottom:14px;
}

.log-user-item{
  background:#fff;
  border:1px solid #e5e7eb;
  border-radius:14px;
  padding:14px;
  margin-bottom:10px;
  cursor:pointer;
  transition:.2s ease;
}

.log-user-item:hover,
.log-user-item.active{
  border-color:#c9a227;
  box-shadow:0 8px 20px rgba(201,162,39,.12);
}

.log-user-item strong{
  display:block;
  color:#0b1730;
  font-size:13px;
  margin-bottom:5px;
}

.log-user-item span{
  display:block;
  color:#7b8495;
  font-size:11px;
  margin-top:3px;
}

.log-entry{
  background:#fff;
  border:1px solid #e5e7eb;
  border-radius:14px;
  padding:14px;
  margin-bottom:10px;
}

.log-entry h4{
  color:#0b1730;
  font-size:14px;
  margin-bottom:8px;
}

.log-entry p{
  color:#596477;
  font-size:12px;
  margin:5px 0;
  line-height:1.5;
}

.log-entry strong{
  color:#0b1730;
}

.log-section-title{
  margin:18px 0 10px;
  color:#c9a227;
  font-size:14px;
  font-weight:900;
}

@media(max-width:900px){
  .log-controls{
    grid-template-columns:1fr;
  }

  .log-layout{
    grid-template-columns:1fr;
  }
}

/* PREMIUM MANDATORY NOTICE POPUP */

.mandatory-overlay{
  background:rgba(0,0,0,.78) !important;
  backdrop-filter:blur(8px);
}

.mandatory-modal{
  max-width:720px !important;
  padding:0 !important;
  overflow:hidden;
  border-radius:24px !important;
  background:#fff !important;
  border:none !important;
  box-shadow:0 35px 100px rgba(0,0,0,.45) !important;
}

.mandatory-modal::before{
  content:"OFFICIAL NOTICE";
  display:block;
  background:linear-gradient(135deg,#050505,#151515);
  color:#f3d77b;
  padding:18px 28px;
  font-size:13px;
  font-weight:900;
  letter-spacing:1.8px;
  border-bottom:4px solid #c9a227;
}

#mandatoryTitleText{
  color:#0b1730 !important;
  font-size:24px !important;
  font-weight:900 !important;
  padding:26px 30px 8px;
  margin:0 !important;
}

#mandatoryMessageText{
  margin:0 30px 22px !important;
  padding:18px !important;
  background:#f8fafc;
  border-left:5px solid #c9a227;
  border-radius:14px;
  color:#374151 !important;
  font-size:14px;
  line-height:1.8;
}

.mandatory-modal .primary-btn{
  margin-left:30px;
  margin-bottom:18px;
}

#agreeMandatoryBtn{
  margin-left:12px;
}

.mandatory-warning{
  margin:4px 30px 28px !important;
  padding:14px 16px;
  background:#fff1f2;
  border:1px solid #fecdd3;
  border-radius:14px;
  color:#b91c1c !important;
  font-size:12px !important;
  font-weight:700;
}

/* FIX: sidebar fixed, main content scroll inside own frame */

html,
body{
  height:100%;
  overflow:hidden !important;
}

.erp-layout{
  height:100vh !important;
  overflow:hidden !important;
}

.erp-sidebar{
  height:100vh !important;
  position:relative !important;
  overflow:hidden !important;
  display:flex !important;
  flex-direction:column !important;
}

.erp-menu{
  flex:1 !important;
  overflow-y:auto !important;
  min-height:0 !important;
}

.erp-logout{
  flex-shrink:0 !important;
}

.erp-main{
  height:100vh !important;
  overflow-y:auto !important;
  overflow-x:hidden !important;
}

/* SIDEBAR BRAND TEXT FIX */

.erp-brand h2{
  color:#ffffff !important;
}

.erp-brand p{
  color:rgba(255,255,255,.68) !important;
}

.erp-brand{
  border-bottom:1px solid rgba(255,255,255,.14) !important;
}

.brand-mark img{
  width:100%;
  height:100%;
  object-fit:contain;
  display:block;
}

.brand-mark{
  padding:6px;
}


.brand-mark{
  width:54px;
  height:54px;
  border-radius:16px;
  background:#000;
  display:flex;
  align-items:center;
  justify-content:center;
  overflow:hidden;
  border:1px solid rgba(255,255,255,.08);
}

.brand-mark img{
  width:100%;
  height:100%;
  object-fit:contain;
  display:block;
}

.log-clear-actions{
  display:flex;
  gap:10px;
  flex-wrap:wrap;
  margin-bottom:18px;
}

.log-clear-actions .delete-btn{
  padding:11px 14px;
}

.doc-filter-bar{
  display:grid;
  grid-template-columns:1fr 220px 220px;
  gap:14px;
  margin-bottom:18px;
}

.doc-filter-bar input,
.doc-filter-bar select{
  min-height:48px;
  border:1px solid #d9deea;
  border-radius:12px;
  padding:0 14px;
  outline:none;
  background:#fff;
  color:#0b1730;
}

.doc-filter-bar input:focus,
.doc-filter-bar select:focus{
  border-color:#c9a227;
  box-shadow:0 0 0 3px rgba(201,162,39,.12);
}

@media(max-width:900px){
  .doc-filter-bar{
    grid-template-columns:1fr;
  }
}


.mandatory-report-box{
  margin-top:24px;
}

.report-header-card{
  background:#fff;
  border:1px solid #e5e7eb;
  border-radius:18px;
  padding:18px;
  margin-bottom:18px;
  box-shadow:0 8px 24px rgba(0,0,0,.04);
}

.report-header-card h3{
  color:#0b1730;
  margin-bottom:16px;
}

.report-stats{
  display:grid;
  grid-template-columns:repeat(3,1fr);
  gap:12px;
}

.report-stats div{
  background:#f8fafc;
  border-radius:14px;
  padding:14px;
  text-align:center;
  border:1px solid #e5e7eb;
}

.report-stats span{
  display:block;
  font-size:24px;
  font-weight:900;
  color:#0b1730;
}

.report-stats p{
  color:#7b8495;
  font-size:12px;
  margin-top:5px;
}

.report-grid{
  display:grid;
  grid-template-columns:1fr 1fr;
  gap:18px;
}

.report-title{
  font-size:15px;
  margin-bottom:12px;
}

.report-title.success{
  color:#16a34a;
}

.report-title.danger{
  color:#dc2626;
}

.report-user-row{
  background:#fff;
  border:1px solid #e5e7eb;
  border-radius:14px;
  padding:13px;
  margin-bottom:10px;
  display:flex;
  flex-direction:column;
  gap:4px;
}

.report-user-row strong{
  color:#0b1730;
  font-size:13px;
}

.report-user-row span{
  color:#596477;
  font-size:11px;
}

.report-user-row.read{
  border-left:4px solid #16a34a;
}

.report-user-row.unread{
  border-left:4px solid #dc2626;
}

@media(max-width:900px){
  .report-grid,
  .report-stats{
    grid-template-columns:1fr;
  }
}

.profile-area{
  position:relative;
  display:flex;
  align-items:center;
  gap:12px;
}

.notification-btn{
  width:46px;
  height:46px;
  border-radius:999px;
  border:1px solid #d9deea;
  background:#fff;
  color:#0b1730;
  font-size:18px;
  cursor:pointer;
  position:relative;
  display:flex;
  align-items:center;
  justify-content:center;
  box-shadow:0 8px 20px rgba(0,0,0,.04);
}

.notification-btn:hover{
  border-color:#c9a227;
  box-shadow:0 10px 24px rgba(201,162,39,.15);
}

.notification-badge{
  position:absolute;
  top:-5px;
  right:-5px;
  min-width:20px;
  height:20px;
  border-radius:999px;
  background:#dc2626;
  color:#fff;
  font-size:10px;
  font-weight:900;
  display:flex;
  align-items:center;
  justify-content:center;
  padding:0 6px;
  border:2px solid #fff;
}

.notification-badge.hidden{
  display:none;
}


.notification-wrapper{
  position:relative;
}

.notification-panel{
  position:absolute;
  top:58px;
  right:0;
  width:360px;
  max-height:500px;
  overflow-y:auto;
  background:#fff;
  border:1px solid #e5e7eb;
  border-radius:20px;
  box-shadow:0 25px 70px rgba(0,0,0,.14);
  padding:0;
  z-index:999;
  display:none;
}

.notification-panel.show{
  display:block;
}

.notification-panel-header{
  padding:18px;
  border-bottom:1px solid #edf1f7;
  position:sticky;
  top:0;
  background:#fff;
}

.notification-panel-header h3{
  color:#0b1730;
  font-size:16px;
}

.notification-item{
  padding:16px 18px;
  border-bottom:1px solid #f1f5f9;
  cursor:pointer;
  transition:.2s ease;
}

.notification-item:hover{
  background:#f8fafc;
}

.notification-item.unread{
  border-left:4px solid #dc2626;
  background:#fff8f8;
}

.notification-item strong{
  display:block;
  color:#0b1730;
  font-size:13px;
  margin-bottom:6px;
}

.notification-item p{
  color:#667085;
  font-size:12px;
  line-height:1.6;
}

.notification-time{
  margin-top:8px;
  font-size:11px;
  color:#94a3b8;
}

/* =====================================================
   FINAL RESPONSIVE + CSS POLISH LAYER
===================================================== */

*{
  box-sizing:border-box;
}

html,
body{
  width:100%;
  max-width:100%;
  overflow-x:hidden;
}

/* Desktop frame */
.erp-layout{
  width:100%;
  min-height:100vh;
}

.erp-main{
  min-width:0;
}

/* Fix cards/content overflow */
.erp-card,
.stat-card,
.doc-card,
.user-row,
.announcement-row,
.log-entry,
.report-user-row{
  max-width:100%;
  overflow-wrap:anywhere;
}

/* Better topbar alignment */
.erp-topbar{
  gap:16px;
}

.profile-area{
  flex-shrink:0;
}

/* Notification panel responsive */
.notification-panel{
  right:0;
  max-width:calc(100vw - 32px);
}

/* Forms responsive safety */
input,
select,
textarea,
button{
  max-width:100%;
}

/* Logs panels should not overflow */
.log-layout{
  min-width:0;
}

.log-user-list,
.log-detail-panel{
  min-width:0;
  overflow:auto;
}

/* Document filter responsive */
.doc-filter-bar{
  align-items:center;
}

/* =====================================================
   TABLET
===================================================== */

@media(max-width:1024px){

  .erp-layout{
    grid-template-columns:220px 1fr;
  }

  .erp-sidebar{
    padding:18px 12px;
  }

  .erp-main{
    padding:18px;
  }

  .stats-grid{
    grid-template-columns:repeat(2,1fr);
  }

  .dashboard-home-grid{
    grid-template-columns:1fr 1fr;
  }

  .doc-filter-bar,
  .log-controls{
    grid-template-columns:1fr 1fr;
  }

  .log-layout{
    grid-template-columns:300px 1fr;
  }

}

/* =====================================================
   MOBILE / SMALL TABLET
===================================================== */

@media(max-width:820px){

  html,
  body{
    height:auto;
    overflow-y:auto !important;
  }

  .erp-layout{
    display:block !important;
    height:auto !important;
    overflow:visible !important;
  }

  .erp-sidebar{
    width:100% !important;
    height:auto !important;
    position:relative !important;
    padding:14px !important;
    overflow:visible !important;
  }

  .erp-brand{
    margin-bottom:12px;
  }

  .erp-menu{
    display:flex;
    flex-direction:row;
    gap:8px;
    overflow-x:auto;
    overflow-y:hidden;
    padding-bottom:8px;
  }

  .erp-menu .menu-btn,
  .menu-parent{
    min-width:max-content;
    height:42px;
    white-space:nowrap;
  }

  .menu-group{
    position:relative;
    flex-shrink:0;
  }

  .submenu{
    position:absolute;
    top:46px;
    left:0;
    min-width:190px;
    background:#080808;
    border:1px solid rgba(255,255,255,.08);
    border-radius:14px;
    padding:10px;
    z-index:999;
    box-shadow:0 20px 50px rgba(0,0,0,.35);
  }

  .erp-logout{
    margin-top:10px !important;
    width:100%;
  }

  .erp-main{
    height:auto !important;
    overflow:visible !important;
    padding:14px !important;
  }

  .erp-topbar{
    flex-direction:column;
    align-items:stretch;
    padding:16px;
  }

  .profile-area{
    width:100%;
    justify-content:flex-end;
  }

  .profile-dropdown,
  .notification-panel{
    right:0;
    left:auto;
    width:100%;
    max-width:100%;
  }

  .stats-grid,
  .dashboard-home-grid,
  .doc-filter-bar,
  .form-grid,
  .upload-grid,
  .log-controls,
  .log-layout,
  .report-grid,
  .report-stats{
    grid-template-columns:1fr !important;
  }

  .doc-card,
  .user-row,
  .announcement-row{
    flex-direction:column;
    align-items:flex-start;
  }

  .user-actions{
    width:100%;
    justify-content:flex-start;
  }

  .primary-btn,
  .upload-btn,
  #uploadDocBtn,
  #publishAnnouncementBtn,
  .view-doc-btn{
    width:100%;
  }

  .mandatory-modal{
    max-width:94vw !important;
  }

}

/* =====================================================
   SMALL MOBILE
===================================================== */

@media(max-width:520px){

  .brand-mark{
    width:42px !important;
    height:42px !important;
  }

  .erp-brand h2{
    font-size:16px !important;
  }

  .erp-brand p{
    font-size:11px !important;
  }

  .erp-topbar h1{
    font-size:16px !important;
  }

  .erp-topbar p{
    font-size:11px !important;
  }

  .stat-card h3{
    font-size:17px !important;
  }

  .erp-card{
    padding:14px !important;
    border-radius:16px !important;
  }

  .card-icon{
    width:44px;
    height:44px;
    font-size:21px;
  }

  .notification-btn{
    width:42px;
    height:42px;
  }

  .topbar-profile{
    padding:11px 14px;
    font-size:12px;
  }

  .notification-panel,
  .profile-dropdown{
    position:fixed;
    top:82px;
    left:12px;
    right:12px;
    width:auto;
    max-height:70vh;
  }

  .mandatory-modal{
    border-radius:18px !important;
  }

  #mandatoryTitleText{
    font-size:18px !important;
  }

  #mandatoryMessageText{
    font-size:13px !important;
  }

  .mandatory-modal .primary-btn{
    margin-left:0 !important;
    width:100%;
    margin-bottom:10px;
  }

  #agreeMandatoryBtn{
    margin-left:0 !important;
  }

  .viewer-header{
    height:auto !important;
    flex-direction:column;
    align-items:flex-start;
    gap:10px;
  }

  .viewer-header button{
    width:100%;
  }

  .secure-viewer{
    height:auto !important;
    min-height:calc(100vh - 130px);
    padding:10px !important;
  }

}

/* PREMIUM FILE INPUT */

input[type="file"]{
  width:100%;
  padding:14px;
  border:1px solid #d9deea;
  border-radius:16px;
  background:#fff;
  font-size:13px;
  color:#667085;
  cursor:pointer;
}

input[type="file"]::file-selector-button{
  background:linear-gradient(135deg,#c9a227,#f3d46a);
  color:#000;
  border:none;
  padding:10px 16px;
  border-radius:12px;
  font-weight:700;
  cursor:pointer;
  margin-right:14px;
  transition:.2s ease;
}

input[type="file"]::file-selector-button:hover{
  transform:translateY(-1px);
  box-shadow:0 8px 18px rgba(201,162,39,.25);
}


/* CREATE USER MESSAGE FIX */

#createUserMessage{
  display:block;
  margin-top:18px;
  padding-top:6px;
  font-size:13px;
  line-height:1.6;
  clear:both;
  width:100%;
}

#createUserBtn{
  margin-bottom:10px;
}


/* FINAL MANDATORY POPUP RESPONSIVE FIX */

.mandatory-overlay{
  padding:18px !important;
  overflow-y:auto !important;
  align-items:flex-start !important;
}

.mandatory-modal{
  width:100% !important;
  max-width:720px !important;
  margin:40px auto !important;
}

.mandatory-modal .primary-btn{
  display:inline-flex !important;
  align-items:center;
  justify-content:center;
  min-height:48px;
  margin:0 10px 18px 30px !important;
}

#agreeMandatoryBtn{
  margin-left:0 !important;
}

@media(max-width:600px){

  .mandatory-overlay{
    padding:12px !important;
  }

  .mandatory-modal{
    max-width:100% !important;
    margin:18px auto !important;
    border-radius:18px !important;
  }

  .mandatory-modal::before{
    padding:14px 18px !important;
    font-size:11px !important;
  }

  #mandatoryTitleText{
    padding:20px 18px 8px !important;
    font-size:18px !important;
    line-height:1.35 !important;
  }

  #mandatoryMessageText{
    margin:0 18px 18px !important;
    padding:14px !important;
    font-size:13px !important;
    line-height:1.6 !important;
  }

  .mandatory-modal .primary-btn{
    width:calc(100% - 36px) !important;
    margin:0 18px 12px !important;
  }

  .mandatory-warning{
    margin:4px 18px 20px !important;
    font-size:11px !important;
    line-height:1.5 !important;
  }
}

.login-note{
  margin-top:18px;
  padding:12px 14px;
  border:1px solid rgba(201,162,39,.18);
  background:rgba(201,162,39,.06);
  border-radius:14px;
  color:#d7d7d7;
  font-size:12px;
  line-height:1.6;
  text-align:center;
}

.login-logo-box{
  width:76px;
  height:76px;
  margin:0 auto 18px;
  background:#050505;
  border:1px solid rgba(201,162,39,.35);
  border-radius:22px;
  padding:10px;
  display:flex;
  align-items:center;
  justify-content:center;
  box-shadow:0 18px 40px rgba(201,162,39,.18);
}

.login-logo-box img{
  width:100%;
  height:100%;
  object-fit:contain;
}

.login-box{
  border:1px solid rgba(201,162,39,.45) !important;
  box-shadow:0 30px 90px rgba(0,0,0,.65), inset 0 1px 0 rgba(255,255,255,.06);
  background:
    radial-gradient(circle at top, rgba(201,162,39,.14), transparent 35%),
    #0b0b0b !important;
}

.login-box h1{
  letter-spacing:2px;
}

.login-box::before{
  content:"AUTHORIZED ACCESS ONLY";
  position:absolute;
  top:-11px;
  left:50%;
  transform:translateX(-50%);
  background:#0b0b0b;
  padding:0 14px;
  color:rgba(243,215,123,.78);
  font-size:10px;
  font-weight:900;
  letter-spacing:2px;
  z-index:5;
}

.security-warning-active .secure-viewer::before{
  content:"SECURITY WARNING: Screenshot / download / copy attempt detected";
  position:fixed;
  top:96px;
  left:50%;
  transform:translateX(-50%);
  background:#7f1d1d;
  color:white;
  padding:14px 22px;
  border-radius:999px;
  font-size:12px;
  font-weight:900;
  letter-spacing:.5px;
  z-index:9999;
  box-shadow:0 16px 40px rgba(127,29,29,.35);
}

.security-warning-active .pdf-page-canvas{
  filter:blur(8px);
}


.security-layout{
  display:grid;
  grid-template-columns:340px 1fr;
  gap:18px;
  margin-top:18px;
}

.security-users-panel,
.security-detail-panel{
  background:#f8fafc;
  border:1px solid #e5e7eb;
  border-radius:18px;
  padding:16px;
  min-height:420px;
}

.security-users-panel h3,
.security-detail-panel h3{
  color:#0b1730;
  font-size:16px;
  margin-bottom:14px;
}

.security-user-item{
  background:#fff5f5;
  border:1px solid #fecaca;
  border-left:5px solid #dc2626;
  border-radius:14px;
  padding:14px;
  margin-bottom:10px;
  cursor:pointer;
  display:flex;
  justify-content:space-between;
  gap:12px;
  transition:.2s ease;
}

.security-user-item:hover,
.security-user-item.active{
  box-shadow:0 10px 26px rgba(220,38,38,.16);
  transform:translateY(-1px);
}

.security-user-item strong{
  display:block;
  color:#991b1b;
  font-size:14px;
  margin-bottom:5px;
}

.security-user-item span{
  display:block;
  color:#6b7280;
  font-size:11px;
  margin-top:3px;
}

.security-user-item b{
  min-width:28px;
  height:28px;
  border-radius:999px;
  background:#dc2626;
  color:#fff;
  display:flex;
  align-items:center;
  justify-content:center;
  font-size:12px;
}

@media(max-width:900px){
  .security-layout{
    grid-template-columns:1fr;
  }
}


/* SPLASH SCREEN */

.app-splash{
  position:fixed;
  inset:0;
  background:
    radial-gradient(circle at top, rgba(201,162,39,.18), transparent 35%),
    #050505;
  z-index:99999;
  display:flex;
  align-items:center;
  justify-content:center;
  transition:.5s ease;
}

.app-splash.hide{
  opacity:0;
  visibility:hidden;
  pointer-events:none;
}

.splash-card{
  text-align:center;
  color:white;
  animation:splashFade .7s ease;
}

.splash-card img{
  width:96px;
  height:96px;
  object-fit:contain;
  background:#000;
  border-radius:26px;
  padding:12px;
  border:1px solid rgba(201,162,39,.4);
  box-shadow:0 20px 50px rgba(201,162,39,.18);
}

.splash-card h1{
  margin-top:18px;
  font-size:22px;
  letter-spacing:2px;
  color:#f3d77b;
}

.splash-card p{
  margin-top:8px;
  color:rgba(255,255,255,.72);
  font-size:13px;
}

.splash-loader{
  width:120px;
  height:4px;
  background:rgba(255,255,255,.12);
  border-radius:999px;
  overflow:hidden;
  margin:24px auto 0;
}

.splash-loader::before{
  content:"";
  display:block;
  width:45%;
  height:100%;
  background:linear-gradient(90deg,#c9a227,#f3d77b);
  border-radius:999px;
  animation:loaderMove 1s infinite ease-in-out;
}

@keyframes loaderMove{
  0%{transform:translateX(-100%)}
  100%{transform:translateX(260%)}
}

@keyframes splashFade{
  from{opacity:0; transform:translateY(14px)}
  to{opacity:1; transform:translateY(0)}
}

/* INSTALL APP PROMPT */

.install-prompt-box{
  position:fixed;
  right:24px;
  bottom:24px;
  width:360px;
  background:#fff;
  border-radius:22px;
  padding:20px;
  border:1px solid rgba(201,162,39,.35);
  box-shadow:0 24px 70px rgba(0,0,0,.22);
  z-index:9999;
  display:none;
}

.install-prompt-box.show{
  display:block;
  animation:splashFade .35s ease;
}

.install-prompt-box h3{
  color:#0b1730;
  font-size:17px;
  margin-bottom:8px;
}

.install-prompt-box p{
  color:#596477;
  font-size:13px;
  line-height:1.6;
}

.install-actions{
  display:flex;
  gap:10px;
  margin-top:16px;
}

#installAppBtn{
  flex:1;
  border:none;
  border-radius:12px;
  padding:12px;
  background:linear-gradient(135deg,#c9a227,#f3d77b);
  color:#111;
  font-weight:900;
  cursor:pointer;
}

#dismissInstallBtn{
  flex:1;
  border:1px solid #e5e7eb;
  border-radius:12px;
  padding:12px;
  background:#fff;
  color:#596477;
  font-weight:800;
  cursor:pointer;
}

@media(max-width:520px){
  .install-prompt-box{
    left:14px;
    right:14px;
    bottom:14px;
    width:auto;
  }

  .install-actions{
    flex-direction:column;
  }
}