/* ============================================
   SMAD - Sistem Manajemen Aset Daerah
   Design System & Main Stylesheet
   ============================================ */

/* Google Fonts Import */
@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700;800&family=Source+Sans+3:ital,wght@0,300;0,400;0,500;0,600;0,700;1,400&display=swap');

/* ============================================
   CSS Variables / Design Tokens
   ============================================ */
:root {
  /* Primary Colors */
  --navy-900: #0d1520;
  --navy-800: #1a2a4a;
  --navy-700: #243656;
  --navy-600: #2e4266;
  --navy-500: #3d5a80;
  --navy-400: #5c7a9e;
  --navy-300: #8ba3bf;
  --navy-200: #b8c9db;
  --navy-100: #e5eaf0;
  --navy-50: #f4f6f9;

  /* Accent - Warm Gold */
  --gold-600: #9a7a1a;
  --gold-500: #c9a227;
  --gold-400: #d4b44a;
  --gold-300: #e0c76d;
  --gold-200: #ebda90;
  --gold-100: #f5ecb3;
  --gold-50: #faf6d6;

  /* Semantic Colors */
  --success-600: #0d7a4a;
  --success-500: #10a563;
  --success-100: #d4f5e4;
  --success-50: #ecfbf3;

  --warning-600: #b35c00;
  --warning-500: #e07800;
  --warning-100: #ffebcc;
  --warning-50: #fff8ee;

  --danger-600: #b82a3d;
  --danger-500: #dc3545;
  --danger-100: #fbd5d9;
  --danger-50: #fdf2f3;

  --info-600: #0070b8;
  --info-500: #0088e0;
  --info-100: #d0ebff;
  --info-50: #ebf6ff;

  /* Neutral Grays */
  --gray-900: #1a1d21;
  --gray-800: #2d3239;
  --gray-700: #404650;
  --gray-600: #5a6270;
  --gray-500: #747e8c;
  --gray-400: #9aa2ae;
  --gray-300: #c0c6cf;
  --gray-200: #e0e4e9;
  --gray-100: #f0f2f5;
  --gray-50: #f8f9fa;
  --white: #ffffff;

  /* Typography */
  --font-display: 'Outfit', sans-serif;
  --font-body: 'Source Sans 3', sans-serif;

  /* Font Sizes */
  --text-xs: 0.75rem;
  --text-sm: 0.875rem;
  --text-base: 1rem;
  --text-lg: 1.125rem;
  --text-xl: 1.25rem;
  --text-2xl: 1.5rem;
  --text-3xl: 1.875rem;
  --text-4xl: 2.25rem;
  --text-5xl: 3rem;

  /* Font Weights */
  --font-light: 300;
  --font-regular: 400;
  --font-medium: 500;
  --font-semibold: 600;
  --font-bold: 700;
  --font-extrabold: 800;

  /* Spacing */
  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-4: 1rem;
  --space-5: 1.25rem;
  --space-6: 1.5rem;
  --space-8: 2rem;
  --space-10: 2.5rem;
  --space-12: 3rem;
  --space-16: 4rem;
  --space-20: 5rem;
  --space-24: 6rem;

  /* Border Radius */
  --radius-sm: 4px;
  --radius-md: 8px;
  --radius-lg: 12px;
  --radius-xl: 16px;
  --radius-2xl: 24px;
  --radius-full: 9999px;

  /* Shadows */
  --shadow-xs: 0 1px 2px rgba(13, 21, 32, 0.05);
  --shadow-sm: 0 1px 3px rgba(13, 21, 32, 0.08), 0 1px 2px rgba(13, 21, 32, 0.06);
  --shadow-md: 0 4px 6px -1px rgba(13, 21, 32, 0.08), 0 2px 4px -1px rgba(13, 21, 32, 0.04);
  --shadow-lg: 0 10px 15px -3px rgba(13, 21, 32, 0.1), 0 4px 6px -2px rgba(13, 21, 32, 0.05);
  --shadow-xl: 0 20px 25px -5px rgba(13, 21, 32, 0.12), 0 10px 10px -5px rgba(13, 21, 32, 0.04);
  --shadow-2xl: 0 25px 50px -12px rgba(13, 21, 32, 0.2);
  --shadow-inner: inset 0 2px 4px rgba(13, 21, 32, 0.06);
  --shadow-glow-gold: 0 0 20px rgba(201, 162, 39, 0.3);

  /* Transitions */
  --transition-fast: 150ms ease;
  --transition-base: 250ms ease;
  --transition-slow: 350ms ease;
  --transition-slower: 500ms ease;

  /* Z-Index Scale */
  --z-dropdown: 100;
  --z-sticky: 200;
  --z-fixed: 300;
  --z-modal-backdrop: 400;
  --z-modal: 500;
  --z-popover: 600;
  --z-tooltip: 700;

  /* Layout */
  --sidebar-width: 280px;
  --sidebar-collapsed-width: 80px;
  --header-height: 72px;
  --content-max-width: 1600px;
}

/* ============================================
   Reset & Base Styles
   ============================================ */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: var(--font-body);
  font-size: var(--text-base);
  font-weight: var(--font-regular);
  line-height: 1.6;
  color: var(--gray-800);
  background-color: var(--gray-50);
  min-height: 100vh;
}

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-display);
  font-weight: var(--font-semibold);
  line-height: 1.3;
  color: var(--navy-800);
}

h1 { font-size: var(--text-4xl); }
h2 { font-size: var(--text-3xl); }
h3 { font-size: var(--text-2xl); }
h4 { font-size: var(--text-xl); }
h5 { font-size: var(--text-lg); }
h6 { font-size: var(--text-base); }

p {
  margin-bottom: var(--space-4);
}

a {
  color: var(--navy-600);
  text-decoration: none;
  transition: color var(--transition-fast);
}

