:root {
  --bg-primary: #0a0e1a;
  --bg-secondary: #111827;
  --bg-card: rgba(17, 24, 39, 0.8);
  --bg-card-solid: #1f2937;
  --bg-input: #1f2937;
  --border-color: rgba(255, 255, 255, 0.08);
  --border-focus: #3b82f6;
  --color-primary: #3b82f6;
  --color-primary-dark: #2563eb;
  --color-primary-light: #60a5fa;
  --color-accent: #f59e0b;
  --color-success: #22c55e;
  --color-danger: #ef4444;
  --color-warning: #f59e0b;
  --color-info: #06b6d4;
  --text-primary: #f1f5f9;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;
  --gradient-primary: linear-gradient(135deg, #3b82f6, #2563eb);
  --gradient-accent: linear-gradient(135deg, #f59e0b, #d97706);
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 8px 30px rgba(0, 0, 0, 0.5);
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --sidebar-width: 280px;
}

/* 1. RESET */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}
html {
  scroll-behavior: smooth;
}
ul, ol {
  list-style: none;
}

/* 2. BASE */
body {
  background: var(--bg-primary);
  color: var(--text-primary);
  font-family: 'Inter', sans-serif;
  line-height: 1.6;
}
h1, h2, h3, h4, h5, h6 {
  font-family: 'Outfit', sans-serif;
}
a {
  text-decoration: none;
}

/* 3. LOGIN PAGE */
#login-page {
  width: 100%;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(-45deg, #0a0e1a, #111827, #1e3a5f, #0f172a);
  background-size: 400% 400%;
  animation: gradientBG 15s ease infinite;
}
.login-card {
  backdrop-filter: blur(20px);
  background: rgba(17, 24, 39, 0.85);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 20px;
  max-width: 440px;
  width: 100%;
  padding: 3rem;
  box-shadow: var(--shadow-lg);
}
.login-logo {
  text-align: center;
  margin-bottom: 2rem;
}
.login-logo h1 {
  font-family: 'Outfit', sans-serif;
  font-size: 3rem;
  margin-bottom: 0.5rem;
}
.login-logo h1 .accent {
  color: var(--color-accent);
}
.login-logo .subtitle {
  color: var(--text-secondary);
  font-size: 1rem;
}
.login-logo .muted {
  color: var(--text-muted);
  font-size: 0.85rem;
  margin-top: 0.25rem;
}
.login-btn {
  width: 100%;
  background: var(--gradient-primary);
  padding: 0.875rem;
  color: white;
  border: none;
  border-radius: var(--radius-sm);
  font-size: 1rem;
  font-weight: 500;
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s;
  font-family: 'Inter', sans-serif;
}
.login-btn:hover {
  transform: scale(1.02);
  box-shadow: var(--shadow-md);
}
.login-error {
  color: var(--color-danger);
  font-size: 0.85rem;
  margin-bottom: 1rem;
  display: none;
}
.login-footer {
  text-align: center;
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 2rem;
}

/* 4. APP LAYOUT */
.app-layout {
  display: flex;
  min-height: 100vh;
}
.sidebar {
  position: fixed;
  left: 0;
  top: 0;
  bottom: 0;
  width: var(--sidebar-width);
  background: var(--bg-secondary);
  z-index: 100;
  display: flex;
  flex-direction: column;
  border-right: 1px solid var(--border-color);
  overflow-y: auto;
  transition: transform 0.3s ease;
}
.main-content {
  margin-left: var(--sidebar-width);
  flex: 1;
  padding: 2rem;
  min-height: 100vh;
}

/* 5. SIDEBAR */
.sidebar-header {
  padding: 1.5rem;
  border-bottom: 1px solid var(--border-color);
}
.sidebar-logo {
  font-family: 'Outfit', sans-serif;
  font-size: 1.5rem;
  font-weight: bold;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.sidebar-logo .accent {
  color: var(--color-accent);
}
.sidebar-proyek {
  padding: 0.75rem 1.5rem;
  background: rgba(59, 130, 246, 0.1);
  border-left: 3px solid var(--color-primary);
  margin: 0.5rem 1rem;
  border-radius: 0 8px 8px 0;
  font-size: 0.85rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.sidebar-nav {
  flex: 1;
  padding: 0.75rem;
}
.sidebar-section {
  margin-bottom: 0.5rem;
}
.sidebar-section-title {
  text-transform: uppercase;
  font-size: 0.7rem;
  letter-spacing: 0.1em;
  color: var(--text-muted);
  padding: 0.75rem 1rem 0.25rem;
  font-weight: 600;
}
.sidebar-link {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.7rem 1rem;
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  text-decoration: none;
  transition: all 0.2s;
  cursor: pointer;
  font-size: 0.9rem;
}
.sidebar-link:hover {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-primary);
}
.sidebar-link.active {
  background: var(--gradient-primary);
  color: white;
  font-weight: 500;
  box-shadow: var(--shadow-sm);
}
.sidebar-link i {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
}
.sidebar-footer {
  padding: 1rem 1.5rem;
  border-top: 1px solid var(--border-color);
  margin-top: auto;
}
.sidebar-user {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 0;
  margin-bottom: 0.5rem;
}
.sidebar-user .user-name {
  font-weight: 600;
  font-size: 0.9rem;
}
.sidebar-user .user-role {
  font-size: 0.75rem;
  color: var(--text-muted);
}
.sidebar-link.logout {
  color: var(--color-danger);
}
.sidebar-link.logout:hover {
  background: rgba(239, 68, 68, 0.1);
}

/* 6. CARDS */
.card {
  background: var(--bg-card);
  backdrop-filter: blur(20px);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: all 0.3s;
}
.card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--border-color);
}
.card-title {
  font-family: 'Outfit', sans-serif;
  font-weight: 600;
  font-size: 1.1rem;
}
.card-body {
  padding: 1.5rem;
}

