@import url('https://fonts.googleapis.com/css2?family=Bebas+Neue&family=JetBrains+Mono:wght@300;400;500;700&family=Crimson+Pro:ital,wght@0,300;0,400;0,600;1,300&display=swap');

:root {
  --bg:         #080a07;
  --surface:    #0d1209;
  --card:       #121a0e;
  --card2:      #182215;
  --border:     #1f2d18;
  --border2:    #2c3f22;
  --gold:       #7c9e3c;
  --gold2:      #98c04e;
  --gold-dim:   rgba(124,158,60,0.12);
  --blue:       #4d85a8;
  --blue-dim:   rgba(77,133,168,0.12);
  --red:        #c04040;
  --red-dim:    rgba(192,64,64,0.12);
  --green:      #3eaa6e;
  --green-dim:  rgba(62,170,110,0.12);
  --text:       #cdd6bc;
  --text2:      #7d9272;
  --text3:      #455440;
  --ff-display: 'Bebas Neue', cursive;
  --ff-mono:    'JetBrains Mono', monospace;
  --ff-body:    'Crimson Pro', serif;
  --radius-clip: polygon(0 0, calc(100% - 12px) 0, 100% 12px, 100% 100%, 12px 100%, 0 calc(100% - 12px));
  --radius-clip-sm: polygon(0 0, calc(100% - 8px) 0, 100% 8px, 100% 100%, 8px 100%, 0 calc(100% - 8px));
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; background: var(--bg); }

body {
  background: transparent;
  color: var(--text);
  font-family: var(--ff-body);
  font-size: 16px;
  min-height: 100vh;
  overflow-x: hidden;
  position: relative;
}

/* Noise texture overlay */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.04'/%3E%3C/svg%3E");
  pointer-events: none;
  z-index: 9999;
  opacity: 0.35;
}

/* Animated military canvas background */
#mil-bg {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  z-index: -2;
  pointer-events: none;
  filter: blur(5px) brightness(0.6);
}

::-webkit-scrollbar { width: 5px; }
::-webkit-scrollbar-track { background: var(--surface); }
::-webkit-scrollbar-thumb { background: var(--border2); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--gold); }

/* ── ANIMATIONS ── */
@keyframes fadeUp   { from { opacity:0; transform:translateY(12px); } to { opacity:1; transform:translateY(0); } }
@keyframes fadeIn   { from { opacity:0; } to { opacity:1; } }
@keyframes pulse    { 0%,100% { opacity:1; } 50% { opacity:.3; } }
@keyframes shimmer  { 0% { background-position:-200% 0; } 100% { background-position:200% 0; } }


.anim-fade-up { animation: fadeUp .4s ease both; }
.anim-fade-up-2 { animation: fadeUp .4s .1s ease both; }
.anim-fade-up-3 { animation: fadeUp .4s .2s ease both; }
.anim-fade-up-4 { animation: fadeUp .4s .3s ease both; }

/* ── NAVBAR ── */
.navbar {
  position: sticky; top: 0; z-index: 100;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  box-shadow: 0 4px 32px rgba(0,0,0,.5);
}

.navbar-inner {
  max-width: 1440px; margin: 0 auto;
  display: flex; align-items: center;
  padding: 0 28px; gap: 0;
}

.nav-brand {
  font-family: var(--ff-display);
  font-size: 1.5rem; letter-spacing: 4px; color: var(--gold);
  padding: 0 24px 0 0; margin-right: 8px;
  border-right: 1px solid var(--border);
  cursor: pointer; text-decoration: none;
  display: flex; flex-direction: column; justify-content: center;
  height: 64px;
}
.nav-brand small {
  display: block; font-family: var(--ff-mono); font-size: .58rem;
  letter-spacing: 3px; color: var(--text3); margin-top: 2px;
}
.nav-brand:hover { color: var(--gold2); }

.nav-items { display: flex; align-items: stretch; flex: 1; }

.nav-link {
  display: flex; align-items: center; gap: 8px;
  padding: 0 18px; height: 64px;
  font-family: var(--ff-mono); font-size: .68rem; font-weight: 500;
  letter-spacing: 1.5px; text-transform: uppercase;
  color: var(--text2); cursor: pointer; text-decoration: none;
  transition: color .2s, background .2s; white-space: nowrap;
  border: none; background: transparent; outline: none; user-select: none;
  position: relative;
}
.nav-link svg { width: 13px; height: 13px; flex-shrink: 0; }
.nav-link:hover, .nav-link.active { color: var(--gold); background: var(--gold-dim); }
.nav-link.active::after {
  content: ''; position: absolute; bottom: 0; left: 0; right: 0;
  height: 2px; background: var(--gold);
}