a:hover {
  color: var(--gold-500);
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

button {
  font-family: inherit;
  cursor: pointer;
}

input, select, textarea {
  font-family: inherit;
  font-size: inherit;
}

ul, ol {
  list-style: none;
}

/* ============================================
   Utility Classes
   ============================================ */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.text-center { text-align: center; }
.text-left { text-align: left; }
.text-right { text-align: right; }

.font-display { font-family: var(--font-display); }
.font-body { font-family: var(--font-body); }

.text-gold { color: var(--gold-500); }
.text-navy { color: var(--navy-800); }
.text-muted { color: var(--gray-500); }
.text-success { color: var(--success-500); }
.text-warning { color: var(--warning-500); }
.text-danger { color: var(--danger-500); }

.bg-gold { background-color: var(--gold-500); }
.bg-navy { background-color: var(--navy-800); }

.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.justify-center { justify-content: center; }
.justify-between { justify-content: space-between; }
.gap-1 { gap: var(--space-1); }
.gap-2 { gap: var(--space-2); }
.gap-3 { gap: var(--space-3); }
.gap-4 { gap: var(--space-4); }
.gap-6 { gap: var(--space-6); }
.gap-8 { gap: var(--space-8); }

.grid { display: grid; }
.grid-cols-2 { grid-template-columns: repeat(2, 1fr); }
.grid-cols-3 { grid-template-columns: repeat(3, 1fr); }
.grid-cols-4 { grid-template-columns: repeat(4, 1fr); }

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

/* Sidebar */
.sidebar {
  position: fixed;
  left: 0;
  top: 0;
  width: var(--sidebar-width);
  height: 100vh;
  background: linear-gradient(180deg, var(--navy-900) 0%, var(--navy-800) 100%);
  color: var(--white);
  display: flex;
  flex-direction: column;
  z-index: var(--z-fixed);
  overflow: hidden;
}

.sidebar::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.02'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
  pointer-events: none;
}

.sidebar-header {
  padding: var(--space-6);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  position: relative;
}

.sidebar-logo {
  display: flex;
  align-items: center;
  gap: var(--space-3);
}

.sidebar-logo-icon {
  width: 48px;
  height: 48px;
  background: linear-gradient(135deg, var(--gold-500) 0%, var(--gold-600) 100%);
  border-radius: var(--radius-lg);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-weight: var(--font-extrabold);
  font-size: var(--text-xl);
  color: var(--navy-900);
  box-shadow: var(--shadow-glow-gold);
}

.sidebar-logo-text {
  display: flex;
  flex-direction: column;
}

.sidebar-logo-title {
  font-family: var(--font-display);
  font-size: var(--text-xl);
  font-weight: var(--font-bold);
  letter-spacing: 0.5px;
  color: var(--white);
}

.sidebar-logo-subtitle {
  font-size: var(--text-xs);
  color: var(--navy-300);
  text-transform: uppercase;
  letter-spacing: 1.5px;
}

.sidebar-nav {
  flex: 1;
  padding: var(--space-4) 0;
  overflow-y: auto;
  position: relative;
}

.sidebar-nav::-webkit-scrollbar {
  width: 4px;
}

.sidebar-nav::-webkit-scrollbar-track {
  background: transparent;
}

.sidebar-nav::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.2);
  border-radius: var(--radius-full);
}

.nav-section {
  margin-bottom: var(--space-6);
}

.nav-section-title {
  padding: var(--space-2) var(--space-6);
  font-size: var(--text-xs);
  font-weight: var(--font-semibold);
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: var(--navy-400);
}

.nav-item {
  position: relative;
}

.nav-link {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-6);
  color: var(--navy-200);
  font-size: var(--text-sm);
  font-weight: var(--font-medium);
  transition: all var(--transition-fast);
  position: relative;
  overflow: hidden;
}

.nav-link::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 3px;
  background: var(--gold-500);
  transform: scaleY(0);
  transition: transform var(--transition-fast);
}

.nav-link:hover {
  color: var(--white);
  background: rgba(255, 255, 255, 0.05);
}

.nav-link:hover::before {
  transform: scaleY(1);
}

.nav-link.active {
  color: var(--white);
  background: rgba(201, 162, 39, 0.1);
}

.nav-link.active::before {
  transform: scaleY(1);
}

.nav-icon {
  width: 20px;
  height: 20px;
  opacity: 0.8;
  flex-shrink: 0;
}

.nav-link:hover .nav-icon,
.nav-link.active .nav-icon {
  opacity: 1;
}

.nav-badge {
  margin-left: auto;
  padding: var(--space-1) var(--space-2);
  font-size: var(--text-xs);
  font-weight: var(--font-semibold);
  border-radius: var(--radius-full);
  background: var(--danger-500);
  color: var(--white);
}

.sidebar-footer {
  padding: var(--space-4) var(--space-6);
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  position: relative;
}

.sidebar-user {
  display: flex;
  align-items: center;
  gap: var(--space-3);
}

.sidebar-user-avatar {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-full);
  background: linear-gradient(135deg, var(--navy-500) 0%, var(--navy-600) 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-weight: var(--font-semibold);
  color: var(--white);
  border: 2px solid rgba(255, 255, 255, 0.1);
}

.sidebar-user-info {
  flex: 1;
  min-width: 0;
}

.sidebar-user-name {
  font-size: var(--text-sm);
  font-weight: var(--font-semibold);
  color: var(--white);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sidebar-user-role {
  font-size: var(--text-xs);
  color: var(--navy-400);
}

/* Main Content */
.main-content {
  flex: 1;
  margin-left: var(--sidebar-width);
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* Header */
.header {
  height: var(--header-height);
  background: var(--white);
  border-bottom: 1px solid var(--gray-200);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 var(--space-8);
  position: sticky;
  top: 0;
  z-index: var(--z-sticky);
}

.header-left {
  display: flex;
  align-items: center;
  gap: var(--space-6);
}

.header-title {
  font-family: var(--font-display);
  font-size: var(--text-xl);
  font-weight: var(--font-semibold);
  color: var(--navy-800);
}

.header-breadcrumb {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  font-size: var(--text-sm);
  color: var(--gray-500);
}

.header-breadcrumb a {
  color: var(--gray-500);
}

.header-breadcrumb a:hover {
  color: var(--navy-600);
}

.header-breadcrumb-separator {
  color: var(--gray-300);
}

.header-breadcrumb-current {
  color: var(--navy-700);
  font-weight: var(--font-medium);
}

.header-right {
  display: flex;
  align-items: center;
  gap: var(--space-4);
}

.header-search {
  position: relative;
  width: 320px;
}

.header-search-input {
  width: 100%;
  padding: var(--space-2) var(--space-4) var(--space-2) var(--space-10);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-full);
  font-size: var(--text-sm);
  background: var(--gray-50);
  transition: all var(--transition-fast);
}

.header-search-input:focus {
  outline: none;
  border-color: var(--navy-400);
  background: var(--white);
  box-shadow: 0 0 0 3px rgba(26, 42, 74, 0.1);
}

.header-search-icon {
  position: absolute;
  left: var(--space-3);
  top: 50%;
  transform: translateY(-50%);
  width: 18px;
  height: 18px;
  color: var(--gray-400);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

.header-action-btn {
  position: relative;
  width: 40px;
  height: 40px;
  border: none;
  border-radius: var(--radius-lg);
  background: transparent;
  color: var(--gray-600);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition-fast);
}

.header-action-btn:hover {
  background: var(--gray-100);
  color: var(--navy-700);
}

.header-action-btn .badge {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 18px;
  height: 18px;
  border-radius: var(--radius-full);
  background: var(--danger-500);
  color: var(--white);
  font-size: 10px;
  font-weight: var(--font-bold);
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Content Area */
.content {
  flex: 1;
  padding: var(--space-8);
  max-width: var(--content-max-width);
}

/* Page Header */
.page-header {
  margin-bottom: var(--space-8);
  animation: fadeInUp 0.5s ease;
}

.page-header-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--space-4);
}

