/* ============================================================
   NEMSU Procurement System — Complete Stylesheet
   Blue & White Palette + Neumorphism Login
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Nunito:wght@400;600;700;800&family=Poppins:wght@500;600;700&display=swap');

:root {
  --navy:    #003366;
  --blue:    #0077cc;
  --accent:  #00c3ff;
  --light:   #dde6f0;
  --white:   #ffffff;
  --text:    #2c3e50;
  --muted:   #607080;
  --success: #27ae60;
  --warning: #e67e22;
  --danger:  #e74c3c;
  --neu-bg:  #e0eaf4;
  --neu-s1:  #b8c6d4;
  --neu-s2:  #ffffff;
}

*, *::before, *::after { margin:0; padding:0; box-sizing:border-box; }
body { font-family:'Nunito',sans-serif; color:var(--text); background:#f0f4f8; }
a    { text-decoration:none; color:inherit; }

/* ═══════════════════════════════════════════════
   MODAL OVERLAY
═══════════════════════════════════════════════ */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,20,60,0.6);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 5000;
  display: none;
  align-items: center;
  justify-content: center;
}
.modal-overlay.show {
  display: flex;
}

/* ── Modal Card (default = User mode, full width) ── */
.modal-card {
  background: var(--neu-bg);
  border-radius: 28px;
  box-shadow: 14px 14px 30px var(--neu-s1), -14px -14px 30px var(--neu-s2);
  width: min(860px, 95vw);
  /* Height: fit content but never taller than 92vh */
  max-height: 92vh;
  height: auto;
  overflow: hidden;           /* clip children — each panel scrolls itself */
  position: relative;
  display: flex;
  align-items: stretch;       /* both panels same height */
  animation: popIn .4s cubic-bezier(.22,.68,.36,1.2) both;
  transition: width .3s ease;
}

/* ── Admin mode: shrink to compact centered card ── */
.modal-card.admin-mode {
  width: min(420px, 92vw);
}

@keyframes popIn {
  from { transform:scale(.85); opacity:0; }
  to   { transform:scale(1);   opacity:1; }
}

/* Close Button */
.modal-close-btn {
  position: absolute;
  top: 14px; right: 18px;
  background: none; border: none;
  font-size: 1.6rem; color: var(--muted);
  cursor: pointer; z-index: 10;
  line-height: 1; transition: color .2s;
}
.modal-close-btn:hover { color: var(--danger); }