/* 7. STATS */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1.5rem;
  margin-bottom: 2rem;
}
.stat-card {
  display: flex;
  align-items: center;
  padding: 1.5rem;
  gap: 1.25rem;
}
.stat-icon {
  width: 56px;
  height: 56px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.stat-icon.primary { background: rgba(59, 130, 246, 0.15); color: var(--color-primary); }
.stat-icon.success { background: rgba(34, 197, 94, 0.15); color: var(--color-success); }
.stat-icon.warning { background: rgba(245, 158, 11, 0.15); color: var(--color-warning); }
.stat-icon.danger { background: rgba(239, 68, 68, 0.15); color: var(--color-danger); }
.stat-value {
  font-family: 'Outfit', sans-serif;
  font-size: 2rem;
  font-weight: 700;
}
.stat-label {
  color: var(--text-secondary);
  font-size: 0.85rem;
}

/* 8. CATEGORY */
.kategori-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.5rem;
}
.kategori-card {
  cursor: pointer;
  padding: 2rem;
  text-align: center;
  transition: all 0.3s;
}
.kategori-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
  border-color: var(--color-primary);
}
.kategori-card i {
  margin-bottom: 1rem;
  color: var(--color-primary);
  width: 48px;
  height: 48px;
}
.kategori-card h3 {
  margin-bottom: 0.5rem;
  font-family: 'Outfit', sans-serif;
}
.kategori-card p {
  color: var(--text-secondary);
  font-size: 0.9rem;
}

/* 9. BUTTONS */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.625rem 1.25rem;
  border-radius: var(--radius-sm);
  font-weight: 500;
  font-size: 0.9rem;
  cursor: pointer;
  transition: all 0.2s;
  border: none;
  font-family: 'Inter', sans-serif;
}
.btn-primary {
  background: var(--gradient-primary);
  color: white;
}
.btn-primary:hover {
  box-shadow: var(--shadow-md);
  opacity: 0.9;
}
.btn-secondary {
  background: transparent;
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
}
.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-primary);
}
.btn-danger {
  background: var(--color-danger);
  color: white;
}
.btn-success {
  background: var(--color-success);
  color: white;
}
.btn-warning {
  background: var(--color-warning);
  color: #000;
}
.btn-sm {
  padding: 0.375rem 0.75rem;
  font-size: 0.8rem;
}
.btn-lg {
  padding: 0.875rem 2rem;
  font-size: 1rem;
}
.btn-icon {
  padding: 0.5rem;
  width: auto;
  height: auto;
}

/* 10. FORMS */
.form-group {
  margin-bottom: 1.25rem;
}
.form-label {
  display: block;
  margin-bottom: 0.5rem;
  color: var(--text-secondary);
  font-weight: 500;
  font-size: 0.875rem;
}
.form-input, .form-select, .form-textarea {
  width: 100%;
  padding: 0.75rem 1rem;
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-family: 'Inter', sans-serif;
  font-size: 0.9rem;
  transition: all 0.2s;
  outline: none;
}
.form-input:focus, .form-select:focus, .form-textarea:focus {
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15);
}
.form-select {
  appearance: none;
  background-image: url('data:image/svg+xml;charset=US-ASCII,<svg width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="%2394a3b8" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><polyline points="6 9 12 15 18 9"></polyline></svg>');
  background-repeat: no-repeat;
  background-position: right 1rem center;
  background-size: 1.2em;
}
.form-row {
  display: flex;
  gap: 1rem;
}
.form-row > .form-group {
  flex: 1;
}
.form-actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.75rem;
  margin-top: 1.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border-color);
}