.page-title {
  font-size: var(--text-3xl);
  font-weight: var(--font-bold);
  color: var(--navy-800);
  margin-bottom: var(--space-2);
}

.page-subtitle {
  font-size: var(--text-base);
  color: var(--gray-500);
  max-width: 600px;
}

/* ============================================
   Components
   ============================================ */

/* Cards */
.card {
  background: var(--white);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--gray-100);
  overflow: hidden;
  transition: all var(--transition-base);
}

.card:hover {
  box-shadow: var(--shadow-md);
}

.card-header {
  padding: var(--space-5) var(--space-6);
  border-bottom: 1px solid var(--gray-100);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.card-title {
  font-family: var(--font-display);
  font-size: var(--text-lg);
  font-weight: var(--font-semibold);
  color: var(--navy-800);
}

.card-body {
  padding: var(--space-6);
}

.card-footer {
  padding: var(--space-4) var(--space-6);
  border-top: 1px solid var(--gray-100);
  background: var(--gray-50);
}

/* Stats Card */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--space-6);
  margin-bottom: var(--space-8);
}

.stat-card {
  background: var(--white);
  border-radius: var(--radius-xl);
  padding: var(--space-6);
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--gray-100);
  position: relative;
  overflow: hidden;
  animation: fadeInUp 0.5s ease backwards;
}

.stat-card:nth-child(1) { animation-delay: 0.1s; }
.stat-card:nth-child(2) { animation-delay: 0.15s; }
.stat-card:nth-child(3) { animation-delay: 0.2s; }
.stat-card:nth-child(4) { animation-delay: 0.25s; }

.stat-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
}

.stat-card.gold::before { background: linear-gradient(90deg, var(--gold-500), var(--gold-400)); }
.stat-card.navy::before { background: linear-gradient(90deg, var(--navy-600), var(--navy-500)); }
.stat-card.success::before { background: linear-gradient(90deg, var(--success-500), var(--success-600)); }
.stat-card.info::before { background: linear-gradient(90deg, var(--info-500), var(--info-600)); }

.stat-card-icon {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-lg);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: var(--space-4);
}

.stat-card.gold .stat-card-icon { background: var(--gold-50); color: var(--gold-600); }
.stat-card.navy .stat-card-icon { background: var(--navy-100); color: var(--navy-600); }
.stat-card.success .stat-card-icon { background: var(--success-50); color: var(--success-600); }
.stat-card.info .stat-card-icon { background: var(--info-50); color: var(--info-600); }

.stat-card-value {
  font-family: var(--font-display);
  font-size: var(--text-3xl);
  font-weight: var(--font-bold);
  color: var(--navy-800);
  margin-bottom: var(--space-1);
}

.stat-card-label {
  font-size: var(--text-sm);
  color: var(--gray-500);
  margin-bottom: var(--space-3);
}

.stat-card-change {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  font-size: var(--text-sm);
  font-weight: var(--font-medium);
  padding: var(--space-1) var(--space-2);
  border-radius: var(--radius-full);
}

.stat-card-change.positive {
  background: var(--success-50);
  color: var(--success-600);
}

.stat-card-change.negative {
  background: var(--danger-50);
  color: var(--danger-600);
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  padding: var(--space-3) var(--space-5);
  font-family: var(--font-display);
  font-size: var(--text-sm);
  font-weight: var(--font-semibold);
  border-radius: var(--radius-lg);
  border: none;
  cursor: pointer;
  transition: all var(--transition-fast);
  white-space: nowrap;
}

.btn-primary {
  background: linear-gradient(135deg, var(--navy-700) 0%, var(--navy-800) 100%);
  color: var(--white);
  box-shadow: var(--shadow-sm), inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

.btn-primary:hover {
  background: linear-gradient(135deg, var(--navy-600) 0%, var(--navy-700) 100%);
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}

.btn-gold {
  background: linear-gradient(135deg, var(--gold-500) 0%, var(--gold-600) 100%);
  color: var(--navy-900);
  box-shadow: var(--shadow-sm), inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

.btn-gold:hover {
  background: linear-gradient(135deg, var(--gold-400) 0%, var(--gold-500) 100%);
  transform: translateY(-1px);
  box-shadow: var(--shadow-md), var(--shadow-glow-gold);
}

.btn-outline {
  background: transparent;
  color: var(--navy-700);
  border: 1px solid var(--gray-300);
}

.btn-outline:hover {
  background: var(--gray-50);
  border-color: var(--navy-400);
}

.btn-ghost {
  background: transparent;
  color: var(--gray-600);
}

.btn-ghost:hover {
  background: var(--gray-100);
  color: var(--navy-700);
}

.btn-success {
  background: linear-gradient(135deg, var(--success-500) 0%, var(--success-600) 100%);
  color: var(--white);
}

.btn-danger {
  background: linear-gradient(135deg, var(--danger-500) 0%, var(--danger-600) 100%);
  color: var(--white);
}

.btn-sm {
  padding: var(--space-2) var(--space-3);
  font-size: var(--text-xs);
}

.btn-lg {
  padding: var(--space-4) var(--space-8);
  font-size: var(--text-base);
}

.btn-icon {
  width: 40px;
  height: 40px;
  padding: 0;
}

.btn-icon.btn-sm {
  width: 32px;
  height: 32px;
}

/* Form Elements */
.form-group {
  margin-bottom: var(--space-5);
}

.form-label {
  display: block;
  font-size: var(--text-sm);
  font-weight: var(--font-medium);
  color: var(--navy-700);
  margin-bottom: var(--space-2);
}

.form-label-required::after {
  content: '*';
  color: var(--danger-500);
  margin-left: var(--space-1);
}

.form-control {
  width: 100%;
  padding: var(--space-3) var(--space-4);
  font-size: var(--text-sm);
  color: var(--gray-800);
  background: var(--white);
  border: 1px solid var(--gray-300);
  border-radius: var(--radius-lg);
  transition: all var(--transition-fast);
}

.form-control:focus {
  outline: none;
  border-color: var(--navy-500);
  box-shadow: 0 0 0 3px rgba(26, 42, 74, 0.1);
}

.form-control::placeholder {
  color: var(--gray-400);
}

.form-control:disabled {
  background: var(--gray-100);
  cursor: not-allowed;
}

.form-select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%235a6270' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right var(--space-3) center;
  padding-right: var(--space-10);
}

.form-textarea {
  min-height: 120px;
  resize: vertical;
}

.form-hint {
  font-size: var(--text-xs);
  color: var(--gray-500);
  margin-top: var(--space-1);
}

.form-error {
  font-size: var(--text-xs);
  color: var(--danger-500);
  margin-top: var(--space-1);
}

.form-control.is-invalid {
  border-color: var(--danger-500);
}

.form-row {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--space-4);
}

