/* ============================================================
   SIMPERFORMA — Design System
   Green-Gold Glassmorphism | Dark/Light Mode
   ============================================================ */

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

/* ---------- CSS Variables ---------- */
:root {
  --green-50:  #f0fdf4;
  --green-100: #dcfce7;
  --green-400: #4ade80;
  --green-500: #22c55e;
  --green-600: #16a34a;
  --green-700: #15803d;
  --green-800: #166534;
  --gold-400:  #fbbf24;
  --gold-500:  #f59e0b;
  --gold-600:  #d97706;

  --bg:        #f8fafc;
  --bg-card:   rgba(255,255,255,0.85);
  --bg-sidebar:#0f172a;
  --text:      #0f172a;
  --text-muted:#64748b;
  --border:    rgba(0,0,0,0.08);
  --shadow:    0 4px 24px rgba(0,0,0,0.07);
  --shadow-lg: 0 8px 40px rgba(0,0,0,0.12);
  --radius:    1rem;
  --radius-sm: 0.5rem;
  --transition:0.2s ease;

  --sidebar-w: 260px;
  --topbar-h:  64px;
}

[data-theme="dark"] {
  --bg:        #0b1120;
  --bg-card:   rgba(15,23,42,0.85);
  --text:      #f1f5f9;
  --text-muted:#94a3b8;
  --border:    rgba(255,255,255,0.08);
  --shadow:    0 4px 24px rgba(0,0,0,0.4);
}

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: 'Inter', sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  transition: background var(--transition), color var(--transition);
}
a { color: inherit; text-decoration: none; }
img { max-width: 100%; }

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

