/* =========================================================
   MELPOL Staff Panel - Unified Theme CSS (FULL)
   Replace: /public/css/theme.css
   ========================================================= */

/* ----------------------------
   Animations
---------------------------- */
@keyframes gradientShift {
  0%   { background-position: 0% 50%; }
  50%  { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

@keyframes logoPulse {
  0% {
    transform: translateY(0);
    filter: drop-shadow(0 0 10px rgba(255,255,255,0.25)) drop-shadow(0 0 22px rgba(0,0,0,0.4));
  }
  50% {
    transform: translateY(-2px);
    filter: drop-shadow(0 0 18px rgba(255,255,255,0.45)) drop-shadow(0 0 30px rgba(0,0,0,0.6));
  }
  100% {
    transform: translateY(0);
    filter: drop-shadow(0 0 10px rgba(255,255,255,0.25)) drop-shadow(0 0 22px rgba(0,0,0,0.4));
  }
}

/* ----------------------------
   Page / Base
---------------------------- */
* { box-sizing: border-box; }

html, body { height: 100%; }

body {
  margin: 0;
  color: #f1f5f9;
  background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
  position: relative;
  overflow-x: hidden;
  font-family: system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, "Apple Color Emoji", "Segoe UI Emoji";
}

main { position: relative; z-index: 1; }

a { color: inherit; }

.muted { color: #94a3b8; }

/* Background overlay image (your LVSO watermark) */
body::before {
  content: "";
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: min(700px, 70vw);
  height: min(700px, 70vw);
  background: url("/public/assets/img/LVSO.png") center/contain no-repeat;
  opacity: 0.18;
  pointer-events: none;
  z-index: 0;
}

/* ----------------------------
   NLR Gradient / Logo Helpers (kept)
---------------------------- */
.nlr-gradient-bg {
  background: linear-gradient(135deg, #0084ff, #0057d9, #7a1fd1, #b800ff);
  background-size: 300% 300%;
  animation: gradientShift 12s ease infinite;
}

.logo-glow {
  animation: logoPulse 4s ease-in-out infinite;
}

/* ----------------------------
   Header / Nav
---------------------------- */
header {
  position: sticky;
  top: 0;
  z-index: 50;
}

header a { transition: all 0.2s ease; }
header a:hover { color: #ffffff; }

/* ----------------------------
   Cards
---------------------------- */
.card,
.card-glass {
  transition: all 0.3s ease;
  border: 2px solid rgba(210, 180, 140, 0.35);
  background-color: rgba(0, 0, 0, 0.28);
  backdrop-filter: blur(4px);
  border-radius: 16px;
}

.card:hover,
.card-glass:hover {
  border-color: rgba(210, 180, 140, 0.65);
  background-color: rgba(0, 0, 0, 0.42);
  box-shadow: 0 8px 24px rgba(0,0,0,0.35);
}

.card-dark {
  background: rgba(30, 41, 82, 0.6);
  border: 1px solid rgba(59, 130, 246, 0.2);
  border-radius: 16px;
}

/* ----------------------------
   Buttons
---------------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 14px;
  border-radius: 12px;
  border: 1px solid rgba(148, 163, 184, 0.35);
  background: rgba(51, 65, 85, 0.35);
  color: #e2e8f0;
  font-weight: 600;
  transition: all .15s ease;
  cursor: pointer;
  text-decoration: none;
}

.btn:hover { background: rgba(51, 65, 85, 0.55); }

.btn-primary {
  background: rgba(37, 99, 235, 0.25);
  border-color: rgba(96, 165, 250, 0.45);
}
.btn-primary:hover { background: rgba(37, 99, 235, 0.35); }

.btn-secondary {
  background: rgba(59, 130, 246, 0.2);
  border: 1px solid rgba(59, 130, 246, 0.5);
  color: #93c5fd;
}
.btn-secondary:hover {
  background: rgba(59, 130, 246, 0.3);
  border-color: rgba(59, 130, 246, 0.8);
}

.btn-danger {
  background: rgba(239, 68, 68, 0.18);
  border-color: rgba(248, 113, 113, 0.5);
}
.btn-danger:hover { background: rgba(239, 68, 68, 0.25); }

.btn-ghost {
  background: transparent;
  border-color: rgba(148, 163, 184, 0.25);
}
.btn-ghost:hover { background: rgba(255,255,255,0.06); }

/* ----------------------------
   Badges / Status
---------------------------- */
.badge {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 10px;
  font-size: 12px;
  font-weight: 700;
  color: #D2B48C;
  border: 1px solid rgba(210, 180, 140, 0.45);
  background: rgba(210, 180, 140, 0.12);
}

.badge-pending {
  background: rgba(234, 179, 8, 0.2);
  color: #fcd34d;
  border: 1px solid rgba(234, 179, 8, 0.5);
}
.badge-approved,
.badge-accepted {
  background: rgba(34, 197, 94, 0.2);
  color: #86efac;
  border: 1px solid rgba(34, 197, 94, 0.5);
}
.badge-denied,
.badge-rejected {
  background: rgba(239, 68, 68, 0.2);
  color: #fca5a5;
  border: 1px solid rgba(239, 68, 68, 0.5);
}

/* Staff Colors (kept) */
.status-smt {
  background: rgba(236, 72, 153, 0.2);
  color: #f472b6;
}
.status-slt {
  background: rgba(168, 85, 247, 0.2);
  color: #d8b4fe;
}
.status-general {
  background: rgba(59, 130, 246, 0.2);
  color: #93c5fd;
}

/* ----------------------------
   Forms / Inputs
---------------------------- */
label {
  font-size: 12px;
  font-weight: 700;
  color: #D2B48C;
  text-transform: uppercase;
  letter-spacing: .06em;
}

input[type="text"],
input[type="email"],
input[type="number"],
input[type="password"],
textarea,
select {
  border-radius: 12px;
  border: 1px solid rgba(148, 163, 184, 0.35);
  padding: 10px 12px;
  background: rgba(2, 6, 23, 0.35);
  color: #e2e8f0;
  outline: none;
  transition: all 0.2s ease;
}

input:focus,
select:focus,
textarea:focus {
  border-color: rgba(96, 165, 250, 0.7);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.12);
}

textarea { min-height: 120px; resize: vertical; }

.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

/* ----------------------------
   Flash Messages
---------------------------- */
.flash {
  padding: 12px 14px;
  border-radius: 12px;
  margin: 12px 0;
  border: 1px solid rgba(148,163,184,0.35);
  background: rgba(15,23,42,0.4);
}

.flash.error {
  border-color: rgba(248,113,113,0.55);
  background: rgba(239,68,68,0.15);
}

.flash.success {
  border-color: rgba(74,222,128,0.55);
  background: rgba(34,197,94,0.12);
}

/* ----------------------------
   Modal
---------------------------- */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.55);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
  z-index: 60;
}

.modal {
  width: min(560px, 100%);
  border-radius: 16px;
  border: 2px solid rgba(210, 180, 140, 0.35);
  background: rgba(15, 23, 42, 0.92);
  backdrop-filter: blur(8px);
  padding: 18px;
}

/* ----------------------------
   Dashboard: 3-wide grid + cards
---------------------------- */
.officer-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

@media (max-width: 980px) {
  .officer-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 640px) {
  .officer-grid { grid-template-columns: 1fr; }
}

.officer-card {
  padding: 12px;
  border-radius: 14px;
  border: 1px solid rgba(255,255,255,0.10);
  background: rgba(8,12,20,0.55);
}

/* Department section spacing */
.department-section {
  padding: 12px 14px 16px;
}

/* Ensure grid has breathing room */
.department-section .officer-grid {
  margin-top: 12px;
}

/* Extra safety on very wide screens */
.department-section .officer-grid {
  padding-left: 2px;
  padding-right: 2px;
}


/* ----------------------------
   Kebab (⋯) button + portal menu
---------------------------- */
.kebab-btn {
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  border: 1px solid rgba(255,255,255,0.12);
  background: rgba(255,255,255,0.06);
  color: #fff;
  cursor: pointer;
  flex: 0 0 auto;
}

.kebab-btn:hover { background: rgba(255,255,255,0.10); }

.kebab-menu {
  position: absolute;
  z-index: 999999;
  width: 260px;
  padding: 10px;
  border-radius: 14px;
  background: rgba(10,15,25,0.97);
  border: 1px solid rgba(255,255,255,0.12);
  box-shadow: 0 18px 55px rgba(0,0,0,0.55);
  backdrop-filter: blur(6px);
}

.kebab-item-btn {
  width: 100%;
  text-align: left;
  padding: 10px 12px;
  border-radius: 12px;
  background: transparent;
  border: 0;
  color: #fff;
  cursor: pointer;
  font-weight: 600;
}

.kebab-item-btn:hover { background: rgba(255,255,255,0.08); }

.kebab-sep {
  height: 1px;
  margin: 10px 0;
  background: rgba(255,255,255,0.10);
}

.kebab-label {
  display: block;
  font-size: 12px;
  opacity: 0.8;
  margin: 0 0 6px;
}

.kebab-select {
  width: 100%;
  padding: 10px;
  border-radius: 12px;
  background: rgba(255,255,255,0.06);
  color: #fff;
  border: 1px solid rgba(255,255,255,0.12);
  outline: none;
}

/* ----------------------------
   Small text utilities (kept)
---------------------------- */
.text-blue-accent { color: #93c5fd; }
.text-blue-muted { color: rgba(148, 163, 184, 0.7); }

/* Custom dropdown (fixes native select white panel) */
.kebab-dd { position: relative; }

.kebab-dd-btn{
  width:100%;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:10px;
  padding:10px 12px;
  border-radius:12px;
  background: rgba(255,255,255,0.06);
  color:#fff;
  border:1px solid rgba(255,255,255,0.12);
  cursor:pointer;
}

.kebab-dd-btn:hover{ background: rgba(255,255,255,0.09); }

.kebab-dd-list{
  display:none;
  margin-top:8px;
  border-radius:12px;
  border:1px solid rgba(255,255,255,0.12);
  background: rgba(10,15,25,0.98);
  box-shadow: 0 18px 55px rgba(0,0,0,0.55);
  overflow:hidden;
  max-height: 220px;
  overflow-y: auto;
}

.kebab-dd-list.open{ display:block; }

.kebab-dd-item{
  width:100%;
  text-align:left;
  padding:10px 12px;
  background: transparent;
  border:0;
  color:#fff;
  cursor:pointer;
}

.kebab-dd-item:hover{ background: rgba(255,255,255,0.08); }

.kebab-dd-caret{ opacity:.8; }
/* Profile stat boxes */
.stats-grid{
  margin-top: 14px;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

@media (max-width: 900px){
  .stats-grid{ grid-template-columns: 1fr; }
}

.stat-card{
  padding: 14px;
  border-radius: 16px;
  border: 2px solid rgba(210, 180, 140, 0.35);
  background: rgba(0, 0, 0, 0.28);
  backdrop-filter: blur(4px);
}

.stat-label{
  font-size: 12px;
  font-weight: 800;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: #D2B48C;
  opacity: 0.95;
}

.stat-value{
  margin-top: 6px;
  font-size: 18px;
  font-weight: 900;
  color: #f1f5f9;
}


/* Employment history scroll box */
.history-scroll{
  margin-top: 10px;
  max-height: 900px;      /* adjust height as you like */
  overflow-y: auto;
  padding-right: 6px;     /* room for scrollbar */
}

.history-list{
  display: grid;
  gap: 10px;
}

/* Optional: nicer scrollbar (Chrome/Edge) */
.history-scroll::-webkit-scrollbar{
  width: 10px;
}
.history-scroll::-webkit-scrollbar-thumb{
  background: rgba(255,255,255,0.12);
  border-radius: 999px;
}
.history-scroll::-webkit-scrollbar-track{
  background: rgba(0,0,0,0.15);
  border-radius: 999px;
}

/* Training scroll boxes */
.training-scroll{
  margin-top: 10px;
  max-height: 900px;     /* match employment history */
  overflow-y: auto;
  padding-right: 6px;
}

.training-list{
  display: grid;
  gap: 10px;
}

/* Optional scrollbar styling */
.training-scroll::-webkit-scrollbar{
  width: 10px;
}
.training-scroll::-webkit-scrollbar-thumb{
  background: rgba(255,255,255,0.12);
  border-radius: 999px;
}
.training-scroll::-webkit-scrollbar-track{
  background: rgba(0,0,0,0.15);
  border-radius: 999px;
}

/* Personnel action category styling */
.pa-card.pa-green{ border-color: rgba(34,197,94,0.55) !important; background: rgba(34,197,94,0.08); }
.pa-card.pa-amber{ border-color: rgba(245,158,11,0.60) !important; background: rgba(245,158,11,0.08); }
.pa-card.pa-red{ border-color: rgba(239,68,68,0.60) !important; background: rgba(239,68,68,0.08); }

.pa-filters{
  display:flex;
  flex-wrap:wrap;
  gap:10px 14px;
  align-items:center;
}

.pa-filter{
  display:flex;
  align-items:center;
  gap:8px;
  font-weight:700;
  font-size:13px;
  cursor:pointer;
  user-select:none;
}

.pa-filter input{ transform: translateY(1px); }

.pa-dot{
  width:10px;
  height:10px;
  border-radius:999px;
  border:2px solid rgba(148,163,184,0.55);
  display:inline-block;
}

.pa-dot-green{ border-color: rgba(34,197,94,0.9); }
.pa-dot-amber{ border-color: rgba(245,158,11,0.95); }
.pa-dot-red{ border-color: rgba(239,68,68,0.95); }

.pa-card { border:1px solid rgba(148,163,184,.25); border-radius:14px; padding:12px; background:rgba(2,6,23,.55); }
.pa-commendation { border-color: rgba(34,197,94,.55); }
.pa-warning { border-color: rgba(245,158,11,.60); }
.pa-misconduct { border-color: rgba(239,68,68,.60); }

/* ===========================
   Personnel Action Modal
   =========================== */
.pa-modal {
  position: fixed;
  inset: 0;
  z-index: 99999; /* must beat navbar */
  display: none;
}

.pa-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(2, 6, 23, 0.78);
}

/* Centered modal */
.pa-modal-card {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);

  width: min(820px, calc(100vw - 32px));
  max-height: calc(100vh - 120px);
  overflow-y: auto;

  padding: 18px;
  border-radius: 16px;
  border: 1px solid rgba(148,163,184,.25);
  background: rgba(15,23,42,.98);

  box-shadow: 0 30px 80px rgba(0,0,0,.65);
}

/* Close button */
.pa-modal-close {
  position: absolute;
  top: 12px;
  right: 12px;

  width: 34px;
  height: 34px;
  border-radius: 10px;

  border: 1px solid rgba(148,163,184,.25);
  background: rgba(30,41,59,.75);
  color: #f1f5f9;
  cursor: pointer;
  font-size: 20px;
}

.pa-modal-close:hover {
  background: rgba(30,41,59,.95);
}