.form-row-3 {
  grid-template-columns: repeat(3, 1fr);
}

/* Checkbox & Radio */
.form-check {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  cursor: pointer;
}

.form-check-input {
  width: 18px;
  height: 18px;
  border: 2px solid var(--gray-300);
  border-radius: var(--radius-sm);
  appearance: none;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.form-check-input:checked {
  background: var(--navy-600);
  border-color: var(--navy-600);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='20 6 9 17 4 12'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: center;
}

.form-check-input[type="radio"] {
  border-radius: var(--radius-full);
}

.form-check-input[type="radio"]:checked {
  background-image: none;
  box-shadow: inset 0 0 0 4px var(--white);
}

.form-check-label {
  font-size: var(--text-sm);
  color: var(--gray-700);
}

/* Tables */
.table-container {
  overflow-x: auto;
  border-radius: var(--radius-lg);
  border: 1px solid var(--gray-200);
}

.table {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--text-sm);
}

.table th {
  background: var(--gray-50);
  padding: var(--space-3) var(--space-4);
  text-align: left;
  font-family: var(--font-display);
  font-weight: var(--font-semibold);
  font-size: var(--text-xs);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--gray-600);
  border-bottom: 1px solid var(--gray-200);
  white-space: nowrap;
}

.table td {
  padding: var(--space-4);
  border-bottom: 1px solid var(--gray-100);
  vertical-align: middle;
}

.table tr:last-child td {
  border-bottom: none;
}

.table tbody tr {
  transition: background var(--transition-fast);
}

.table tbody tr:hover {
  background: var(--gray-50);
}

.table-checkbox {
  width: 40px;
}

.table-actions {
  width: 120px;
  text-align: right;
}

/* Status Badges */
.badge {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  padding: var(--space-1) var(--space-3);
  font-size: var(--text-xs);
  font-weight: var(--font-semibold);
  border-radius: var(--radius-full);
}

.badge-success {
  background: var(--success-100);
  color: var(--success-600);
}

.badge-warning {
  background: var(--warning-100);
  color: var(--warning-600);
}

.badge-danger {
  background: var(--danger-100);
  color: var(--danger-600);
}

.badge-info {
  background: var(--info-100);
  color: var(--info-600);
}

.badge-navy {
  background: var(--navy-100);
  color: var(--navy-700);
}

.badge-gold {
  background: var(--gold-100);
  color: var(--gold-600);
}

.badge-dot {
  width: 6px;
  height: 6px;
  border-radius: var(--radius-full);
  background: currentColor;
}

/* Tabs */
.tabs {
  display: flex;
  gap: var(--space-1);
  border-bottom: 1px solid var(--gray-200);
  margin-bottom: var(--space-6);
}

.tab {
  padding: var(--space-3) var(--space-5);
  font-family: var(--font-display);
  font-size: var(--text-sm);
  font-weight: var(--font-medium);
  color: var(--gray-500);
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  cursor: pointer;
  transition: all var(--transition-fast);
  margin-bottom: -1px;
}

.tab:hover {
  color: var(--navy-700);
}

.tab.active {
  color: var(--navy-700);
  border-bottom-color: var(--gold-500);
}

/* Pagination */
.pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: var(--space-4);
}

.pagination-info {
  font-size: var(--text-sm);
  color: var(--gray-500);
}

.pagination-pages {
  display: flex;
  align-items: center;
  gap: var(--space-1);
}

.pagination-btn {
  min-width: 36px;
  height: 36px;
  padding: 0 var(--space-3);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: var(--text-sm);
  font-weight: var(--font-medium);
  color: var(--gray-600);
  background: var(--white);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.pagination-btn:hover:not(:disabled) {
  background: var(--gray-50);
  border-color: var(--gray-300);
}

.pagination-btn.active {
  background: var(--navy-700);
  border-color: var(--navy-700);
  color: var(--white);
}

.pagination-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* Modals */
.modal-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(13, 21, 32, 0.6);
  backdrop-filter: blur(4px);
  z-index: var(--z-modal-backdrop);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-4);
  opacity: 0;
  visibility: hidden;
  transition: all var(--transition-base);
}

.modal-backdrop.active {
  opacity: 1;
  visibility: visible;
}

.modal {
  background: var(--white);
  border-radius: var(--radius-2xl);
  box-shadow: var(--shadow-2xl);
  width: 100%;
  max-width: 560px;
  max-height: calc(100vh - var(--space-8));
  overflow: hidden;
  transform: translateY(20px) scale(0.95);
  transition: transform var(--transition-base);
}

.modal-backdrop.active .modal {
  transform: translateY(0) scale(1);
}

.modal-lg {
  max-width: 800px;
}

.modal-xl {
  max-width: 1100px;
}

.modal-header {
  padding: var(--space-6);
  border-bottom: 1px solid var(--gray-100);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.modal-title {
  font-family: var(--font-display);
  font-size: var(--text-xl);
  font-weight: var(--font-semibold);
  color: var(--navy-800);
}

.modal-close {
  width: 36px;
  height: 36px;
  border: none;
  border-radius: var(--radius-lg);
  background: transparent;
  color: var(--gray-400);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition-fast);
}

