/* ============================================
   GLOBAL STYLE - Digunakan di semua halaman
   Theme variables added for consistent green/black theme
   ============================================ */

:root {
  --bg: #ffffff; /* background */
  --panel: #07120e; /* card / panel background */
  --panel-2: #0b1612; /* alternate panel */
  --muted: #9aa4ac;
  --text: #e6f9ef; /* main text */
  --accent: #18a34b; /* primary green */
  --accent-2: #0e7735; /* darker green */
  --glass: rgba(255,255,255,0.03);
}

/* RESET DASAR */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html, body {
  font-family: 'Poppins', sans-serif;
  color: var(--text);
  background-color: var(--bg);
  scroll-behavior: smooth;
  line-height: 1.6;
  font-size: 15px;
  font-weight: 400;
}

/* Ensure footer sits at the bottom without overlapping content
   Make body a column flex container and let main content grow */
html, body { 
  height: 100%; 
}
body { 
  display: flex; 
  flex-direction: column; 
  min-height: 100vh;
}

/* Main content areas should grow to push footer to bottom */
.dashboard-container,
.login-container,
main,
.main-content { 
  flex: 1; 
}

/* Ensure dashboard wraps with footer properly */
body.dashboard-admin,
body.dashboard-wisudawan {
  display: flex;
  flex-direction: column;
}

/* LINK & TEXT */
a {
  text-decoration: none;
  color: inherit;
}
a:hover {
  opacity: 0.85;
}

/* BUTTON STYLE */
button {
  font-family: inherit;
  border: none;
  outline: none;
  cursor: pointer;
  transition: 0.3s;
}

/* KONTENER UMUM */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
}

/* HEADER GLOBAL */
header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: linear-gradient(90deg, #1b5e20, #2e7d32);
  color: #ffffff;
  padding: 14px 20px;
  box-shadow: 0 4px 12px rgba(27,94,32,0.25);
  flex-shrink: 0;
}

header .logo {
  font-size: 20px;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 12px;
  color: #ffffff;
}

header nav {
  display: flex;
  gap: 25px;
}

header nav a {
  color: #ffffff;
  font-weight: 500;
  transition: 0.2s;
}

header nav a:hover {
  color: #86efac;
}

header .user-info {
  display: flex;
  align-items: center;
  gap: 15px;
}

header .user-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background-color: #e2e2e2;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: bold;
  color: #1b5e20;
}

header .user-name {
  color: #ffffff;
  font-weight: 600;
  font-size: 14px;
}

header small {
  color: #86efac;
  font-size: 12px;
}

/* JUDUL UTAMA */
h1, h2, h3, h4 {
  font-weight: 600;
  margin-bottom: 10px;
}

h1 {
  font-size: 32px;
  color: #1b5e20;
}

h2 {
  font-size: 24px;
  color: #1b5e20;
}

h3 {
  font-size: 18px;
}

/* TABLE GLOBAL */
table {
  width: 100%;
  border-collapse: collapse;
  background: linear-gradient(180deg, rgba(255,255,255,0.02), rgba(255,255,255,0.015));
  color: var(--text);
  border-radius: 8px;
  overflow: hidden;
}

th {
  background: rgba(16,140,73,0.12);
  color: var(--text);
  text-align: left;
  padding: 12px 15px;
  font-weight: 700;
}

td {
  padding: 12px 15px;
  border-bottom: 1px solid rgba(255,255,255,0.03);
}

tr:hover {
  background: rgba(255,255,255,0.01);
}

tr:nth-child(even) {
  background: rgba(255,255,255,0.01);
}

/* CARD DASAR */
.card {
  background: linear-gradient(180deg, var(--panel), var(--panel-2));
  color: var(--text);
  border-radius: 10px;
  box-shadow: 0 10px 30px rgba(2,6,23,0.6);
  padding: 20px;
  transition: transform 0.25s ease, box-shadow 0.25s ease;
  border: 1px solid rgba(255,255,255,0.03);
}

.card:hover {
  box-shadow: 0 16px 40px rgba(2,6,23,0.7);
  transform: translateY(-4px);
}

/* BUTTON KUSTOM */
.btn {
  padding: 10px 20px;
  border-radius: 6px;
  font-weight: 500;
  font-size: 14px;
  transition: 0.3s ease;
  cursor: pointer;
  border: none;
}

.btn-primary {
  background-color: #1b5e20;
  color: white;
}

.btn-primary:hover {
  background-color: #0d3a0a;
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(27, 94, 32, 0.3);
}