/* Dropdown */
.nav-item { position: relative; display: flex; align-items: center; }
.dropdown-toggle .chevron { width: 11px; height: 11px; transition: transform .2s; margin-left: 3px; }
.nav-item:hover .chevron { transform: rotate(180deg); }

.dropdown-menu {
  position: absolute; top: 100%; left: 0; min-width: 230px;
  background: var(--card); border: 1px solid var(--border);
  border-top: 2px solid var(--gold);
  box-shadow: 0 24px 48px rgba(0,0,0,.7);
  z-index: 200; display: none; flex-direction: column;
}
.nav-item:hover .dropdown-menu { display: flex; animation: fadeIn .15s ease; }

.dropdown-header {
  padding: 9px 16px 7px;
  font-family: var(--ff-mono); font-size: .58rem; letter-spacing: 2.5px;
  text-transform: uppercase; color: var(--text3);
  border-bottom: 1px solid var(--border);
}

.dropdown-item {
  display: flex; align-items: center; gap: 10px;
  padding: 11px 16px; font-family: var(--ff-mono); font-size: .7rem;
  color: var(--text2); cursor: pointer; text-decoration: none;
  transition: all .15s; border-bottom: 1px solid rgba(31,45,24,.5);
}
.dropdown-item:last-child { border-bottom: none; }
.dropdown-item:hover { color: var(--gold); background: var(--gold-dim); padding-left: 20px; }
.dropdown-item .dot { width:6px; height:6px; border-radius:50%; background:var(--border2); flex-shrink:0; transition:background .15s; }
.dropdown-item:hover .dot { background: var(--gold); }

/* Sub-dropdown */
.sub-dropdown { position: relative; }
.sub-dropdown-menu {
  position: absolute; top: 0; left: 100%; min-width: 210px;
  background: var(--card2); border: 1px solid var(--border);
  border-left: 2px solid var(--gold);
  box-shadow: 16px 16px 40px rgba(0,0,0,.6);
  z-index: 300; display: none; flex-direction: column;
}
.sub-dropdown:hover .sub-dropdown-menu { display: flex; animation: fadeIn .12s ease; }

/* Nav right */
.nav-right { display:flex; align-items:center; gap:12px; padding-left:16px; margin-left:auto; border-left:1px solid var(--border); }

.user-badge {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 14px; background: var(--card);
  border: 1px solid var(--border);
  clip-path: var(--radius-clip-sm);
}
.user-avatar {
  width: 32px; height: 32px;
  background: var(--gold-dim); border: 1px solid var(--gold);
  border-radius: 50%; display: flex; align-items: center; justify-content: center;
  font-family: var(--ff-mono); font-size: .7rem; color: var(--gold); font-weight: 700;
}
.user-info { line-height: 1.3; }
.user-name  { font-family: var(--ff-mono); font-size: .72rem; color: var(--text); font-weight: 500; }
.user-role  { font-family: var(--ff-mono); font-size: .58rem; color: var(--gold); letter-spacing: 1px; }

.logout-btn {
  display: flex; align-items: center; gap: 6px;
  padding: 9px 16px; background: transparent;
  border: 1px solid var(--border); color: var(--text3);
  font-family: var(--ff-mono); font-size: .65rem; letter-spacing: 1px;
  cursor: pointer; transition: all .2s; text-decoration: none;
  clip-path: var(--radius-clip-sm);
}
.logout-btn:hover { color: var(--red); border-color: var(--red); background: var(--red-dim); }

/* ── PAGE WRAPPER ── */
.page-wrapper {
  max-width: 1440px; width: 100%; margin: 0 auto;
  padding: 40px 28px 64px;
}

/* ── SECTION HEADER ── */
.section-header {
  display: flex; align-items: flex-end; justify-content: space-between;
  margin-bottom: 32px; padding-bottom: 16px;
  border-bottom: 1px solid var(--border); position: relative;
}
.section-header::after {
  content: ''; position: absolute; bottom: -1px; left: 0;
  width: 100px; height: 2px; background: var(--gold);
}
.section-title { font-family: var(--ff-display); font-size: 2.5rem; letter-spacing: 3px; color: var(--text); line-height: 1; }
.section-title span { color: var(--gold); }
.section-sub { font-family: var(--ff-mono); font-size: .62rem; letter-spacing: 2px; color: var(--text3); text-transform: uppercase; margin-top: 5px; }

/* ── CARDS ── */
.card {
  background: var(--card); border: 1px solid var(--border);
  padding: 24px; position: relative; overflow: hidden;
}
.card::before { content: ''; position: absolute; top:0; left:0; width:3px; height:100%; background: var(--gold); }
.card-corner { clip-path: var(--radius-clip); }
.card-title { font-family: var(--ff-mono); font-size: .62rem; letter-spacing: 2.5px; text-transform: uppercase; color: var(--text3); margin-bottom: 14px; }