.modal-close:hover {
  background: var(--gray-100);
  color: var(--gray-700);
}

.modal-body {
  padding: var(--space-6);
  overflow-y: auto;
  max-height: calc(100vh - 200px);
}

.modal-footer {
  padding: var(--space-4) var(--space-6);
  border-top: 1px solid var(--gray-100);
  background: var(--gray-50);
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: var(--space-3);
}

/* Alerts */
.alert {
  display: flex;
  gap: var(--space-3);
  padding: var(--space-4);
  border-radius: var(--radius-lg);
  margin-bottom: var(--space-4);
}

.alert-icon {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
}

.alert-content {
  flex: 1;
}

.alert-title {
  font-weight: var(--font-semibold);
  margin-bottom: var(--space-1);
}

.alert-text {
  font-size: var(--text-sm);
}

.alert-success {
  background: var(--success-50);
  border: 1px solid var(--success-100);
  color: var(--success-600);
}

.alert-warning {
  background: var(--warning-50);
  border: 1px solid var(--warning-100);
  color: var(--warning-600);
}

.alert-danger {
  background: var(--danger-50);
  border: 1px solid var(--danger-100);
  color: var(--danger-600);
}

.alert-info {
  background: var(--info-50);
  border: 1px solid var(--info-100);
  color: var(--info-600);
}

/* Empty State */
.empty-state {
  text-align: center;
  padding: var(--space-16) var(--space-8);
}

.empty-state-icon {
  width: 80px;
  height: 80px;
  margin: 0 auto var(--space-6);
  background: var(--gray-100);
  border-radius: var(--radius-2xl);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--gray-400);
}

.empty-state-title {
  font-family: var(--font-display);
  font-size: var(--text-xl);
  font-weight: var(--font-semibold);
  color: var(--navy-800);
  margin-bottom: var(--space-2);
}

.empty-state-text {
  color: var(--gray-500);
  max-width: 400px;
  margin: 0 auto var(--space-6);
}

/* Dropdown */
.dropdown {
  position: relative;
  display: inline-block;
}

.dropdown-menu {
  position: absolute;
  top: 100%;
  right: 0;
  min-width: 180px;
  background: var(--white);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--gray-100);
  padding: var(--space-2);
  margin-top: var(--space-2);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-8px);
  transition: all var(--transition-fast);
  z-index: var(--z-dropdown);
}

.dropdown.active .dropdown-menu {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.dropdown-item {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-2) var(--space-3);
  font-size: var(--text-sm);
  color: var(--gray-700);
  border-radius: var(--radius-md);
  transition: all var(--transition-fast);
  cursor: pointer;
}

.dropdown-item:hover {
  background: var(--gray-50);
  color: var(--navy-700);
}

.dropdown-item.danger {
  color: var(--danger-500);
}

.dropdown-item.danger:hover {
  background: var(--danger-50);
}

.dropdown-divider {
  height: 1px;
  background: var(--gray-100);
  margin: var(--space-2) 0;
}

/* Tooltip */
.tooltip {
  position: relative;
}

.tooltip::after {
  content: attr(data-tooltip);
  position: absolute;
  bottom: 100%;
  left: 50%;
  transform: translateX(-50%) translateY(-4px);
  padding: var(--space-1) var(--space-2);
  font-size: var(--text-xs);
  font-weight: var(--font-medium);
  color: var(--white);
  background: var(--gray-800);
  border-radius: var(--radius-md);
  white-space: nowrap;
  opacity: 0;
  visibility: hidden;
  transition: all var(--transition-fast);
  z-index: var(--z-tooltip);
}

.tooltip:hover::after {
  opacity: 1;
  visibility: visible;
  transform: translateX(-50%) translateY(-8px);
}

/* Progress Bar */
.progress {
  height: 8px;
  background: var(--gray-200);
  border-radius: var(--radius-full);
  overflow: hidden;
}

.progress-bar {
  height: 100%;
  border-radius: var(--radius-full);
  transition: width var(--transition-slow);
}

.progress-bar.gold { background: linear-gradient(90deg, var(--gold-500), var(--gold-400)); }
.progress-bar.navy { background: linear-gradient(90deg, var(--navy-600), var(--navy-500)); }
.progress-bar.success { background: linear-gradient(90deg, var(--success-500), var(--success-600)); }
.progress-bar.danger { background: linear-gradient(90deg, var(--danger-500), var(--danger-600)); }

/* Avatar */
.avatar {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-full);
  background: var(--navy-100);
  color: var(--navy-600);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-weight: var(--font-semibold);
  font-size: var(--text-sm);
}

.avatar-sm { width: 32px; height: 32px; font-size: var(--text-xs); }
.avatar-lg { width: 56px; height: 56px; font-size: var(--text-lg); }
.avatar-xl { width: 80px; height: 80px; font-size: var(--text-2xl); }

.avatar-group {
  display: flex;
}

.avatar-group .avatar {
  margin-left: -12px;
  border: 2px solid var(--white);
}

.avatar-group .avatar:first-child {
  margin-left: 0;
}

/* Timeline */
.timeline {
  position: relative;
  padding-left: var(--space-8);
}

.timeline::before {
  content: '';
  position: absolute;
  left: 11px;
  top: 8px;
  bottom: 8px;
  width: 2px;
  background: var(--gray-200);
}

.timeline-item {
  position: relative;
  padding-bottom: var(--space-6);
}

.timeline-item:last-child {
  padding-bottom: 0;
}

.timeline-dot {
  position: absolute;
  left: -29px;
  top: 4px;
  width: 12px;
  height: 12px;
  border-radius: var(--radius-full);
  background: var(--white);
  border: 2px solid var(--gray-300);
}

.timeline-item.active .timeline-dot {
  border-color: var(--gold-500);
  background: var(--gold-500);
}

.timeline-content {
  background: var(--gray-50);
  border-radius: var(--radius-lg);
  padding: var(--space-4);
}

.timeline-time {
  font-size: var(--text-xs);
  color: var(--gray-500);
  margin-bottom: var(--space-1);
}

.timeline-title {
  font-weight: var(--font-semibold);
  color: var(--navy-800);
  margin-bottom: var(--space-1);
}

.timeline-text {
  font-size: var(--text-sm);
  color: var(--gray-600);
}

/* Charts Placeholder */
.chart-container {
  position: relative;
  height: 300px;
  background: linear-gradient(135deg, var(--gray-50) 0%, var(--gray-100) 100%);
  border-radius: var(--radius-lg);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--gray-400);
}

