/* ============================================
   UPA BK Universitas Mulawarman
   Design System - Main CSS
   ============================================ */

@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@400;500;600;700;800&family=DM+Serif+Display:ital@0;1&display=swap');

:root {
  --navy:    #0F2044;
  --navy2:   #1A3060;
  --navy3:   #243D7A;
  --gold:    #F5A623;
  --gold2:   #E8941A;
  --white:   #FFFFFF;
  --cream:   #F5F2EC;
  --cream2:  #EDE9E0;
  --text:    #1A1A2E;
  --text2:   #4A4A6A;
  --text3:   #8A8AAA;
  --border:  #E2DDD5;
  --card:    #FFFFFF;

  --r: #E74C3C; --i: #3498DB; --a: #9B59B6;
  --s: #2ECC71; --e: #F39C12; --c: #1ABC9C;

  --radius:  12px;
  --radius2: 20px;
  --shadow:  0 2px 16px rgba(15,32,68,.08);
  --shadow2: 0 8px 40px rgba(15,32,68,.15);

  --font: 'Plus Jakarta Sans', sans-serif;
  --serif: 'DM Serif Display', serif;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  font-family: var(--font);
  background: var(--cream);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
}

/* ---- NAVBAR ---- */
.navbar {
  background: var(--navy);
  padding: 0 2rem;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 1000;
  box-shadow: 0 2px 20px rgba(0,0,0,.25);
}

.navbar-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
}

.navbar-logo {
  background: var(--gold);
  color: var(--navy);
  font-weight: 800;
  font-size: 13px;
  padding: 6px 10px;
  border-radius: 8px;
  letter-spacing: .5px;
  white-space: nowrap;
}

.navbar-title {
  color: var(--white);
  font-weight: 700;
  font-size: 15px;
  line-height: 1.2;
}

.navbar-subtitle {
  color: rgba(255,255,255,.55);
  font-size: 11px;
  font-weight: 400;
}

.navbar-nav {
  display: flex;
  align-items: center;
  gap: 4px;
  list-style: none;
}

.navbar-nav a {
  color: rgba(255,255,255,.75);
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  padding: 8px 14px;
  border-radius: 8px;
  transition: all .2s;
}

.navbar-nav a:hover,
.navbar-nav a.active {
  background: rgba(255,255,255,.1);
  color: var(--white);
}

.navbar-user {
  display: flex;
  align-items: center;
  gap: 10px;
}

.navbar-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--gold);
  color: var(--navy);
  font-weight: 700;
  font-size: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  position: relative;
}

.dropdown {
  position: relative;
}

.dropdown-menu {
  position: absolute;
  right: 0;
  top: calc(100% + 0px);
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow2);
  min-width: 180px;
  padding: 8px;
  display: none;
  border: 1px solid var(--border);
}

.dropdown:hover .dropdown-menu,
.dropdown.open .dropdown-menu { display: block; }

.dropdown-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 8px;
  text-decoration: none;
  color: var(--text);
  font-size: 14px;
  font-weight: 500;
  transition: background .15s;
}

.dropdown-item:hover { background: var(--cream); }
.dropdown-item.danger { color: #E53E3E; }
.dropdown-item.danger:hover { background: #FFF5F5; }

.dropdown-divider {
  border: none;
  border-top: 1px solid var(--border);
  margin: 4px 0;
}

/* Mobile hamburger */
.navbar-toggle {
  display: none;
  background: none;
  border: none;
  color: white;
  font-size: 22px;
  cursor: pointer;
  padding: 4px;
}

/* ---- BUTTONS ---- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 24px;
  border-radius: var(--radius);
  font-family: var(--font);
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  border: 2px solid transparent;
  text-decoration: none;
  transition: all .2s;
  white-space: nowrap;
}

.btn-primary {
  background: var(--gold);
  color: var(--navy);
  border-color: var(--gold);
}
.btn-primary:hover { background: var(--gold2); border-color: var(--gold2); transform: translateY(-1px); box-shadow: 0 4px 16px rgba(245,166,35,.4); }

.btn-outline {
  background: transparent;
  color: var(--white);
  border-color: rgba(255,255,255,.4);
}
.btn-outline:hover { background: rgba(255,255,255,.1); border-color: var(--white); }

.btn-navy {
  background: var(--navy);
  color: var(--white);
  border-color: var(--navy);
}
.btn-navy:hover { background: var(--navy2); transform: translateY(-1px); }

.btn-sm { padding: 8px 16px; font-size: 13px; }
.btn-lg { padding: 16px 32px; font-size: 16px; }
.btn-full { width: 100%; justify-content: center; }

.btn:disabled { opacity: .55; cursor: not-allowed; transform: none !important; }

/* ---- FORMS ---- */
.form-group { margin-bottom: 20px; }

.form-label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--text2);
  margin-bottom: 6px;
  letter-spacing: .3px;
  text-transform: uppercase;
}