/* ── BUTTONS ── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  padding: 11px 22px; font-family: var(--ff-mono); font-size: .72rem; font-weight: 700;
  letter-spacing: 1.5px; text-transform: uppercase; cursor: pointer;
  transition: all .2s; border: none; outline: none; text-decoration: none;
  clip-path: var(--radius-clip-sm);
}
.btn svg { width: 13px; height: 13px; flex-shrink: 0; }
.btn-gold   { background: var(--gold); color: #080a07; }
.btn-gold:hover   { background: var(--gold2); transform: translateY(-1px); box-shadow: 0 8px 24px rgba(124,158,60,.3); }
.btn-outline { background: transparent; color: var(--gold); border: 1px solid var(--gold); }
.btn-outline:hover { background: var(--gold-dim); }
.btn-blue   { background: var(--blue); color: #fff; }
.btn-blue:hover   { background: #3d6f90; transform: translateY(-1px); }
.btn-red    { background: var(--red); color: #fff; }
.btn-red:hover    { background: #a03030; }
.btn-sm { padding: 7px 14px; font-size: .62rem; clip-path: polygon(0 0, calc(100% - 6px) 0, 100% 6px, 100% 100%, 6px 100%, 0 calc(100% - 6px)); }
.btn-w100 { width: 100%; }

/* ── FORM ── */
.form-group { margin-bottom: 18px; }
.form-group label { display: block; font-family: var(--ff-mono); font-size: .62rem; letter-spacing: 2px; text-transform: uppercase; color: var(--text3); margin-bottom: 7px; }

.form-control {
  width: 100%; padding: 11px 15px;
  background: var(--surface); border: 1px solid var(--border);
  color: var(--text); font-family: var(--ff-mono); font-size: .82rem;
  outline: none; transition: border-color .2s, box-shadow .2s;
  clip-path: var(--radius-clip-sm);
}
.form-control:focus { border-color: var(--gold); box-shadow: 0 0 0 3px var(--gold-dim); }
.form-control::placeholder { color: var(--text3); }
select.form-control { cursor: pointer; -webkit-appearance: none; appearance: none; }
textarea.form-control { resize: vertical; min-height: 80px; }

.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.form-full  { grid-column: 1 / -1; }

/* ── SEARCH BAR ── */
.search-bar {
  display: flex; align-items: center; gap: 9px;
  background: var(--card); border: 1px solid var(--border);
  padding: 0 14px; transition: border-color .2s; flex: 1;
  clip-path: var(--radius-clip-sm);
}
.search-bar:focus-within { border-color: var(--gold); }
.search-bar svg { color: var(--text3); width: 13px; height: 13px; flex-shrink: 0; }
.search-bar input { flex:1; background:transparent; border:none; outline:none; padding:11px 0; font-family:var(--ff-mono); font-size:.78rem; color:var(--text); clip-path:none; }
.search-bar input::placeholder { color: var(--text3); }

.search-row { display: flex; align-items: center; gap: 12px; margin-bottom: 20px; }

/* ── TABLE ── */
.table-wrap { overflow-x: auto; border: 1px solid var(--border); }

.data-table { width: 100%; border-collapse: collapse; font-family: var(--ff-mono); }
.data-table thead tr { background: var(--surface); border-bottom: 2px solid var(--gold); }
.data-table thead th { padding: 12px 16px; text-align: left; font-size: .6rem; letter-spacing: 2px; text-transform: uppercase; color: var(--text3); font-weight: 500; white-space: nowrap; }
.data-table tbody tr { border-bottom: 1px solid var(--border); transition: background .15s; }
.data-table tbody tr:hover { background: rgba(124,158,60,.04); }
.data-table tbody tr:last-child { border-bottom: none; }
.data-table tbody td { padding: 12px 16px; font-size: .78rem; color: var(--text2); white-space: nowrap; }
.data-table tbody td:first-child { color: var(--text); font-weight: 500; }

/* ── BADGES ── */
.rank-badge { display: inline-flex; align-items: center; padding: 3px 9px; border-radius: 2px; font-family: var(--ff-mono); font-size: .62rem; letter-spacing: 1px; font-weight: 500; }
.rank-1 { background:var(--blue-dim); color:var(--blue); border:1px solid rgba(77,133,168,.3); }
.rank-2 { background:var(--gold-dim); color:var(--gold); border:1px solid rgba(124,158,60,.3); }
.rank-3 { background:var(--red-dim);  color:var(--red);  border:1px solid rgba(192,64,64,.3); }
.rank-4 { background:var(--green-dim);color:var(--green);border:1px solid rgba(62,170,110,.3); }