/* Quick Stats Row */
.quick-stats {
  display: flex;
  gap: var(--space-8);
  padding: var(--space-4) 0;
}

.quick-stat {
  display: flex;
  align-items: center;
  gap: var(--space-3);
}

.quick-stat-icon {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
}

.quick-stat-value {
  font-family: var(--font-display);
  font-size: var(--text-lg);
  font-weight: var(--font-bold);
  color: var(--navy-800);
}

.quick-stat-label {
  font-size: var(--text-xs);
  color: var(--gray-500);
}

/* Data Cards Grid */
.data-cards-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-6);
}

/* Asset Card */
.asset-card {
  background: var(--white);
  border-radius: var(--radius-xl);
  border: 1px solid var(--gray-200);
  overflow: hidden;
  transition: all var(--transition-base);
}

.asset-card:hover {
  border-color: var(--gold-300);
  box-shadow: var(--shadow-md);
}

.asset-card-image {
  height: 160px;
  background: linear-gradient(135deg, var(--gray-100) 0%, var(--gray-200) 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--gray-400);
}

.asset-card-body {
  padding: var(--space-5);
}

.asset-card-code {
  font-size: var(--text-xs);
  font-family: monospace;
  color: var(--gold-600);
  background: var(--gold-50);
  padding: var(--space-1) var(--space-2);
  border-radius: var(--radius-sm);
  display: inline-block;
  margin-bottom: var(--space-2);
}

.asset-card-title {
  font-family: var(--font-display);
  font-size: var(--text-base);
  font-weight: var(--font-semibold);
  color: var(--navy-800);
  margin-bottom: var(--space-2);
}

.asset-card-meta {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  font-size: var(--text-sm);
  color: var(--gray-500);
  margin-bottom: var(--space-3);
}

.asset-card-value {
  font-family: var(--font-display);
  font-size: var(--text-lg);
  font-weight: var(--font-bold);
  color: var(--navy-800);
}

/* Filter Bar */
.filter-bar {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  padding: var(--space-4);
  background: var(--gray-50);
  border-radius: var(--radius-lg);
  margin-bottom: var(--space-6);
}