/* 11. TABLES */
.table-container {
  overflow-x: auto;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
}
.data-table {
  width: 100%;
  border-collapse: collapse;
  white-space: nowrap;
}
.data-table th {
  padding: 0.875rem 1rem;
  background: var(--bg-secondary);
  color: var(--text-secondary);
  font-weight: 600;
  text-align: left;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  border-bottom: 2px solid var(--border-color);
}
.data-table td {
  padding: 0.875rem 1rem;
  border-bottom: 1px solid var(--border-color);
  font-size: 0.875rem;
}
.data-table tbody tr {
  transition: all 0.2s;
}
.data-table tbody tr:hover {
  background: rgba(59, 130, 246, 0.04);
}
.table-actions {
  display: flex;
  gap: 0.375rem;
}

/* 12. TABS */
.tab-nav {
  display: flex;
  border-bottom: 2px solid var(--border-color);
  margin-bottom: 1.5rem;
  gap: 0.25rem;
  overflow-x: auto;
}
.tab-btn {
  padding: 0.75rem 1.5rem;
  background: transparent;
  border: none;
  color: var(--text-secondary);
  cursor: pointer;
  font-weight: 500;
  font-size: 0.9rem;
  border-bottom: 3px solid transparent;
  transition: all 0.2s;
  white-space: nowrap;
}
.tab-btn.active {
  color: var(--color-primary);
  border-bottom-color: var(--color-primary);
}
.tab-btn:hover {
  color: var(--text-primary);
}
.tab-pane {
  display: none;
}
.tab-pane.active {
  display: block;
}

/* 13. BADGES */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 0.25rem 0.75rem;
  border-radius: 9999px;
  font-size: 0.75rem;
  font-weight: 600;
}
.badge-success { background: rgba(34, 197, 94, 0.15); color: #22c55e; }
.badge-danger { background: rgba(239, 68, 68, 0.15); color: #ef4444; }
.badge-warning { background: rgba(245, 158, 11, 0.15); color: #f59e0b; }
.badge-info { background: rgba(6, 182, 212, 0.15); color: #06b6d4; }

/* 14. MODAL */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem;
  animation: fadeIn 0.2s;
}
.modal-container {
  background: var(--bg-card-solid);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-color);
  width: 90%;
  max-height: 85vh;
  overflow-y: auto;
  animation: slideUp 0.3s ease-out;
}
.modal-sm { max-width: 420px; }
.modal-md { max-width: 600px; }
.modal-lg { max-width: 900px; }
.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--border-color);
}
.modal-title {
  font-family: 'Outfit', sans-serif;
  font-weight: 600;
  font-size: 1.1rem;
}
.modal-body {
  padding: 1.5rem;
}
.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 0.75rem;
  padding: 1.25rem 1.5rem;
  border-top: 1px solid var(--border-color);
}