.tag { display:inline-flex; align-items:center; padding:3px 9px; font-family:var(--ff-mono); font-size:.6rem; letter-spacing:1px; border-radius:2px; }
.tag-active   { background:var(--green-dim); color:var(--green); border:1px solid rgba(62,170,110,.3); }
.tag-pending  { background:var(--gold-dim);  color:var(--gold);  border:1px solid rgba(124,158,60,.3); }
.tag-inactive { background:var(--red-dim);   color:var(--red);   border:1px solid rgba(192,64,64,.3); }

.status-dot { display:inline-block; width:7px; height:7px; border-radius:50%; margin-right:6px; }
.status-active   { background:var(--green); box-shadow:0 0 6px var(--green); }
.status-inactive { background:var(--red); }
.status-pending  { background:var(--gold); animation:pulse 2s infinite; }

.admin-badge {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 12px; background: var(--gold-dim);
  border: 1px solid rgba(124,158,60,.4);
  font-family: var(--ff-mono); font-size: .6rem; letter-spacing: 2px;
  text-transform: uppercase; color: var(--gold);
  clip-path: var(--radius-clip-sm);
}

.admin-banner {
  display: flex; align-items: center; gap: 10px;
  background: var(--gold-dim); border: 1px solid rgba(124,158,60,.25);
  border-left: 3px solid var(--gold);
  padding: 10px 16px; margin-bottom: 22px;
  font-family: var(--ff-mono); font-size: .7rem; color: var(--gold);
}

/* ── ALERT ── */
.alert {
  padding: 11px 16px; font-family: var(--ff-mono); font-size: .72rem;
  margin-bottom: 16px; clip-path: var(--radius-clip-sm); display: none;
}
.alert.show { display: block; animation: fadeUp .3s ease; }
.alert-success { background:var(--green-dim); border:1px solid rgba(62,170,110,.3); color:var(--green); }
.alert-error   { background:var(--red-dim);   border:1px solid rgba(192,64,64,.3);  color:var(--red); }

/* ── MODAL ── */
.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(8,10,7,.9); backdrop-filter: blur(5px);
  z-index: 500; display: none; align-items: center; justify-content: center;
}
.modal-overlay.open { display: flex; animation: fadeIn .2s ease; }

.modal {
  background: var(--card); border: 1px solid var(--border);
  border-top: 2px solid var(--gold);
  width: 580px; max-width: 96vw; max-height: 92vh; overflow-y: auto;
  box-shadow: 0 40px 80px rgba(0,0,0,.8);
  clip-path: polygon(0 0, calc(100% - 20px) 0, 100% 20px, 100% 100%, 20px 100%, 0 calc(100% - 20px));
  animation: fadeUp .25s ease;
}
.modal-header { padding: 20px 24px; border-bottom: 1px solid var(--border); display: flex; align-items: center; justify-content: space-between; }
.modal-title  { font-family: var(--ff-display); font-size: 1.6rem; letter-spacing: 2px; color: var(--text); }
.modal-close {
  width: 32px; height: 32px; display: flex; align-items: center; justify-content: center;
  background: transparent; border: 1px solid var(--border); color: var(--text3);
  cursor: pointer; font-size: 1.1rem; transition: all .2s;
  clip-path: polygon(0 0,calc(100% - 6px) 0,100% 6px,100% 100%,6px 100%,0 calc(100% - 6px));
}
.modal-close:hover { color: var(--red); border-color: var(--red); background: var(--red-dim); }
.modal-body   { padding: 24px; }
.modal-footer { padding: 16px 24px; border-top: 1px solid var(--border); display: flex; gap: 10px; justify-content: flex-end; }

/* ── EMPTY STATE ── */
.empty-state { text-align: center; padding: 52px 24px; font-family: var(--ff-mono); font-size: .72rem; color: var(--text3); letter-spacing: 1px; }
.empty-state span { display: block; font-size: 2rem; margin-bottom: 12px; opacity: .3; }

/* ── UTILITY ── */
.mt-0 { margin-top: 0 !important; }
.mt-1 { margin-top: 8px; }
.mt-2 { margin-top: 16px; }
.mt-3 { margin-top: 24px; }
.mb-2 { margin-bottom: 16px; }
.mb-3 { margin-bottom: 24px; }
.flex  { display: flex; }
.flex-center { display: flex; align-items: center; }
.flex-between { display: flex; align-items: center; justify-content: space-between; }
.gap-2 { gap: 10px; }
.gap-3 { gap: 16px; }
.text-gold  { color: var(--gold); }
.text-muted { color: var(--text3); }
.font-mono  { font-family: var(--ff-mono); font-size: .78rem; }
.font-display { font-family: var(--ff-display); }

/* ── RESPONSIVE ── */
@media (max-width: 900px) {
  .form-grid { grid-template-columns: 1fr; }
  .nav-items { display: none; }
  .page-wrapper { padding: 24px 16px 48px; }
}