.filter-group {
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

.filter-label {
  font-size: var(--text-sm);
  font-weight: var(--font-medium);
  color: var(--gray-600);
}

.filter-select {
  padding: var(--space-2) var(--space-8) var(--space-2) var(--space-3);
  font-size: var(--text-sm);
  border: 1px solid var(--gray-300);
  border-radius: var(--radius-md);
  background: var(--white);
  min-width: 140px;
}

/* Dashboard Widgets */
.widget-grid {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: var(--space-6);
}

.widget-col-6 { grid-column: span 6; }
.widget-col-4 { grid-column: span 4; }
.widget-col-8 { grid-column: span 8; }
.widget-col-12 { grid-column: span 12; }

/* Alert List */
.alert-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.alert-list-item {
  display: flex;
  align-items: flex-start;
  gap: var(--space-3);
  padding: var(--space-3);
  background: var(--gray-50);
  border-radius: var(--radius-lg);
  border-left: 3px solid var(--gray-300);
  transition: all var(--transition-fast);
}

.alert-list-item:hover {
  background: var(--white);
  box-shadow: var(--shadow-sm);
}

.alert-list-item.warning {
  border-left-color: var(--warning-500);
  background: var(--warning-50);
}

.alert-list-item.danger {
  border-left-color: var(--danger-500);
  background: var(--danger-50);
}

.alert-list-item.info {
  border-left-color: var(--info-500);
  background: var(--info-50);
}

.alert-list-icon {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.alert-list-item.warning .alert-list-icon {
  background: var(--warning-100);
  color: var(--warning-600);
}

.alert-list-item.danger .alert-list-icon {
  background: var(--danger-100);
  color: var(--danger-600);
}

.alert-list-content {
  flex: 1;
  min-width: 0;
}

.alert-list-title {
  font-size: var(--text-sm);
  font-weight: var(--font-semibold);
  color: var(--navy-800);
  margin-bottom: var(--space-1);
}

.alert-list-text {
  font-size: var(--text-xs);
  color: var(--gray-600);
}

.alert-list-time {
  font-size: var(--text-xs);
  color: var(--gray-400);
  white-space: nowrap;
}

/* KIB Categories */
.kib-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: var(--space-4);
}

.kib-card {
  background: var(--white);
  border-radius: var(--radius-xl);
  padding: var(--space-5);
  text-align: center;
  border: 2px solid transparent;
  transition: all var(--transition-base);
  cursor: pointer;
}

.kib-card:hover {
  border-color: var(--gold-300);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.kib-card.active {
  border-color: var(--gold-500);
  background: var(--gold-50);
}

.kib-card-letter {
  width: 48px;
  height: 48px;
  margin: 0 auto var(--space-3);
  border-radius: var(--radius-lg);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-size: var(--text-2xl);
  font-weight: var(--font-bold);
}

.kib-card.kib-a .kib-card-letter { background: #fef3c7; color: #92400e; }
.kib-card.kib-b .kib-card-letter { background: #dbeafe; color: #1e40af; }
.kib-card.kib-c .kib-card-letter { background: #dcfce7; color: #166534; }
.kib-card.kib-d .kib-card-letter { background: #fce7f3; color: #9d174d; }
.kib-card.kib-e .kib-card-letter { background: #f3e8ff; color: #6b21a8; }
.kib-card.kib-f .kib-card-letter { background: #e0e7ff; color: #3730a3; }

.kib-card-title {
  font-family: var(--font-display);
  font-size: var(--text-sm);
  font-weight: var(--font-semibold);
  color: var(--navy-800);
  margin-bottom: var(--space-1);
}

.kib-card-count {
  font-size: var(--text-xs);
  color: var(--gray-500);
}

/* Integration Status Cards */
.integration-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-6);
}

.integration-card {
  background: var(--white);
  border-radius: var(--radius-xl);
  padding: var(--space-6);
  border: 1px solid var(--gray-200);
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.integration-icon {
  width: 64px;
  height: 64px;
  border-radius: var(--radius-xl);
  background: var(--gray-100);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: var(--space-4);
  font-size: var(--text-2xl);
}

.integration-name {
  font-family: var(--font-display);
  font-size: var(--text-lg);
  font-weight: var(--font-semibold);
  color: var(--navy-800);
  margin-bottom: var(--space-2);
}

.integration-desc {
  font-size: var(--text-sm);
  color: var(--gray-500);
  margin-bottom: var(--space-4);
}

.integration-status {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  font-size: var(--text-sm);
  font-weight: var(--font-medium);
}

.integration-status.connected {
  color: var(--success-600);
}

.integration-status.disconnected {
  color: var(--gray-400);
}

.integration-status-dot {
  width: 8px;
  height: 8px;
  border-radius: var(--radius-full);
  background: currentColor;
}

/* User Management Table Row */
.user-cell {
  display: flex;
  align-items: center;
  gap: var(--space-3);
}

.user-cell-info {
  min-width: 0;
}

.user-cell-name {
  font-weight: var(--font-medium);
  color: var(--navy-800);
}

.user-cell-email {
  font-size: var(--text-xs);
  color: var(--gray-500);
}

/* Role Badge */
.role-badge {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  padding: var(--space-1) var(--space-3);
  font-size: var(--text-xs);
  font-weight: var(--font-semibold);
  border-radius: var(--radius-full);
}

.role-badge.admin {
  background: var(--gold-100);
  color: var(--gold-600);
}

.role-badge.pengelola {
  background: var(--navy-100);
  color: var(--navy-700);
}

.role-badge.skpd {
  background: var(--gray-200);
  color: var(--gray-700);
}

/* Report Cards */
.report-card {
  background: var(--white);
  border-radius: var(--radius-xl);
  padding: var(--space-6);
  border: 1px solid var(--gray-200);
  display: flex;
  gap: var(--space-5);
  transition: all var(--transition-base);
}

.report-card:hover {
  border-color: var(--navy-300);
  box-shadow: var(--shadow-md);
}

.report-card-icon {
  width: 56px;
  height: 56px;
  border-radius: var(--radius-lg);
  background: var(--navy-100);
  color: var(--navy-600);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.report-card-content {
  flex: 1;
}

.report-card-title {
  font-family: var(--font-display);
  font-size: var(--text-lg);
  font-weight: var(--font-semibold);
  color: var(--navy-800);
  margin-bottom: var(--space-2);
}

.report-card-desc {
  font-size: var(--text-sm);
  color: var(--gray-500);
  margin-bottom: var(--space-4);
}

.report-card-actions {
  display: flex;
  gap: var(--space-2);
}

/* Stepper */
.stepper {
  display: flex;
  margin-bottom: var(--space-8);
}

.stepper-item {
  flex: 1;
  position: relative;
  text-align: center;
}

.stepper-item:not(:last-child)::after {
  content: '';
  position: absolute;
  top: 20px;
  left: 50%;
  width: 100%;
  height: 2px;
  background: var(--gray-200);
}

.stepper-item.completed::after {
  background: var(--gold-500);
}

.stepper-circle {
  position: relative;
  z-index: 1;
  width: 40px;
  height: 40px;
  margin: 0 auto var(--space-3);
  border-radius: var(--radius-full);
  background: var(--gray-200);
  color: var(--gray-500);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-weight: var(--font-semibold);
}

.stepper-item.active .stepper-circle {
  background: var(--gold-500);
  color: var(--navy-900);
}

.stepper-item.completed .stepper-circle {
  background: var(--success-500);
  color: var(--white);
}

.stepper-label {
  font-size: var(--text-sm);
  color: var(--gray-500);
}

.stepper-item.active .stepper-label {
  color: var(--navy-800);
  font-weight: var(--font-medium);
}

/* ============================================
   Animations
   ============================================ */
@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fadeInDown {
  from {
    opacity: 0;
    transform: translateY(-20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes slideInLeft {
  from {
    opacity: 0;
    transform: translateX(-20px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes slideInRight {
  from {
    opacity: 0;
    transform: translateX(20px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes scaleIn {
  from {
    opacity: 0;
    transform: scale(0.95);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

@keyframes pulse {
  0%, 100% {
    opacity: 1;
  }
  50% {
    opacity: 0.5;
  }
}

@keyframes spin {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}

.animate-fade-in { animation: fadeIn 0.5s ease; }
.animate-fade-in-up { animation: fadeInUp 0.5s ease; }
.animate-fade-in-down { animation: fadeInDown 0.5s ease; }
.animate-slide-in-left { animation: slideInLeft 0.5s ease; }
.animate-slide-in-right { animation: slideInRight 0.5s ease; }
.animate-scale-in { animation: scaleIn 0.3s ease; }
.animate-pulse { animation: pulse 2s infinite; }
.animate-spin { animation: spin 1s linear infinite; }

/* Staggered animations for lists */
.stagger-item {
  animation: fadeInUp 0.5s ease backwards;
}

.stagger-item:nth-child(1) { animation-delay: 0.05s; }
.stagger-item:nth-child(2) { animation-delay: 0.1s; }
.stagger-item:nth-child(3) { animation-delay: 0.15s; }
.stagger-item:nth-child(4) { animation-delay: 0.2s; }
.stagger-item:nth-child(5) { animation-delay: 0.25s; }
.stagger-item:nth-child(6) { animation-delay: 0.3s; }
.stagger-item:nth-child(7) { animation-delay: 0.35s; }
.stagger-item:nth-child(8) { animation-delay: 0.4s; }
.stagger-item:nth-child(9) { animation-delay: 0.45s; }
.stagger-item:nth-child(10) { animation-delay: 0.5s; }

/* ============================================
   Login Page Specific Styles
   ============================================ */
.login-page {
  min-height: 100vh;
  display: flex;
  background: linear-gradient(135deg, var(--navy-900) 0%, var(--navy-800) 50%, var(--navy-700) 100%);
  position: relative;
  overflow: hidden;
}

.login-page::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: url("data:image/svg+xml,%3Csvg width='100' height='100' viewBox='0 0 100 100' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M11 18c3.866 0 7-3.134 7-7s-3.134-7-7-7-7 3.134-7 7 3.134 7 7 7zm48 25c3.866 0 7-3.134 7-7s-3.134-7-7-7-7 3.134-7 7 3.134 7 7 7zm-43-7c1.657 0 3-1.343 3-3s-1.343-3-3-3-3 1.343-3 3 1.343 3 3 3zm63 31c1.657 0 3-1.343 3-3s-1.343-3-3-3-3 1.343-3 3 1.343 3 3 3zM34 90c1.657 0 3-1.343 3-3s-1.343-3-3-3-3 1.343-3 3 1.343 3 3 3zm56-76c1.657 0 3-1.343 3-3s-1.343-3-3-3-3 1.343-3 3 1.343 3 3 3zM12 86c2.21 0 4-1.79 4-4s-1.79-4-4-4-4 1.79-4 4 1.79 4 4 4zm28-65c2.21 0 4-1.79 4-4s-1.79-4-4-4-4 1.79-4 4 1.79 4 4 4zm23-11c2.76 0 5-2.24 5-5s-2.24-5-5-5-5 2.24-5 5 2.24 5 5 5zm-6 60c2.21 0 4-1.79 4-4s-1.79-4-4-4-4 1.79-4 4 1.79 4 4 4zm29 22c2.76 0 5-2.24 5-5s-2.24-5-5-5-5 2.24-5 5 2.24 5 5 5zM32 63c2.76 0 5-2.24 5-5s-2.24-5-5-5-5 2.24-5 5 2.24 5 5 5zm57-13c2.76 0 5-2.24 5-5s-2.24-5-5-5-5 2.24-5 5 2.24 5 5 5zm-9-21c1.105 0 2-.895 2-2s-.895-2-2-2-2 .895-2 2 .895 2 2 2zM60 91c1.105 0 2-.895 2-2s-.895-2-2-2-2 .895-2 2 .895 2 2 2zM35 41c1.105 0 2-.895 2-2s-.895-2-2-2-2 .895-2 2 .895 2 2 2zM12 60c1.105 0 2-.895 2-2s-.895-2-2-2-2 .895-2 2 .895 2 2 2z' fill='%23ffffff' fill-opacity='0.03' fill-rule='evenodd'/%3E%3C/svg%3E");
  pointer-events: none;
}

.login-branding {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: var(--space-16);
  position: relative;
  color: var(--white);
}

.login-branding-content {
  max-width: 500px;
  animation: fadeInUp 0.8s ease;
}

.login-branding-logo {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  margin-bottom: var(--space-12);
}

.login-branding-logo-icon {
  width: 64px;
  height: 64px;
  background: linear-gradient(135deg, var(--gold-500) 0%, var(--gold-600) 100%);
  border-radius: var(--radius-xl);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-weight: var(--font-extrabold);
  font-size: var(--text-3xl);
  color: var(--navy-900);
  box-shadow: var(--shadow-glow-gold);
}

.login-branding-logo-text {
  font-family: var(--font-display);
  font-size: var(--text-3xl);
  font-weight: var(--font-bold);
  letter-spacing: 1px;
}

.login-branding-title {
  font-family: var(--font-display);
  font-size: var(--text-5xl);
  font-weight: var(--font-extrabold);
  line-height: 1.1;
  margin-bottom: var(--space-6);
}

.login-branding-title span {
  color: var(--gold-400);
}

.login-branding-desc {
  font-size: var(--text-xl);
  color: var(--navy-200);
  line-height: 1.6;
  margin-bottom: var(--space-12);
}

.login-features {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}

.login-feature {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  font-size: var(--text-base);
  color: var(--navy-200);
}

.login-feature-icon {
  width: 24px;
  height: 24px;
  color: var(--gold-400);
}

.login-form-section {
  width: 520px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-8);
  position: relative;
}

.login-form-card {
  width: 100%;
  background: var(--white);
  border-radius: var(--radius-2xl);
  padding: var(--space-10);
  box-shadow: var(--shadow-2xl);
  animation: fadeInUp 0.8s ease 0.2s backwards;
}

.login-form-header {
  text-align: center;
  margin-bottom: var(--space-8);
}

.login-form-title {
  font-family: var(--font-display);
  font-size: var(--text-2xl);
  font-weight: var(--font-bold);
  color: var(--navy-800);
  margin-bottom: var(--space-2);
}

.login-form-subtitle {
  font-size: var(--text-sm);
  color: var(--gray-500);
}

.login-form .form-group {
  margin-bottom: var(--space-5);
}

.login-form .form-control {
  padding: var(--space-4);
  font-size: var(--text-base);
}

.login-form-options {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-6);
}

.login-forgot-link {
  font-size: var(--text-sm);
  color: var(--navy-600);
  font-weight: var(--font-medium);
}

.login-submit-btn {
  width: 100%;
  padding: var(--space-4);
  font-size: var(--text-base);
}

.login-divider {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  margin: var(--space-8) 0;
}

.login-divider::before,
.login-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--gray-200);
}

.login-divider-text {
  font-size: var(--text-sm);
  color: var(--gray-400);
}

.login-footer {
  text-align: center;
  font-size: var(--text-sm);
  color: var(--gray-500);
}

.login-footer a {
  color: var(--navy-600);
  font-weight: var(--font-medium);
}

/* ============================================
   Responsive Design
   ============================================ */
@media (max-width: 1400px) {
  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .kib-grid {
    grid-template-columns: repeat(3, 1fr);
  }

  .widget-col-6 { grid-column: span 12; }
  .widget-col-4 { grid-column: span 6; }
  .widget-col-8 { grid-column: span 12; }
}

@media (max-width: 1200px) {
  :root {
    --sidebar-width: 240px;
  }

  .data-cards-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .integration-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 992px) {
  .sidebar {
    transform: translateX(-100%);
    transition: transform var(--transition-base);
  }

  .sidebar.open {
    transform: translateX(0);
  }

  .main-content {
    margin-left: 0;
  }

  .header-search {
    display: none;
  }

  .form-row,
  .form-row-3 {
    grid-template-columns: 1fr;
  }

  .kib-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .login-branding {
    display: none;
  }

  .login-form-section {
    width: 100%;
  }
}

@media (max-width: 768px) {
  .content {
    padding: var(--space-4);
  }

  .stats-grid {
    grid-template-columns: 1fr;
  }

  .data-cards-grid {
    grid-template-columns: 1fr;
  }

  .page-header-row {
    flex-direction: column;
  }

  .filter-bar {
    flex-wrap: wrap;
  }

  .table-container {
    margin: 0 calc(-1 * var(--space-4));
    border-radius: 0;
    border-left: none;
    border-right: none;
  }

  .widget-col-4 { grid-column: span 12; }

  .integration-grid {
    grid-template-columns: 1fr;
  }
}

/* ============================================
   Print Styles
   ============================================ */
@media print {
  .sidebar,
  .header,
  .btn,
  .filter-bar {
    display: none !important;
  }

  .main-content {
    margin-left: 0;
  }

  .card {
    box-shadow: none;
    border: 1px solid var(--gray-300);
  }
}