.btn-secondary {
  background-color: #ffc107;
  color: #1b5e20;
  font-weight: 600;
}

.btn-secondary:hover {
  background-color: #ffb300;
}

.btn-danger {
  background-color: #dc2626;
  color: white;
}

.btn-danger:hover {
  background-color: #b91c1c;
}

.btn-success {
  background-color: #00796b;
  color: white;
}

.btn-success:hover {
  background-color: #004d40;
}

.btn-sm {
  padding: 6px 12px;
  font-size: 12px;
}

/* FORM ELEMENTS */
input, textarea, select {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid #d1d5db;
  border-radius: 6px;
  font-family: inherit;
  font-size: 14px;
  transition: 0.3s;
}

input:focus, textarea:focus, select:focus {
  outline: none;
  border-color: #1b5e20;
  box-shadow: 0 0 0 3px rgba(27, 94, 32, 0.1);
}

label {
  display: block;
  margin-bottom: 6px;
  font-weight: 500;
  color: #374151;
}

.form-group {
  margin-bottom: 15px;
}

/* BADGE & LABEL */
.badge {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 600;
}

.badge-primary {
  background-color: #dcfce7;
  color: #166534;
}

.badge-success {
  background-color: #d1fae5;
  color: #047857;
}

.badge-warning {
  background-color: #fef3c7;
  color: #92400e;
}

.badge-danger {
  background-color: #fee2e2;
  color: #991b1b;
}

/* ALERT */
.alert {
  padding: 15px;
  border-radius: 6px;
  margin-bottom: 15px;
  border-left: 4px solid;
}

.alert-success {
  background-color: #dcfce7;
  color: #166534;
  border-left-color: #16a34a;
}

.alert-danger {
  background-color: #fee2e2;
  color: #991b1b;
  border-left-color: #dc2626;
}

.alert-warning {
  background-color: #fef3c7;
  color: #92400e;
  border-left-color: #f59e0b;
}

.alert-info {
  background-color: #dbeafe;
  color: #1e40af;
  border-left-color: #3b82f6;
}

/* GRID & LAYOUT */
.grid {
  display: grid;
  gap: 20px;
  margin-bottom: 20px;
}

.grid-2 {
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
}

.grid-3 {
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
}

.grid-4 {
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
}

.flex {
  display: flex;
  gap: 15px;
}

.flex-between {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.flex-center {
  display: flex;
  justify-content: center;
  align-items: center;
}

/* UTILITY CLASSES */
.mt-1 { margin-top: 10px; }
.mt-2 { margin-top: 20px; }
.mt-3 { margin-top: 30px; }

.mb-1 { margin-bottom: 10px; }
.mb-2 { margin-bottom: 20px; }
.mb-3 { margin-bottom: 30px; }

.p-1 { padding: 10px; }
.p-2 { padding: 20px; }
.p-3 { padding: 30px; }

.text-center { text-align: center; }
.text-right { text-align: right; }
.text-muted { color: #a3a3a3; }
.text-success { color: #16a34a; }
.text-danger { color: #dc2626; }

.shadow-sm { box-shadow: 0 1px 3px rgba(0,0,0,0.3); }
.shadow-md { box-shadow: 0 4px 6px rgba(0,0,0,0.3); }
.shadow-lg { box-shadow: 0 10px 15px rgba(0,0,0,0.3); }

.rounded { border-radius: 6px; }
.rounded-lg { border-radius: 10px; }
.rounded-full { border-radius: 9999px; }

.hidden { display: none !important; }

/* SITE FOOTER (applies to all pages) */
.site-footer {
  margin-top: auto;
  padding: 24px 20px;
  text-align: center;
  background: #ffffff;
  border-top: 2px solid #e5e7eb;
  color: #6b7280;
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.3px;
  width: 100%;
  box-shadow: 0 -2px 8px rgba(2,6,23,0.04);
}
.site-footer small { 
  display: inline-block; 
  opacity: 0.9;
  font-size: 13px;
}

/* RESPONSIVE */
@media (max-width: 768px) {
  header {
    flex-direction: column;
    gap: 15px;
  }


/* ---------- CLEAN BACKGROUNDS ---------- */
/* Dashboard backgrounds handled by individual dashboard CSS files */

  header nav {
    width: 100%;
    flex-wrap: wrap;
    justify-content: center;
  }

  .grid-2,
  .grid-3,
  .grid-4 {
    grid-template-columns: 1fr;
  }

  h1 {
    font-size: 24px;
  }

  h2 {
    font-size: 20px;
  }

  .container {
    padding: 0 15px;
  }
}