/* ── Login Panel ── */
.login-panel {
  flex: 1;
  min-width: 0;
  min-height: 0;            /* allow flex shrink */
  overflow-y: auto;         /* scroll if content too tall */
  padding: 48px 40px;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

/* When admin mode, give login panel more breathing room */
.modal-card.admin-mode .login-panel {
  padding: 50px 42px;
}

.login-panel .panel-title {
  font-family: 'Poppins', sans-serif;
  font-size: 1.6rem; font-weight: 700;
  color: var(--navy); text-align: center;
}
.login-panel .panel-sub {
  text-align: center; font-size: .88rem;
  color: var(--muted); margin-top: -10px;
}

/* Role Toggle */
.role-toggle {
  display: flex;
  background: var(--neu-bg);
  border-radius: 50px;
  box-shadow: inset 4px 4px 10px var(--neu-s1), inset -4px -4px 10px var(--neu-s2);
  padding: 5px;
  align-self: center;
  gap: 0;
}
.role-btn {
  padding: 9px 28px; border: none; background: transparent;
  border-radius: 50px; font-family: 'Nunito', sans-serif;
  font-weight: 700; font-size: .9rem; cursor: pointer;
  color: var(--muted); transition: all .3s ease;
}
.role-btn.active {
  background: linear-gradient(135deg, var(--blue), var(--navy));
  color: #fff;
  box-shadow: 3px 3px 8px var(--neu-s1), -2px -2px 6px var(--neu-s2);
}

/* Neumorphism Input */
.neu-input {
  width: 100%; padding: 14px 18px;
  background: var(--neu-bg); border: none;
  border-radius: 12px;
  box-shadow: inset 5px 5px 12px var(--neu-s1), inset -5px -5px 12px var(--neu-s2);
  font-size: .95rem; font-family: 'Nunito', sans-serif;
  color: var(--text); outline: none; transition: box-shadow .25s;
}
.neu-input:focus {
  box-shadow: inset 5px 5px 12px var(--neu-s1), inset -5px -5px 12px var(--neu-s2),
              0 0 0 2px var(--accent);
}
.neu-input::placeholder { color: #9aaabb; }

/* Neumorphism Button */
.neu-btn {
  width: 100%; padding: 14px;
  background: linear-gradient(145deg, #0088e8, #004fa8);
  border: none; border-radius: 12px;
  box-shadow: 5px 5px 12px var(--neu-s1), -3px -3px 8px var(--neu-s2);
  color: #fff; font-family: 'Nunito', sans-serif;
  font-size: 1rem; font-weight: 800; letter-spacing: .5px;
  cursor: pointer; transition: all .25s;
}
.neu-btn:hover  { filter: brightness(1.1); transform: translateY(-1px); }
.neu-btn:active { box-shadow: inset 3px 3px 8px rgba(0,0,0,.25); transform: scale(.98); }

/* Signup link under login form */
.switch-link {
  text-align: center; font-size: .88rem; color: var(--muted);
}
.switch-link a { color: var(--blue); font-weight: 700; cursor: pointer; }
.switch-link a:hover { text-decoration: underline; }

/* Divider */
.modal-divider {
  width: 1px; background: rgba(0,0,0,.1);
  margin: 24px 0; flex-shrink: 0;
}

/* ── Signup Panel ── */
.signup-panel {
  flex: 1;
  min-width: 0;
  min-height: 0;            /* critical: allows flex child to shrink */
  overflow-y: auto;         /* scrolls internally — link always stays inside */
  background: linear-gradient(145deg, #002855, #004fa8);
  border-radius: 0 28px 28px 0;
  padding: 36px 36px 30px;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  gap: 11px;
}
.signup-panel .panel-title {
  font-family: 'Poppins', sans-serif;
  font-size: 1.5rem; font-weight: 700;
  color: #fff; text-align: center;
}
.signup-panel .panel-sub {
  text-align: center; font-size: .85rem;
  color: rgba(255,255,255,.7); margin-top: -8px;
}

/* Glass Input (inside blue signup panel) */
.glass-input {
  width: 100%; padding: 12px 15px;
  background: rgba(255,255,255,.15);
  border: 1.5px solid rgba(255,255,255,.35);
  border-radius: 12px; font-size: .92rem;
  font-family: 'Nunito', sans-serif; color: #fff;
  outline: none; transition: border-color .25s, background .25s;
}
.glass-input::placeholder { color: rgba(255,255,255,.55); }
.glass-input:focus {
  border-color: var(--accent);
  background: rgba(255,255,255,.2);
}
.glass-input option { color: var(--text); background: #fff; }

/* Glass Button */
.glass-btn {
  width: 100%; padding: 13px;
  background: rgba(255,255,255,.95);
  border: none; border-radius: 12px;
  color: var(--navy); font-family: 'Nunito', sans-serif;
  font-size: 1rem; font-weight: 800; cursor: pointer;
  transition: all .25s; margin-top: 2px;
  box-shadow: 0 4px 16px rgba(0,0,0,.2);
}
.glass-btn:hover { background: var(--accent); color: #fff; }

/* ── FIXED: "Already have an account?" link — now clearly visible ── */
.signup-bottom-link {
  text-align: center;
  font-size: .88rem;
  color: rgba(255,255,255,.85);   /* brighter white */
  margin-top: 4px;
  font-weight: 500;
}
.signup-bottom-link a {
  color: #00e5ff;                  /* bright cyan — visible on dark blue */
  font-weight: 800;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 3px;
}
.signup-bottom-link a:hover {
  color: #fff;
}

/* Flash Messages */
.flash-wrap {
  position: absolute; top: 14px; left: 50%; transform: translateX(-50%);
  width: 88%; z-index: 20; display: flex; flex-direction: column; gap: 6px;
}
.flash-msg {
  padding: 10px 16px; border-radius: 10px;
  font-size: .88rem; font-weight: 700; text-align: center;
}
.flash-msg.success { background: #d1e7dd; color: #0a3622; }
.flash-msg.error   { background: #f8d7da; color: #58151c; }

/* ── Mobile ── */
@media (max-width: 640px) {
  .modal-card, .modal-card.admin-mode { width: 95vw; flex-direction: column; }
  .modal-divider  { width: 100%; height: 1px; margin: 0; }
  .signup-panel   { border-radius: 0 0 28px 28px; }
  .login-panel, .signup-panel { padding: 30px 22px; }
}

/* ═══════════════════════════════════════════════
   DASHBOARD LAYOUT
═══════════════════════════════════════════════ */
.app-layout { display:flex; min-height:100vh; }

/* Sidebar */
.sidebar {
  width: 255px; flex-shrink: 0;
  background: linear-gradient(180deg, #001e4d 0%, #003880 100%);
  display: flex; flex-direction: column;
  position: sticky; top: 0; height: 100vh; overflow-y: auto;
}
.sidebar-brand {
  display: flex; align-items: center; gap: 12px;
  padding: 22px 20px;
  border-bottom: 1px solid rgba(255,255,255,.1);
}
.sidebar-brand img {
  width: 44px; height: 44px; border-radius: 50%;
  object-fit: cover; background: #fff;
}
.sidebar-brand span {
  color: #fff; font-family: 'Poppins', sans-serif;
  font-size: .85rem; font-weight: 700; line-height: 1.3;
}
.sidebar-nav {
  flex: 1; padding: 20px 12px;
  display: flex; flex-direction: column; gap: 4px;
}
.nav-item {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 16px; border-radius: 12px;
  color: rgba(255,255,255,.7); font-weight: 600;
  font-size: .92rem; transition: all .25s; cursor: pointer;
}
.nav-item:hover, .nav-item.active {
  background: rgba(255,255,255,.12); color: #fff;
}
.nav-item.active { background: rgba(0,195,255,.2); color: var(--accent); }
.nav-icon { font-size: 1.1rem; width: 22px; text-align: center; }
.sidebar-footer {
  padding: 16px 20px;
  border-top: 1px solid rgba(255,255,255,.1);
}
.sidebar-user { color: rgba(255,255,255,.75); font-size: .85rem; }
.sidebar-user strong { display: block; color: #fff; font-size: .95rem; }

/* Main */
.main-content { flex: 1; padding: 30px; background: #f0f4f8; overflow-x: hidden; }

/* Topbar */
.topbar {
  display: flex; align-items: center;
  justify-content: space-between; margin-bottom: 26px;
}
.page-title {
  font-family: 'Poppins', sans-serif;
  font-size: 1.55rem; font-weight: 700; color: var(--navy);
}
.page-sub { color: var(--muted); font-size: .88rem; margin-top: 2px; }

/* Logout */
.btn-logout {
  padding: 9px 20px; background: #fff;
  border: 2px solid var(--danger); border-radius: 10px;
  color: var(--danger); font-weight: 700; font-size: .88rem;
  cursor: pointer; transition: all .2s;
}
.btn-logout:hover { background: var(--danger); color: #fff; }

/* Stats */
.stats-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 16px; margin-bottom: 26px;
}
.stat-card {
  background: #fff; border-radius: 18px;
  padding: 20px; box-shadow: 0 4px 18px rgba(0,51,102,.07);
  position: relative; overflow: hidden;
}
.stat-card::before {
  content:''; position:absolute; top:0; left:0; right:0; height:4px;
}
.stat-blue::before    { background: var(--blue); }
.stat-warning::before { background: var(--warning); }
.stat-success::before { background: var(--success); }
.stat-danger::before  { background: var(--danger); }
.stat-accent::before  { background: var(--accent); }

.stat-icon  { font-size: 1.8rem; margin-bottom: 6px; }
.stat-value {
  font-family: 'Poppins', sans-serif;
  font-size: 2rem; font-weight: 800; color: var(--navy); line-height: 1;
}
.stat-label {
  font-size: .78rem; color: var(--muted);
  font-weight: 700; text-transform: uppercase; letter-spacing: .5px;
  margin-top: 4px;
}

/* Card */
.card {
  background: #fff; border-radius: 18px;
  padding: 24px; box-shadow: 0 4px 18px rgba(0,51,102,.07);
  margin-bottom: 22px;
}
.card-title {
  font-family: 'Poppins', sans-serif;
  font-size: 1.05rem; font-weight: 700; color: var(--navy);
  margin-bottom: 18px; display: flex; align-items: center;
  justify-content: space-between; gap: 8px;
}

/* Table */
.data-table { width:100%; border-collapse:collapse; font-size:.9rem; }
.data-table thead th {
  background: #f0f4f8; color: var(--navy);
  font-weight: 700; text-align: left;
  padding: 11px 13px; font-size: .8rem;
  text-transform: uppercase; letter-spacing: .5px;
  border-bottom: 2px solid #e0e8f0;
}
.data-table tbody td {
  padding: 13px 13px; border-bottom: 1px solid #f0f4f8;
  vertical-align: middle;
}
.data-table tbody tr:hover { background: #fafcff; }
.data-table tbody tr:last-child td { border-bottom: none; }

/* Badges */
.badge {
  display: inline-block; padding: 4px 12px;
  border-radius: 50px; font-size: .78rem; font-weight: 700;
}
.badge-pending  { background: #fff3cd; color: #856404; }
.badge-approved { background: #d1e7dd; color: #0a3622; }
.badge-rejected { background: #f8d7da; color: #58151c; }
.badge-cat {
  background: #e8f4ff; color: #0055a5;
  font-size: .78rem; padding: 3px 10px;
  border-radius: 20px; font-weight: 600;
}

/* Buttons */
.btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 9px 18px; border-radius: 10px; border: none;
  font-family: 'Nunito', sans-serif; font-weight: 700;
  font-size: .88rem; cursor: pointer; transition: all .2s;
}
.btn-primary { background: var(--blue); color: #fff; }
.btn-primary:hover { background: var(--navy); }
.btn-success { background: var(--success); color: #fff; }
.btn-danger  { background: var(--danger);  color: #fff; }
.btn-outline { background: transparent; border: 2px solid var(--blue); color: var(--blue); }
.btn-outline:hover { background: var(--blue); color: #fff; }
.btn-dark { background: #1a1a2e; color: #fff; }
.btn-dark:hover { background: #000; }
.btn-sm { padding: 6px 13px; font-size: .82rem; }

/* Form */
.form-group { margin-bottom: 16px; }
.form-label { display:block; margin-bottom:6px; font-weight:700; font-size:.88rem; color:var(--navy); }
.form-control {
  width:100%; padding:11px 14px;
  background:#f8fafb; border:2px solid #e0e8f0;
  border-radius:10px; font-family:'Nunito',sans-serif;
  font-size:.92rem; color:var(--text); outline:none;
  transition: border-color .2s, box-shadow .2s;
}
.form-control:focus { border-color:var(--blue); box-shadow:0 0 0 3px rgba(0,119,204,.12); }
.form-row   { display:grid; grid-template-columns:1fr 1fr; gap:16px; }
.form-row-3 { display:grid; grid-template-columns:1fr 1fr 1fr; gap:14px; }

/* Items Table */
.items-tbl { width:100%; border-collapse:collapse; font-size:.88rem; }
.items-tbl th {
  background: linear-gradient(135deg, var(--navy), var(--blue));
  color:#fff; padding:10px 10px; font-weight:700;
  text-align:left; font-size:.82rem;
}
.items-tbl th:first-child { border-radius:8px 0 0 0; }
.items-tbl th:last-child  { border-radius:0 8px 0 0; }
.items-tbl td { padding:7px 5px; border-bottom:1px solid #e8eef5; }
.items-tbl .form-control { padding:8px 10px; font-size:.85rem; }

/* Classification Box */
.class-box {
  background: linear-gradient(135deg,#e8f4ff,#d0e8ff);
  border:1px solid #b8d8f8; border-radius:12px;
  padding:14px 18px; margin-top:10px;
  display:flex; flex-direction:column; gap:4px;
}
.class-label { font-size:.78rem; color:var(--muted); font-weight:700; text-transform:uppercase; }
.class-value { font-size:1.05rem; font-weight:800; color:var(--navy); }
.class-method { font-size:.8rem; color:var(--blue); }

/* PR Detail */
.detail-grid { display:grid; grid-template-columns:1fr 1fr; gap:16px; margin-bottom:18px; }
.detail-label { font-size:.78rem; color:var(--muted); font-weight:700; text-transform:uppercase; }
.detail-value { font-size:.96rem; font-weight:600; color:var(--text); margin-top:3px; }

/* Filter */
.filter-select {
  padding:9px 14px; border:2px solid #e0e8f0;
  border-radius:10px; background:#fff;
  font-family:'Nunito',sans-serif; font-size:.9rem;
  color:var(--text); outline:none; cursor:pointer;
}
.filter-select:focus { border-color:var(--blue); }

/* Empty */
.empty-state { text-align:center; padding:48px 20px; color:var(--muted); }
.empty-icon  { font-size:3rem; margin-bottom:12px; }

/* Responsive */
@media(max-width:900px){
  .sidebar { width:210px; }
}
@media(max-width:680px){
  .app-layout { flex-direction:column; }
  .sidebar { width:100%; height:auto; position:relative; }
  .sidebar-nav { flex-direction:row; padding:12px; overflow-x:auto; }
  .nav-item span:not(.nav-icon) { display:none; }
  .main-content { padding:18px; }
  .form-row, .form-row-3 { grid-template-columns:1fr; }
  .detail-grid { grid-template-columns:1fr; }
}

/* ═══════════════════════════════════════════════
   NOTIFICATION BELL
═══════════════════════════════════════════════ */
.notif-wrapper {
  position: relative;
}
.notif-btn {
  position: relative;
  background: transparent;
  border: none;
  padding: 8px 10px;
  font-size: 1.3rem;
  cursor: pointer;
  transition: opacity .2s;
  display: flex; align-items: center;
}
.notif-btn:hover { opacity: .7; }

/* Only the bell icon span turns black — badge is unaffected */
.notif-btn .bell-icon {
  display: inline-block;
  filter: grayscale(1) brightness(0);
  font-size: 1.3rem;
  line-height: 1;
}
.notif-badge {
  position: absolute;
  top: 0px; right: 0px;
  background: var(--danger);
  color: #fff;
  font-size: .7rem;
  font-weight: 800;
  min-width: 19px; height: 19px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  border: 2px solid #f0f4f8;
  animation: pulse 1.8s infinite;
  z-index: 10;          /* always on top */
  pointer-events: none; /* don't block clicks */
}
@keyframes pulse {
  0%,100% { transform: scale(1); }
  50%      { transform: scale(1.15); }
}
.notif-dropdown {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  width: 320px;
  background: #fff;
  border-radius: 16px;
  box-shadow: 0 8px 32px rgba(0,51,102,.15);
  border: 1px solid #e0e8f0;
  z-index: 3000;
  display: none;
  flex-direction: column;
  overflow: hidden;
}
.notif-dropdown.open { display: flex; }
.notif-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 16px;
  background: linear-gradient(135deg, var(--navy), var(--blue));
  color: #fff;
  font-weight: 700; font-size: .92rem;
}
.notif-count-label {
  font-size: .78rem;
  background: rgba(255,255,255,.2);
  padding: 3px 10px; border-radius: 20px;
}
.notif-item {
  display: block;
  padding: 12px 16px;
  border-bottom: 1px solid #f0f4f8;
  text-decoration: none;
  transition: background .15s;
}
.notif-item:hover { background: #f8fbff; }
.notif-item-top {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 3px;
}
.notif-item-top strong { color: var(--navy); font-size: .9rem; }
.notif-time { font-size: .75rem; color: var(--muted); }
.notif-item-sub { font-size: .8rem; color: var(--muted); }
.notif-view-all {
  display: block; text-align: center;
  padding: 11px 16px;
  color: var(--blue); font-weight: 700; font-size: .88rem;
  text-decoration: none;
  border-top: 1px solid #e0e8f0;
  transition: background .15s;
}
.notif-view-all:hover { background: #f0f7ff; }
.notif-empty {
  padding: 20px 16px; text-align: center;
  color: var(--muted); font-size: .9rem;
}

/* ═══════════════════════════════════════════════
   SIDEBAR DROPDOWN MENUS
═══════════════════════════════════════════════ */
.nav-dropdown { width: 100%; }

.nav-dropdown-toggle {
  display: flex; align-items: center; gap: 12px;
  width: 100%; justify-content: flex-start;
  cursor: pointer; user-select: none;
}
.nav-arrow {
  margin-left: auto;
  font-size: 1rem;
  color: rgba(255,255,255,.5);
  transition: transform .25s ease;
  display: inline-block;
}
.nav-dropdown-menu {
  display: none;
  flex-direction: column;
  gap: 2px;
  padding-left: 14px;
  margin-top: 2px;
}
.nav-dropdown-menu.open { display: flex; }

.nav-sub-item {
  display: flex; align-items: center; justify-content: space-between;
  padding: 9px 14px 9px 28px;
  border-radius: 10px;
  color: rgba(255,255,255,.6);
  font-size: .86rem; font-weight: 600;
  text-decoration: none;
  transition: all .2s;
  border-left: 2px solid rgba(255,255,255,.1);
}
.nav-sub-item:hover {
  background: rgba(255,255,255,.1);
  color: #fff;
  border-left-color: var(--accent);
}
.nav-sub-item.active {
  background: rgba(0,195,255,.15);
  color: var(--accent);
  border-left-color: var(--accent);
}
.sub-badge {
  background: var(--danger);
  color: #fff; font-size: .7rem;
  font-weight: 800; min-width: 18px; height: 18px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  padding: 0 4px;
}

/* ═══════════════════════════════════════════════
   RFQ BUTTON
═══════════════════════════════════════════════ */
.btn-rfq {
  background: linear-gradient(135deg, #0055a5, #00c3ff);
  color: #fff;
  box-shadow: 0 4px 12px rgba(0,119,204,.3);
}
.btn-rfq:hover {
  background: linear-gradient(135deg, #003f80, #009fd6);
  box-shadow: 0 6px 16px rgba(0,119,204,.4);
  transform: translateY(-1px);
}

/* ── Action column: keep status + buttons on one line always ── */
.data-table td:last-child {
  white-space: nowrap;
}
.data-table .btn-sm {
  white-space: nowrap;
  flex-shrink: 0;
}