/* ---------- Sidebar ---------- */
.sidebar {
  width: var(--sidebar-w);
  background: var(--bg-sidebar);
  position: fixed; top: 0; left: 0; bottom: 0;
  display: flex; flex-direction: column;
  z-index: 100;
  transition: transform var(--transition);
  overflow-y: auto;
}
.sidebar-brand {
  padding: 1.5rem 1.25rem 1rem;
  border-bottom: 1px solid rgba(255,255,255,0.06);
}
.sidebar-brand .brand-logo {
  display: flex; align-items: center; gap: 0.75rem;
}
.brand-icon {
  width: 40px; height: 40px; border-radius: 10px;
  background: linear-gradient(135deg, var(--green-500), var(--gold-500));
  display: flex; align-items: center; justify-content: center;
  font-size: 1.2rem; font-weight: 800; color: #fff;
}
.brand-text { display: flex; flex-direction: column; }
.brand-name {
  font-size: 1rem; font-weight: 700;
  background: linear-gradient(90deg, var(--green-400), var(--gold-400));
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
  background-clip: text;
}
.brand-sub { font-size: 0.65rem; color: #64748b; font-weight: 400; }

.sidebar-nav { padding: 1rem 0.75rem; flex: 1; }
.nav-section-label {
  font-size: 0.65rem; font-weight: 600; letter-spacing: 0.08em;
  color: #475569; text-transform: uppercase;
  padding: 0.75rem 0.5rem 0.25rem;
}
.nav-item {
  display: flex; align-items: center; gap: 0.75rem;
  padding: 0.625rem 0.75rem; border-radius: var(--radius-sm);
  color: #94a3b8; font-size: 0.875rem; font-weight: 500;
  transition: all var(--transition); cursor: pointer;
  margin-bottom: 2px;
}
.nav-item:hover {
  background: rgba(255,255,255,0.07); color: #f1f5f9;
}
.nav-item.active {
  background: linear-gradient(135deg, rgba(34,197,94,0.2), rgba(245,158,11,0.1));
  color: var(--green-400);
  border-left: 3px solid var(--green-500);
}
.nav-item .nav-icon { font-size: 1rem; width: 20px; text-align: center; }
.nav-item .nav-badge {
  margin-left: auto;
  background: var(--green-600); color: #fff;
  font-size: 0.65rem; font-weight: 700;
  padding: 1px 6px; border-radius: 99px;
}

.sidebar-footer {
  padding: 1rem 0.75rem;
  border-top: 1px solid rgba(255,255,255,0.06);
}
.sidebar-user {
  display: flex; align-items: center; gap: 0.75rem;
  padding: 0.5rem;
}
.user-avatar {
  width: 36px; height: 36px; border-radius: 50%;
  background: linear-gradient(135deg, var(--green-600), var(--gold-500));
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; color: #fff; font-size: 0.875rem;
  flex-shrink: 0;
}
.user-info .user-name { font-size: 0.8rem; font-weight: 600; color: #e2e8f0; }
.user-info .user-role { font-size: 0.65rem; color: #64748b; }

/* ---------- Main Content ---------- */
.main-content {
  margin-left: var(--sidebar-w);
  flex: 1; display: flex; flex-direction: column;
}

/* ---------- Topbar ---------- */
.topbar {
  height: var(--topbar-h);
  background: var(--bg-card);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center;
  padding: 0 1.5rem; gap: 1rem;
  position: sticky; top: 0; z-index: 50;
}
.topbar-title { font-size: 1.1rem; font-weight: 700; flex: 1; }
.topbar-actions { display: flex; align-items: center; gap: 0.75rem; }

.btn-icon {
  width: 38px; height: 38px; border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--bg-card); color: var(--text);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; transition: all var(--transition); font-size: 1rem;
  position: relative;
}
.btn-icon:hover { background: var(--green-600); color: #fff; border-color: var(--green-600); }
.notif-dot {
  position: absolute; top: 6px; right: 6px;
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--gold-500); border: 2px solid var(--bg);
}

/* ---------- Page Content ---------- */
.page-content { padding: 1.5rem; flex: 1; }
.page-header { margin-bottom: 1.5rem; }
.page-header h1 { font-size: 1.5rem; font-weight: 800; }
.page-header p  { color: var(--text-muted); font-size: 0.875rem; margin-top: 0.25rem; }

/* ---------- Cards ---------- */
.card {
  background: var(--bg-card);
  backdrop-filter: blur(12px);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1.25rem;
  transition: box-shadow var(--transition), transform var(--transition);
}
.card:hover { box-shadow: var(--shadow-lg); transform: translateY(-2px); }
.card-title {
  font-size: 0.875rem; font-weight: 600;
  color: var(--text-muted); margin-bottom: 1rem;
  text-transform: uppercase; letter-spacing: 0.05em;
}

/* ---------- Stat Cards ---------- */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem; margin-bottom: 1.5rem;
}
.stat-card {
  background: var(--bg-card);
  backdrop-filter: blur(12px);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem;
  display: flex; align-items: flex-start; gap: 1rem;
  box-shadow: var(--shadow);
  transition: all var(--transition);
}
.stat-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); }
.stat-icon {
  width: 48px; height: 48px; border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.4rem; flex-shrink: 0;
}
.stat-icon.green { background: linear-gradient(135deg,#dcfce7,#bbf7d0); color: var(--green-700); }
.stat-icon.gold  { background: linear-gradient(135deg,#fef3c7,#fde68a); color: var(--gold-600); }
.stat-icon.blue  { background: linear-gradient(135deg,#dbeafe,#bfdbfe); color: #1d4ed8; }
.stat-icon.red   { background: linear-gradient(135deg,#fee2e2,#fecaca); color: #dc2626; }
.stat-info .stat-value {
  font-size: 1.75rem; font-weight: 800; line-height: 1;
}
.stat-info .stat-label {
  font-size: 0.75rem; color: var(--text-muted);
  margin-top: 0.25rem; font-weight: 500;
}
.stat-info .stat-change {
  font-size: 0.72rem; margin-top: 0.35rem; font-weight: 600;
}
.stat-change.up   { color: var(--green-600); }
.stat-change.down { color: #dc2626; }

/* ---------- Charts Grid ---------- */
.charts-grid {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 1rem; margin-bottom: 1.5rem;
}
.chart-container { width: 100%; height: 280px; }

/* ---------- Data Grid ---------- */
.data-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 1rem; margin-bottom: 1.5rem;
}

/* ---------- Table ---------- */
.table-wrapper {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden; box-shadow: var(--shadow);
}
.table-header {
  padding: 1rem 1.25rem;
  display: flex; align-items: center; justify-content: space-between;
  border-bottom: 1px solid var(--border);
}
.table-header h3 { font-size: 0.95rem; font-weight: 700; }
.table-responsive { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
thead th {
  padding: 0.75rem 1rem; text-align: left;
  font-size: 0.75rem; font-weight: 600; color: var(--text-muted);
  text-transform: uppercase; letter-spacing: 0.05em;
  background: rgba(0,0,0,0.02);
  border-bottom: 1px solid var(--border);
}
tbody td {
  padding: 0.875rem 1rem; font-size: 0.875rem;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}
tbody tr:last-child td { border-bottom: none; }
tbody tr:hover { background: rgba(34,197,94,0.04); }

/* ---------- Badges ---------- */
.badge {
  display: inline-flex; align-items: center;
  padding: 3px 10px; border-radius: 99px;
  font-size: 0.72rem; font-weight: 600;
}
.badge-draft     { background: #f1f5f9; color: #475569; }
.badge-submitted { background: #dbeafe; color: #1d4ed8; }
.badge-revisi    { background: #fef3c7; color: #92400e; }
.badge-approved  { background: #dcfce7; color: #15803d; }
.badge-green     { background: #dcfce7; color: #15803d; }
.badge-gold      { background: #fef3c7; color: #92400e; }

/* ---------- Progress Bar ---------- */
.progress-bar-wrap { background: var(--border); border-radius: 99px; height: 6px; overflow: hidden; }
.progress-bar-fill {
  height: 100%; border-radius: 99px;
  background: linear-gradient(90deg, var(--green-500), var(--gold-500));
  transition: width 0.6s ease;
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 0.5rem;
  padding: 0.5rem 1.1rem; border-radius: var(--radius-sm);
  font-size: 0.875rem; font-weight: 600;
  border: none; cursor: pointer;
  transition: all var(--transition);
}
.btn-primary {
  background: linear-gradient(135deg, var(--green-600), var(--green-700));
  color: #fff;
}
.btn-primary:hover { background: linear-gradient(135deg, var(--green-500), var(--green-600)); transform: translateY(-1px); box-shadow: 0 4px 12px rgba(22,163,74,0.4); }
.btn-gold {
  background: linear-gradient(135deg, var(--gold-500), var(--gold-600));
  color: #fff;
}
.btn-gold:hover { opacity: 0.9; transform: translateY(-1px); }
.btn-outline {
  background: transparent; color: var(--text);
  border: 1px solid var(--border);
}
.btn-outline:hover { background: var(--green-600); color: #fff; border-color: var(--green-600); }
.btn-danger { background: #dc2626; color: #fff; }
.btn-danger:hover { background: #b91c1c; }
.btn-sm { padding: 0.3rem 0.75rem; font-size: 0.8rem; }

/* ---------- Forms ---------- */
.form-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem; box-shadow: var(--shadow);
}
.form-group { margin-bottom: 1.25rem; }
label { display: block; font-size: 0.8rem; font-weight: 600; margin-bottom: 0.4rem; color: var(--text-muted); }
.form-control, .form-select {
  width: 100%; padding: 0.6rem 0.875rem;
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  background: var(--bg); color: var(--text);
  font-size: 0.875rem; font-family: 'Inter', sans-serif;
  transition: border-color var(--transition), box-shadow var(--transition);
}
.form-control:focus, .form-select:focus {
  outline: none; border-color: var(--green-500);
  box-shadow: 0 0 0 3px rgba(34,197,94,0.15);
}
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.form-actions { display: flex; gap: 0.75rem; justify-content: flex-end; margin-top: 1.5rem; }

/* ---------- Alerts / Messages ---------- */
.messages-container { margin-bottom: 1rem; }
.alert {
  padding: 0.75rem 1rem; border-radius: var(--radius-sm);
  font-size: 0.875rem; font-weight: 500;
  display: flex; align-items: center; gap: 0.5rem;
  margin-bottom: 0.5rem; animation: slideIn 0.3s ease;
}
.alert-success { background: #dcfce7; color: #15803d; border-left: 4px solid var(--green-500); }
.alert-error, .alert-danger { background: #fee2e2; color: #dc2626; border-left: 4px solid #ef4444; }
.alert-warning { background: #fef3c7; color: #92400e; border-left: 4px solid var(--gold-500); }
.alert-info    { background: #dbeafe; color: #1d4ed8; border-left: 4px solid #3b82f6; }

/* ---------- Login ---------- */
.login-page {
  min-height: 100vh; display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, #0f172a 0%, #1e2d1f 50%, #0f1c0a 100%);
  position: relative; overflow: hidden;
}
.login-page::before {
  content: '';
  position: absolute; inset: 0;
  background: radial-gradient(ellipse at 30% 50%, rgba(34,197,94,0.12) 0%, transparent 60%),
              radial-gradient(ellipse at 70% 20%, rgba(245,158,11,0.08) 0%, transparent 50%);
}
.login-card {
  background: rgba(15,23,42,0.85);
  backdrop-filter: blur(20px);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 1.5rem;
  padding: 2.5rem;
  width: 100%; max-width: 420px;
  box-shadow: 0 25px 60px rgba(0,0,0,0.5);
  position: relative; z-index: 1;
}
.login-logo {
  text-align: center; margin-bottom: 2rem;
}
.login-logo .logo-icon {
  width: 64px; height: 64px; border-radius: 18px; margin: 0 auto 1rem;
  background: linear-gradient(135deg, var(--green-500), var(--gold-500));
  display: flex; align-items: center; justify-content: center;
  font-size: 2rem; color: #fff;
}
.login-logo h1 {
  font-size: 1.5rem; font-weight: 800;
  background: linear-gradient(90deg, var(--green-400), var(--gold-400));
  -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text;
}
.login-logo p { color: #64748b; font-size: 0.8rem; margin-top: 0.25rem; }
.login-card label { color: #94a3b8; }
.login-card .form-control {
  background: rgba(255,255,255,0.06);
  border-color: rgba(255,255,255,0.1); color: #f1f5f9;
}
.login-card .form-control:focus { border-color: var(--green-500); }
.login-card .form-control::placeholder { color: #475569; }
.btn-login {
  width: 100%; padding: 0.75rem;
  background: linear-gradient(135deg, var(--green-600), var(--green-700));
  color: #fff; border: none; border-radius: var(--radius-sm);
  font-size: 0.95rem; font-weight: 700; cursor: pointer;
  transition: all var(--transition); margin-top: 0.5rem;
}
.btn-login:hover { background: linear-gradient(135deg, var(--green-500), var(--green-600)); transform: translateY(-1px); box-shadow: 0 6px 20px rgba(22,163,74,0.4); }

/* ---------- Ranking List ---------- */
.ranking-item {
  display: flex; align-items: center; gap: 0.75rem;
  padding: 0.75rem 0; border-bottom: 1px solid var(--border);
}
.ranking-item:last-child { border-bottom: none; }
.rank-num {
  width: 28px; height: 28px; border-radius: 8px;
  background: linear-gradient(135deg, var(--green-600), var(--gold-500));
  color: #fff; font-size: 0.75rem; font-weight: 800;
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.rank-info { flex: 1; }
.rank-info .rank-name { font-size: 0.85rem; font-weight: 600; }
.rank-info .rank-sub  { font-size: 0.72rem; color: var(--text-muted); }
.rank-pct { font-size: 1rem; font-weight: 800; color: var(--green-600); }

/* ---------- Notifikasi ---------- */
.notif-item {
  display: flex; gap: 0.75rem; padding: 0.875rem;
  border-bottom: 1px solid var(--border);
  transition: background var(--transition);
}
.notif-item:hover { background: rgba(34,197,94,0.04); }
.notif-item.unread { background: rgba(34,197,94,0.06); }
.notif-dot-indicator {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--green-500); margin-top: 5px; flex-shrink: 0;
}
.notif-item.unread .notif-dot-indicator { background: var(--gold-500); }
.notif-body .notif-title { font-size: 0.875rem; font-weight: 600; }
.notif-body .notif-msg   { font-size: 0.8rem; color: var(--text-muted); margin-top: 2px; }
.notif-body .notif-time  { font-size: 0.7rem; color: var(--text-muted); margin-top: 4px; }

/* ---------- KPI gauge bar ---------- */
.kpi-row {
  display: flex; align-items: center; gap: 0.75rem; padding: 0.625rem 0;
  border-bottom: 1px solid var(--border);
}
.kpi-row:last-child { border-bottom: none; }
.kpi-label { flex: 1; font-size: 0.8rem; font-weight: 500; }
.kpi-pct { font-size: 0.85rem; font-weight: 700; color: var(--green-600); min-width: 48px; text-align: right; }
.kpi-bar-wrap { width: 100px; }

/* ---------- Utilities ---------- */
.text-green  { color: var(--green-600); }
.text-gold   { color: var(--gold-500); }
.text-muted  { color: var(--text-muted); }
.text-sm     { font-size: 0.8rem; }
.fw-700      { font-weight: 700; }
.mt-1        { margin-top: 0.5rem; }
.mb-1        { margin-bottom: 0.5rem; }
.mb-2        { margin-bottom: 1rem; }
.gap-1       { gap: 0.5rem; }
.d-flex      { display: flex; }
.align-center{ align-items: center; }
.justify-between { justify-content: space-between; }
.w-100       { width: 100%; }

/* ---------- Animations ---------- */
@keyframes slideIn {
  from { opacity: 0; transform: translateY(-8px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes fadeIn {
  from { opacity: 0; } to { opacity: 1; }
}
.fade-in { animation: fadeIn 0.4s ease; }

/* ---------- Scrollbar ---------- */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(0,0,0,0.2); border-radius: 99px; }

/* ---------- Responsive ---------- */
@media (max-width: 768px) {
  .sidebar { transform: translateX(-100%); }
  .sidebar.open { transform: translateX(0); }
  .main-content { margin-left: 0; }
  .charts-grid { grid-template-columns: 1fr; }
  .form-row { grid-template-columns: 1fr; }
  .stats-grid { grid-template-columns: 1fr 1fr; }
}