.form-control {
  width: 100%;
  padding: 12px 16px;
  border: 2px solid var(--border);
  border-radius: var(--radius);
  font-family: var(--font);
  font-size: 15px;
  color: var(--text);
  background: var(--white);
  transition: border-color .2s, box-shadow .2s;
  outline: none;
}

.form-control:focus {
  border-color: var(--navy);
  box-shadow: 0 0 0 3px rgba(15,32,68,.1);
}

.form-control.error { border-color: #E53E3E; }

select.form-control { appearance: none; cursor: pointer; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%234A4A6A' d='M6 8L1 3h10z'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 16px center; padding-right: 40px; }

.form-error { color: #E53E3E; font-size: 12px; margin-top: 4px; }
.form-hint  { color: var(--text3); font-size: 12px; margin-top: 4px; }

/* ---- CARDS ---- */
.card {
  background: var(--card);
  border-radius: var(--radius2);
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
  overflow: hidden;
}

.card-body { padding: 28px; }
.card-header {
  padding: 20px 28px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.card-title { font-size: 17px; font-weight: 700; color: var(--text); }
.card-footer { padding: 16px 28px; border-top: 1px solid var(--border); background: var(--cream); }

/* ---- ALERTS ---- */
.alert {
  padding: 14px 18px;
  border-radius: var(--radius);
  font-size: 14px;
  font-weight: 500;
  border: 1px solid transparent;
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-bottom: 20px;
}
.alert-danger  { background: #FFF5F5; color: #C53030; border-color: #FED7D7; }
.alert-success { background: #F0FFF4; color: #276749; border-color: #C6F6D5; }
.alert-info    { background: #EBF8FF; color: #2B6CB0; border-color: #BEE3F8; }
.alert-warning { background: #FFFAF0; color: #C05621; border-color: #FEEBC8; }

/* ---- BADGES ---- */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  border-radius: 100px;
  font-size: 12px;
  font-weight: 600;
}
.badge-r { background: rgba(231,76,60,.12);  color: var(--r); }
.badge-i { background: rgba(52,152,219,.12); color: var(--i); }
.badge-a { background: rgba(155,89,182,.12); color: var(--a); }
.badge-s { background: rgba(46,204,113,.12); color: var(--s); }
.badge-e { background: rgba(243,156,18,.12); color: var(--e); }
.badge-c { background: rgba(26,188,156,.12); color: var(--c); }

/* ---- TABLES ---- */
.table-wrap { overflow-x: auto; border-radius: var(--radius2); box-shadow: var(--shadow); border: 1px solid var(--border); }

table { width: 100%; border-collapse: collapse; background: var(--white); }
thead { background: var(--navy); }
thead th { color: rgba(255,255,255,.85); font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: .6px; padding: 14px 16px; white-space: nowrap; }
tbody tr { border-bottom: 1px solid var(--border); transition: background .15s; }
tbody tr:last-child { border-bottom: none; }
tbody tr:hover { background: var(--cream); }
tbody td { padding: 14px 16px; font-size: 14px; color: var(--text); }
.td-muted { color: var(--text3); font-size: 13px; }

/* ---- PROGRESS ---- */
.progress {
  height: 8px;
  background: var(--cream2);
  border-radius: 100px;
  overflow: hidden;
}
.progress-bar {
  height: 100%;
  background: linear-gradient(90deg, var(--navy), var(--gold));
  border-radius: 100px;
  transition: width .4s ease;
}

/* ---- STAT CARDS ---- */
.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 20px; }

.stat-card {
  background: var(--white);
  border-radius: var(--radius2);
  padding: 24px;
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  display: flex;
  align-items: flex-start;
  gap: 16px;
}

.stat-icon {
  width: 52px;
  height: 52px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  flex-shrink: 0;
}

.stat-icon.navy  { background: rgba(15,32,68,.1); }
.stat-icon.gold  { background: rgba(245,166,35,.15); }
.stat-icon.green { background: rgba(46,204,113,.12); }
.stat-icon.blue  { background: rgba(52,152,219,.12); }

.stat-value { font-size: 28px; font-weight: 800; color: var(--text); line-height: 1; }
.stat-label { font-size: 13px; color: var(--text2); font-weight: 500; margin-top: 4px; }

/* ---- PAGE HEADER ---- */
.page-header {
  background: var(--navy);
  color: var(--white);
  padding: 40px 0 48px;
}
.page-header-inner { max-width: 1200px; margin: 0 auto; padding: 0 2rem; }
.page-header h1 { font-size: 28px; font-weight: 800; }
.page-header p  { color: rgba(255,255,255,.65); font-size: 15px; margin-top: 6px; }
.breadcrumb { display: flex; align-items: center; gap: 6px; font-size: 13px; color: rgba(255,255,255,.5); margin-bottom: 12px; }
.breadcrumb a { color: var(--gold); text-decoration: none; }
.breadcrumb-sep { opacity: .4; }

/* ---- CONTAINER ---- */
.container { max-width: 1200px; margin: 0 auto; padding: 0 2rem; }
.container-sm { max-width: 540px; margin: 0 auto; padding: 0 2rem; }
.container-md { max-width: 800px; margin: 0 auto; padding: 0 2rem; }

.main-content { padding: 2rem 0 4rem; }

/* ---- PAGINATION ---- */
.pagination { display: flex; gap: 4px; align-items: center; justify-content: center; flex-wrap: wrap; }
.page-btn {
  width: 36px; height: 36px;
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  border: 1px solid var(--border);
  background: var(--white);
  color: var(--text2);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  transition: all .2s;
}
.page-btn:hover  { background: var(--cream2); border-color: var(--navy); color: var(--navy); }
.page-btn.active { background: var(--navy); color: var(--white); border-color: var(--navy); }
.page-btn:disabled { opacity: .4; cursor: not-allowed; }

/* ---- MODAL ---- */
.modal-backdrop {
  position: fixed; inset: 0;
  background: rgba(0,0,0,.5);
  z-index: 2000;
  display: flex; align-items: center; justify-content: center;
  padding: 1rem;
  opacity: 0; visibility: hidden; transition: all .25s;
}
.modal-backdrop.open { opacity: 1; visibility: visible; }
.modal {
  background: var(--white);
  border-radius: var(--radius2);
  max-width: 500px;
  width: 100%;
  box-shadow: 0 20px 60px rgba(0,0,0,.3);
  transform: translateY(20px);
  transition: transform .25s;
}
.modal-backdrop.open .modal { transform: translateY(0); }
.modal-header { padding: 24px 28px 0; display: flex; align-items: center; justify-content: space-between; }
.modal-title { font-size: 18px; font-weight: 700; }
.modal-body { padding: 20px 28px; }
.modal-footer { padding: 0 28px 24px; display: flex; gap: 12px; justify-content: flex-end; }
.modal-close { background: none; border: none; font-size: 22px; cursor: pointer; color: var(--text3); padding: 4px; border-radius: 6px; }
.modal-close:hover { background: var(--cream); color: var(--text); }

/* ---- TOAST ---- */
#toast-container {
  position: fixed; bottom: 24px; right: 24px; z-index: 9999;
  display: flex; flex-direction: column; gap: 10px;
}
.toast {
  background: var(--navy);
  color: var(--white);
  padding: 14px 20px;
  border-radius: var(--radius);
  font-size: 14px;
  font-weight: 500;
  box-shadow: var(--shadow2);
  max-width: 320px;
  display: flex; align-items: center; gap: 10px;
  animation: slideInToast .3s ease;
}
.toast.success { background: #276749; }
.toast.error   { background: #C53030; }
@keyframes slideInToast { from { transform: translateX(100px); opacity: 0; } }

/* ---- RESPONSIVE ---- */
@media (max-width: 768px) {
  .navbar-nav { display: none; flex-direction: column; position: absolute; top: 64px; left: 0; right: 0; background: var(--navy2); padding: 12px; gap: 2px; }
  .navbar-nav.open { display: flex; }
  .navbar-toggle { display: flex; }
  .navbar { position: relative; }
  .stat-grid { grid-template-columns: 1fr 1fr; }
  .container, .container-sm, .container-md { padding: 0 1rem; }
  .card-body, .card-header { padding: 20px; }
  .btn-lg { padding: 14px 24px; font-size: 15px; }
}

@media (max-width: 480px) {
  .stat-grid { grid-template-columns: 1fr; }
  .modal { border-radius: var(--radius); }
  .navbar-logo { display: none; }
}

/* ---- UTILITIES ---- */
.text-center { text-align: center; }
.text-right  { text-align: right; }
.text-muted  { color: var(--text3); }
.text-navy   { color: var(--navy); }
.text-gold   { color: var(--gold); }

.mt-1 { margin-top: 8px; }
.mt-2 { margin-top: 16px; }
.mt-3 { margin-top: 24px; }
.mt-4 { margin-top: 32px; }
.mb-1 { margin-bottom: 8px; }
.mb-2 { margin-bottom: 16px; }
.mb-3 { margin-bottom: 24px; }
.mb-4 { margin-bottom: 32px; }

.flex { display: flex; }
.flex-center { display: flex; align-items: center; justify-content: center; }
.flex-between { display: flex; align-items: center; justify-content: space-between; }
.gap-1 { gap: 8px; }
.gap-2 { gap: 16px; }
.gap-3 { gap: 24px; }

.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 20px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }

@media (max-width: 768px) {
  .grid-2, .grid-3 { grid-template-columns: 1fr; }
}

.fw-bold { font-weight: 700; }
.fw-semi { font-weight: 600; }
.fs-sm  { font-size: 13px; }
.fs-lg  { font-size: 18px; }

.d-none { display: none; }

/* ---- PRINT ---- */
@media print {
  .navbar, .no-print, .btn, footer { display: none !important; }
  body { background: white; }
  .card { box-shadow: none; border: 1px solid #ddd; }
  .page-header { background: var(--navy) !important; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .chart-wrap canvas { max-width: 400px !important; }
}