/* 15. TOAST */
.toast-container {
  position: fixed;
  top: 1.5rem;
  right: 1.5rem;
  z-index: 2000;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  pointer-events: none;
}
.toast {
  pointer-events: auto;
  padding: 1rem 1.5rem;
  border-radius: var(--radius-sm);
  min-width: 320px;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  animation: slideInRight 0.3s;
  box-shadow: var(--shadow-lg);
  font-size: 0.9rem;
}
.toast-success { background: #065f46; border-left: 4px solid #22c55e; color: #d1fae5; }
.toast-error { background: #7f1d1d; border-left: 4px solid #ef4444; color: #fecaca; }
.toast-warning { background: #78350f; border-left: 4px solid #f59e0b; color: #fef3c7; }
.toast-info { background: #164e63; border-left: 4px solid #06b6d4; color: #cffafe; }

/* 16. EMPTY STATE */
.empty-state {
  text-align: center;
  padding: 4rem 2rem;
  color: var(--text-muted);
}
.empty-state svg {
  margin-bottom: 1rem;
  opacity: 0.3;
  width: 64px;
  height: 64px;
}
.empty-state h3 {
  margin-bottom: 0.5rem;
  color: var(--text-secondary);
}
.empty-state p {
  font-size: 0.9rem;
}

/* 17. PAGE */
.page-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 2rem;
  flex-wrap: wrap;
  gap: 1rem;
}
.page-title {
  font-family: 'Outfit', sans-serif;
  font-size: 1.75rem;
  font-weight: 700;
}
.breadcrumb {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--text-muted);
  font-size: 0.85rem;
  margin-top: 0.25rem;
}
.breadcrumb span.separator {
  color: var(--text-muted);
}

/* 18. DOWNLOAD */
.download-section {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.5rem;
}
.download-card {
  padding: 2rem;
  text-align: center;
  cursor: pointer;
  transition: all 0.3s;
}
.download-card:hover {
  border-color: var(--color-primary);
  transform: translateY(-3px);
  box-shadow: var(--shadow-lg);
}
.download-card svg {
  margin-bottom: 1rem;
  color: var(--color-primary);
  width: 48px;
  height: 48px;
}
.download-card h3 {
  margin-bottom: 0.5rem;
  font-family: 'Outfit', sans-serif;
}
.download-card p {
  color: var(--text-secondary);
  font-size: 0.85rem;
}

/* 19. PROYEK */
.proyek-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.5rem;
}
.proyek-card {
  padding: 1.5rem;
  cursor: pointer;
  transition: all 0.3s;
}
.proyek-card:hover {
  border-color: var(--color-primary);
  transform: translateY(-2px);
}
.proyek-card.selected {
  border-color: var(--color-primary);
  background: rgba(59, 130, 246, 0.08);
}
.proyek-card h3 {
  margin-bottom: 0.25rem;
}
.proyek-card p {
  color: var(--text-secondary);
  font-size: 0.85rem;
}
.proyek-card .proyek-meta {
  display: flex;
  gap: 1rem;
  margin-top: 0.75rem;
  font-size: 0.8rem;
  color: var(--text-muted);
}

/* 20. ANIMATIONS */
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes slideUp { from { transform: translateY(20px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }
@keyframes slideInRight { from { transform: translateX(100px); opacity: 0; } to { transform: translateX(0); opacity: 1; } }
@keyframes gradientBG {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}
.fade-in { animation: fadeIn 0.4s ease-out; }
.slide-up { animation: slideUp 0.4s ease-out; }
@keyframes shake {
  0%, 100% { transform: translateX(0); }
  10%, 30%, 50%, 70%, 90% { transform: translateX(-5px); }
  20%, 40%, 60%, 80% { transform: translateX(5px); }
}
.shake { animation: shake 0.5s ease-in-out; }

/* 21. FILTER */
.filter-row {
  display: flex;
  gap: 1rem;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
  align-items: flex-end;
}

/* 22. SCROLLBAR */
::-webkit-scrollbar {
  width: 6px;
}
::-webkit-scrollbar-track {
  background: var(--bg-primary);
}
::-webkit-scrollbar-thumb {
  background: var(--text-muted);
  border-radius: 3px;
}
::-webkit-scrollbar-thumb:hover {
  background: var(--text-secondary);
}

/* 23. RESPONSIVE */
@media (max-width: 768px) {
  .sidebar {
    transform: translateX(-100%);
    position: fixed;
  }
  .sidebar.open {
    transform: translateX(0);
  }
  .main-content {
    margin-left: 0;
    padding: 1rem;
  }
  .form-row {
    flex-direction: column;
  }
  .stats-grid, .kategori-grid {
    grid-template-columns: 1fr;
  }
  .page-header {
    flex-direction: column;
    align-items: flex-start;
  }
  .mobile-toggle {
    display: block;
  }
}
.mobile-toggle {
  display: none;
  position: fixed;
  top: 1rem;
  left: 1rem;
  z-index: 101;
}

/* 24. INPUT FORM TABLE */
.input-table {
  width: 100%;
  border-collapse: collapse;
}
.input-table th {
  padding: 0.5rem;
  background: var(--bg-secondary);
  font-size: 0.8rem;
  text-transform: uppercase;
}
.input-table td {
  padding: 0.375rem;
}
.input-table input {
  width: 100%;
  padding: 0.5rem;
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: 4px;
  color: var(--text-primary);
  font-size: 0.85rem;
}

/* 25. Misc */
.text-center { text-align: center; }
.text-right { text-align: right; }
.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }
.gap-1 { gap: 0.5rem; }
.d-flex { display: flex; }
.align-center { align-items: center; }
.justify-between { justify-content: space-between; }
