/* ================================================================
   SIAKRED - Design System v1.0
   Tema: Soft Blue Professional
   ================================================================ */

:root {
  /* Primary Colors */
  --primary-50: #EFF6FF;
  --primary-100: #DBEAFE;
  --primary-200: #BFDBFE;
  --primary-300: #93C5FD;
  --primary-400: #60A5FA;
  --primary-500: #3B82F6;
  --primary-600: #2563EB;
  --primary-700: #1D4ED8;
  --primary-800: #1E40AF;
  --primary-900: #1E3A8A;

  /* Accent */
  --accent-sky: #0EA5E9;
  --accent-cyan: #06B6D4;

  /* Surface */
  --surface-white: #FFFFFF;
  --surface-bg: #F8FAFC;
  --surface-muted: #F1F5F9;
  --surface-card: #FFFFFF;

  /* Text */
  --text-primary: #0F172A;
  --text-secondary: #475569;
  --text-muted: #94A3B8;
  --text-inverse: #FFFFFF;

  /* Border */
  --border-subtle: #E2E8F0;
  --border-default: #CBD5E1;
  --border-focus: #3B82F6;

  /* Semantic */
  --success: #10B981;
  --success-bg: #D1FAE5;
  --warning: #F59E0B;
  --warning-bg: #FEF3C7;
  --danger: #EF4444;
  --danger-bg: #FEE2E2;
  --info: #3B82F6;
  --info-bg: #DBEAFE;

  /* Shadows */
  --shadow-sm: 0 1px 2px 0 rgba(15, 23, 42, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(15, 23, 42, 0.08), 0 2px 4px -2px rgba(15, 23, 42, 0.05);
  --shadow-lg: 0 10px 15px -3px rgba(15, 23, 42, 0.1), 0 4px 6px -4px rgba(15, 23, 42, 0.06);
  --shadow-xl: 0 20px 25px -5px rgba(15, 23, 42, 0.1), 0 8px 10px -6px rgba(15, 23, 42, 0.06);
  --shadow-glow: 0 0 0 4px rgba(59, 130, 246, 0.1);

  /* Radius */
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 14px;
  --radius-xl: 20px;
  --radius-full: 9999px;

  /* Spacing */
  --gap-xs: 4px;
  --gap-sm: 8px;
  --gap-md: 16px;
  --gap-lg: 24px;
  --gap-xl: 32px;
  --gap-2xl: 48px;
}

/* ================================================================
   RESET & BASE
   ================================================================ */

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

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

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
  color: var(--text-primary);
  background: var(--surface-bg);
  line-height: 1.6;
  min-height: 100vh;
}

a {
  color: var(--primary-600);
  text-decoration: none;
  transition: color 0.2s ease;
}

a:hover {
  color: var(--primary-700);
}

button {
  font-family: inherit;
  cursor: pointer;
  border: none;
  background: none;
}

/* ================================================================
   LOGIN PAGE - SPLIT LAYOUT
   ================================================================ */

.login-wrapper {
  display: grid;
  grid-template-columns: 1fr 1fr;
  min-height: 100vh;
  overflow: hidden;
}

/* LEFT: Branding Panel */
.login-hero {
  position: relative;
  background: linear-gradient(135deg, #1E40AF 0%, #2563EB 50%, #3B82F6 100%);
  color: white;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 3rem 4rem;
  overflow: hidden;
}

/* Animated floating shapes */
.login-hero::before,
.login-hero::after {
  content: '';
  position: absolute;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.15) 0%, rgba(255, 255, 255, 0) 70%);
  animation: float 20s ease-in-out infinite;
  pointer-events: none;
}

.login-hero::before {
  width: 500px;
  height: 500px;
  top: -200px;
  right: -150px;
  animation-delay: 0s;
}

.login-hero::after {
  width: 400px;
  height: 400px;
  bottom: -150px;
  left: -100px;
  animation-delay: -10s;
}

@keyframes float {
  0%, 100% {
    transform: translate(0, 0) scale(1);
  }
  33% {
    transform: translate(30px, -30px) scale(1.05);
  }
  66% {
    transform: translate(-20px, 20px) scale(0.95);
  }
}

/* Particles grid */
.particles {
  position: absolute;
  inset: 0;
  background-image:
    radial-gradient(circle at 20% 30%, rgba(255, 255, 255, 0.1) 1px, transparent 2px),
    radial-gradient(circle at 80% 70%, rgba(255, 255, 255, 0.08) 1px, transparent 2px),
    radial-gradient(circle at 40% 80%, rgba(255, 255, 255, 0.1) 1px, transparent 2px),
    radial-gradient(circle at 70% 20%, rgba(255, 255, 255, 0.08) 1px, transparent 2px);
  background-size: 200px 200px, 250px 250px, 180px 180px, 220px 220px;
  animation: particles-move 40s linear infinite;
  pointer-events: none;
}

@keyframes particles-move {
  from { background-position: 0 0, 0 0, 0 0, 0 0; }
  to { background-position: 200px 200px, -250px 250px, 180px -180px, -220px -220px; }
}

.hero-top {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  gap: 1rem;
}

.hero-logo {
  width: 60px;
  height: 60px;
  background: white;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15);
  padding: 4px;
}

.hero-logo img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.hero-title-small {
  font-size: 0.9rem;
  font-weight: 500;
  opacity: 0.85;
  letter-spacing: 0.5px;
}

.hero-center {
  position: relative;
  z-index: 1;
  max-width: 480px;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  background: rgba(255, 255, 255, 0.15);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: var(--radius-full);
  font-size: 0.85rem;
  font-weight: 500;
  margin-bottom: 1.5rem;
}

.hero-badge-dot {
  width: 8px;
  height: 8px;
  background: #34D399;
  border-radius: 50%;
  animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.6; transform: scale(1.2); }
}

.hero-title {
  font-size: 2.75rem;
  font-weight: 800;
  line-height: 1.1;
  margin-bottom: 1rem;
  letter-spacing: -0.02em;
}

.hero-title-accent {
  background: linear-gradient(90deg, #FDE68A 0%, #FCD34D 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.hero-subtitle {
  font-size: 1.1rem;
  line-height: 1.7;
  opacity: 0.9;
  margin-bottom: 2rem;
}

.hero-features {
  display: grid;
  gap: 1rem;
  margin-top: 2rem;
}

.hero-feature {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  background: rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: var(--radius-md);
  font-size: 0.9rem;
  font-weight: 500;
}

.hero-feature-icon {
  width: 32px;
  height: 32px;
  background: rgba(255, 255, 255, 0.15);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.hero-bottom {
  position: relative;
  z-index: 1;
  font-size: 0.85rem;
  opacity: 0.75;
}

/* RIGHT: Form Panel */
.login-form-panel {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem;
  background: var(--surface-white);
  position: relative;
}

.login-form-container {
  width: 100%;
  max-width: 440px;
}

.login-form-header {
  margin-bottom: 2rem;
  text-align: center;
}

.login-form-title {
  font-size: 1.875rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 0.5rem;
}

.login-form-subtitle {
  color: var(--text-secondary);
  font-size: 0.95rem;
}

/* ================================================================
   FORM ELEMENTS
   ================================================================ */

.form-group {
  margin-bottom: 1.25rem;
}

.form-label {
  display: block;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 0.5rem;
}

.form-label-required::after {
  content: ' *';
  color: var(--danger);
}

.form-input-wrapper {
  position: relative;
}

.form-input {
  width: 100%;
  padding: 0.875rem 1rem;
  font-size: 0.95rem;
  color: var(--text-primary);
  background: var(--surface-white);
  border: 1.5px solid var(--border-default);
  border-radius: var(--radius-md);
  transition: all 0.2s ease;
  font-family: inherit;
}

.form-input::placeholder {
  color: var(--text-muted);
}

.form-input:hover {
  border-color: var(--primary-300);
}

.form-input:focus {
  outline: none;
  border-color: var(--primary-500);
  box-shadow: var(--shadow-glow);
  background: var(--primary-50);
}

.form-input.has-icon-left {
  padding-left: 2.75rem;
}

.form-input.has-icon-right {
  padding-right: 2.75rem;
}

.form-icon {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
}

.form-icon-left {
  left: 1rem;
}

.form-icon-right {
  right: 1rem;
}

.password-toggle {
  position: absolute;
  top: 50%;
  right: 0.75rem;
  transform: translateY(-50%);
  background: transparent;
  border: none;
  color: var(--text-muted);
  padding: 0.5rem;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.15s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}

.password-toggle:hover {
  color: var(--primary-600);
  background: var(--primary-50);
}

/* Password strength meter */
.password-strength {
  margin-top: 0.5rem;
  height: 4px;
  background: var(--surface-muted);
  border-radius: var(--radius-full);
  overflow: hidden;
  display: none;
}

.password-strength.active {
  display: block;
}

.password-strength-bar {
  height: 100%;
  transition: width 0.3s ease, background 0.3s ease;
  border-radius: var(--radius-full);
}

.password-strength-bar.weak    { width: 33%;  background: var(--danger); }
.password-strength-bar.medium  { width: 66%;  background: var(--warning); }
.password-strength-bar.strong  { width: 100%; background: var(--success); }

.password-strength-label {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 0.25rem;
  display: none;
}

.password-strength-label.active {
  display: block;
}

/* Checkbox */
.form-check {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  user-select: none;
  cursor: pointer;
  font-size: 0.875rem;
  color: var(--text-secondary);
}

.form-check input[type="checkbox"] {
  width: 18px;
  height: 18px;
  accent-color: var(--primary-600);
  cursor: pointer;
}

/* Button */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.875rem 1.5rem;
  font-size: 0.95rem;
  font-weight: 600;
  border-radius: var(--radius-md);
  border: 1.5px solid transparent;
  cursor: pointer;
  transition: all 0.2s ease;
  font-family: inherit;
  white-space: nowrap;
}

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

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

.btn-primary:hover:not(:disabled) {
  background: linear-gradient(135deg, var(--primary-700) 0%, var(--primary-800) 100%);
  box-shadow: var(--shadow-lg), 0 0 0 1px var(--primary-900) inset;
  transform: translateY(-1px);
}

.btn-primary:active:not(:disabled) {
  transform: translateY(0);
}

.btn-full {
  width: 100%;
}

.btn-loading .btn-label {
  display: none;
}

.btn-loading .btn-spinner {
  display: inline-block;
}

.btn-spinner {
  display: none;
  width: 20px;
  height: 20px;
  border: 2.5px solid rgba(255, 255, 255, 0.3);
  border-top-color: white;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

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

/* Alert / Error */
.alert {
  padding: 0.875rem 1rem;
  border-radius: var(--radius-md);
  font-size: 0.875rem;
  margin-bottom: 1.25rem;
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  animation: slideDown 0.3s ease-out;
}

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

.alert-danger {
  background: var(--danger-bg);
  color: #991B1B;
  border: 1px solid #FECACA;
}

.alert-success {
  background: var(--success-bg);
  color: #065F46;
  border: 1px solid #A7F3D0;
}

.alert-info {
  background: var(--info-bg);
  color: #1E40AF;
  border: 1px solid var(--primary-200);
}

.alert-warning {
  background: var(--warning-bg);
  color: #92400E;
  border: 1px solid #FDE68A;
}

.alert-icon {
  flex-shrink: 0;
  margin-top: 2px;
}

/* CAPTCHA */
.captcha-box {
  background: linear-gradient(135deg, #F0F9FF 0%, #E0F2FE 100%);
  border: 1.5px solid var(--primary-200);
  border-radius: var(--radius-md);
  padding: 1rem;
  margin-bottom: 1.25rem;
}

.captcha-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.75rem;
}

.captcha-label {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--primary-800);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  display: flex;
  align-items: center;
  gap: 0.375rem;
}

.captcha-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.captcha-question {
  flex: 1;
  padding: 0.75rem 1rem;
  background: white;
  border: 1.5px dashed var(--primary-300);
  border-radius: var(--radius-sm);
  font-family: 'JetBrains Mono', 'Courier New', monospace;
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--primary-800);
  text-align: center;
  letter-spacing: 2px;
  user-select: none;
}

.captcha-input {
  width: 110px;
  padding: 0.75rem;
  text-align: center;
  font-size: 1.1rem;
  font-weight: 700;
}

/* Footer link */
.login-footer {
  margin-top: 1.5rem;
  text-align: center;
  font-size: 0.875rem;
  color: var(--text-secondary);
}

.login-footer-divider {
  margin: 1.5rem 0;
  display: flex;
  align-items: center;
  gap: 1rem;
  color: var(--text-muted);
  font-size: 0.8rem;
}

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

.login-info-note {
  margin-top: 2rem;
  padding: 0.875rem 1rem;
  background: var(--surface-muted);
  border-radius: var(--radius-md);
  font-size: 0.8rem;
  color: var(--text-secondary);
  text-align: center;
  line-height: 1.5;
}

/* ================================================================
   RESPONSIVE
   ================================================================ */

@media (max-width: 968px) {
  .login-wrapper {
    grid-template-columns: 1fr;
  }

  .login-hero {
    padding: 2rem 1.5rem;
    min-height: 280px;
  }

  .hero-center {
    max-width: 100%;
  }

  .hero-title {
    font-size: 2rem;
  }

  .hero-features {
    display: none;
  }

  .hero-bottom {
    display: none;
  }
}

@media (max-width: 480px) {
  .login-hero {
    padding: 1.5rem;
    min-height: 220px;
  }

  .hero-title {
    font-size: 1.625rem;
  }

  .hero-subtitle {
    font-size: 0.9rem;
  }

  .login-form-panel {
    padding: 1.5rem 1rem;
  }

  .login-form-title {
    font-size: 1.5rem;
  }
}

/* ================================================================
   DASHBOARD PLACEHOLDER
   ================================================================ */

.dashboard-shell {
  min-height: 100vh;
  background: var(--surface-bg);
  padding: 2rem;
}

.dashboard-header {
  background: white;
  border-radius: var(--radius-lg);
  padding: 1.5rem 2rem;
  box-shadow: var(--shadow-sm);
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.5rem;
}

.dashboard-welcome h1 {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text-primary);
}

.dashboard-welcome p {
  color: var(--text-secondary);
  margin-top: 0.25rem;
  font-size: 0.9rem;
}

.logout-form {
  margin: 0;
}

.dashboard-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.25rem;
  margin-bottom: 1.5rem;
}

.dashboard-card {
  background: white;
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border-subtle);
  transition: all 0.2s ease;
}

.dashboard-card:hover {
  box-shadow: var(--shadow-md);
  border-color: var(--primary-200);
  transform: translateY(-2px);
}

.dashboard-card-title {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 0.5rem;
}

.dashboard-card-value {
  font-size: 2rem;
  font-weight: 700;
  color: var(--text-primary);
}

.dashboard-info-box {
  background: white;
  border-radius: var(--radius-lg);
  padding: 1.5rem 2rem;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border-subtle);
}

.dashboard-section-title {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 0.75rem;
}

.scope-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.scope-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  background: var(--surface-muted);
  border-radius: var(--radius-md);
  font-size: 0.9rem;
}

.scope-badge {
  padding: 0.25rem 0.625rem;
  background: var(--primary-100);
  color: var(--primary-800);
  border-radius: var(--radius-full);
  font-size: 0.75rem;
  font-weight: 600;
}

/* ================================================================
   INTERNAL LAYOUT - Sidebar + Topbar + Content
   ================================================================ */

.internal-layout {
  display: flex;
  min-height: 100vh;
  background: var(--surface-bg);
}

/* ========== SIDEBAR ========== */
.sidebar {
  width: 260px;
  flex-shrink: 0;
  background: linear-gradient(180deg, #1E3A8A 0%, #1E40AF 100%);
  color: rgba(255, 255, 255, 0.9);
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
  box-shadow: 4px 0 20px rgba(15, 23, 42, 0.05);
  z-index: 20;
}

.sidebar-header {
  padding: 1.5rem 1.25rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.sidebar-logo {
  width: 42px;
  height: 42px;
  background: white;
  border-radius: 10px;
  padding: 3px;
  flex-shrink: 0;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.sidebar-logo img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.sidebar-brand {
  line-height: 1.2;
}

.sidebar-brand-title {
  font-weight: 700;
  font-size: 1rem;
  color: white;
}

.sidebar-brand-subtitle {
  font-size: 0.75rem;
  color: rgba(255, 255, 255, 0.6);
  margin-top: 2px;
}

.sidebar-content {
  flex: 1;
  padding: 1rem 0;
  overflow-y: auto;
}

.sidebar-group {
  padding: 0 0.75rem;
  margin-bottom: 1.25rem;
}

.sidebar-group-title {
  font-size: 0.7rem;
  font-weight: 700;
  color: rgba(255, 255, 255, 0.45);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 0.5rem 0.75rem;
  margin-bottom: 0.25rem;
}

.sidebar-menu {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.sidebar-menu-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.65rem 0.85rem;
  color: rgba(255, 255, 255, 0.8);
  font-size: 0.9rem;
  font-weight: 500;
  border-radius: 8px;
  transition: all 0.15s ease;
  text-decoration: none;
  position: relative;
}

.sidebar-menu-item:hover {
  background: rgba(255, 255, 255, 0.08);
  color: white;
}

.sidebar-menu-item.active {
  background: rgba(255, 255, 255, 0.15);
  color: white;
  font-weight: 600;
  box-shadow: inset 3px 0 0 #FBBF24;
}

.sidebar-menu-icon {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0.9;
}

.sidebar-menu-badge {
  margin-left: auto;
  background: #FBBF24;
  color: #1E3A8A;
  font-size: 0.7rem;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 10px;
}

.sidebar-footer {
  padding: 1rem 1.25rem;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  font-size: 0.75rem;
  color: rgba(255, 255, 255, 0.5);
  text-align: center;
}

/* ========== TOPBAR ========== */
.main-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.topbar {
  background: white;
  padding: 1rem 2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--border-subtle);
  position: sticky;
  top: 0;
  z-index: 10;
  backdrop-filter: blur(12px);
  background: rgba(255, 255, 255, 0.95);
}

.topbar-left {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.topbar-menu-toggle {
  display: none;
  width: 40px;
  height: 40px;
  background: var(--surface-muted);
  border-radius: 8px;
  align-items: center;
  justify-content: center;
  color: var(--text-primary);
  cursor: pointer;
  border: none;
}

.topbar-title {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text-primary);
}

.topbar-breadcrumb {
  font-size: 0.85rem;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-top: 2px;
}

.topbar-breadcrumb a {
  color: var(--text-muted);
  text-decoration: none;
}

.topbar-breadcrumb a:hover {
  color: var(--primary-600);
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.topbar-action {
  width: 40px;
  height: 40px;
  background: var(--surface-muted);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-secondary);
  cursor: pointer;
  border: none;
  transition: all 0.15s ease;
  position: relative;
}

.topbar-action:hover {
  background: var(--primary-50);
  color: var(--primary-600);
}

.topbar-action-badge {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 8px;
  height: 8px;
  background: var(--danger);
  border-radius: 50%;
  border: 2px solid white;
}

.topbar-user {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.4rem 0.85rem 0.4rem 0.4rem;
  background: var(--surface-muted);
  border-radius: var(--radius-full);
  cursor: pointer;
  transition: all 0.15s ease;
  border: none;
  font-family: inherit;
}

.topbar-user:hover {
  background: var(--primary-50);
}

.topbar-user-avatar {
  width: 32px;
  height: 32px;
  background: linear-gradient(135deg, var(--primary-500), var(--primary-700));
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-weight: 700;
  font-size: 0.85rem;
}

.topbar-user-info {
  line-height: 1.2;
  text-align: left;
}

.topbar-user-name {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-primary);
}

.topbar-user-role {
  font-size: 0.7rem;
  color: var(--text-muted);
}

/* ========== CONTENT ========== */
.page-content {
  flex: 1;
  padding: 2rem;
  max-width: 100%;
}

.page-header {
  margin-bottom: 1.75rem;
}

.page-header-flex {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

.page-title {
  font-size: 1.75rem;
  font-weight: 800;
  color: var(--text-primary);
  letter-spacing: -0.02em;
  margin-bottom: 0.25rem;
}

.page-subtitle {
  color: var(--text-secondary);
  font-size: 0.95rem;
}

/* ========== STATS GRID ========== */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1.25rem;
  margin-bottom: 1.75rem;
}

.stat-card {
  background: white;
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border-subtle);
  position: relative;
  overflow: hidden;
  transition: all 0.2s ease;
}

.stat-card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

.stat-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: var(--card-accent, var(--primary-500));
}

.stat-card.accent-blue    { --card-accent: linear-gradient(90deg, #3B82F6, #2563EB); }
.stat-card.accent-cyan    { --card-accent: linear-gradient(90deg, #06B6D4, #0891B2); }
.stat-card.accent-amber   { --card-accent: linear-gradient(90deg, #F59E0B, #D97706); }
.stat-card.accent-emerald { --card-accent: linear-gradient(90deg, #10B981, #059669); }
.stat-card.accent-purple  { --card-accent: linear-gradient(90deg, #8B5CF6, #7C3AED); }
.stat-card.accent-rose    { --card-accent: linear-gradient(90deg, #F43F5E, #E11D48); }

.stat-card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
}

.stat-card-label {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.stat-card-icon {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--primary-50);
  color: var(--primary-600);
  flex-shrink: 0;
}

.stat-card-icon.bg-cyan    { background: #ECFEFF; color: #0891B2; }
.stat-card-icon.bg-amber   { background: #FEF3C7; color: #D97706; }
.stat-card-icon.bg-emerald { background: #D1FAE5; color: #059669; }
.stat-card-icon.bg-purple  { background: #EDE9FE; color: #7C3AED; }
.stat-card-icon.bg-rose    { background: #FFE4E6; color: #E11D48; }

.stat-card-value {
  font-size: 2.25rem;
  font-weight: 800;
  color: var(--text-primary);
  line-height: 1;
  margin-bottom: 0.5rem;
  letter-spacing: -0.02em;
}

.stat-card-meta {
  font-size: 0.8rem;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.stat-trend-up   { color: var(--success); }
.stat-trend-down { color: var(--danger); }

/* ========== PANEL / CARD ========== */
.panel {
  background: white;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-subtle);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  margin-bottom: 1.25rem;
}

.panel-header {
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

.panel-title {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.panel-subtitle {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-top: 2px;
}

.panel-body {
  padding: 1.5rem;
}

.panel-body-flush {
  padding: 0;
}

/* ========== INSTRUMEN CARDS ========== */
.instrumen-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.25rem;
}

.instrumen-card {
  background: white;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  transition: all 0.2s ease;
  text-decoration: none;
  color: inherit;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  position: relative;
  overflow: hidden;
}

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

.instrumen-card-badge {
  position: absolute;
  top: 1rem;
  right: 1rem;
  background: var(--primary-50);
  color: var(--primary-700);
  padding: 0.2rem 0.6rem;
  border-radius: 8px;
  font-size: 0.7rem;
  font-weight: 700;
}

.instrumen-card-title {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text-primary);
  padding-right: 4rem;
}

.instrumen-card-lembaga {
  font-size: 0.85rem;
  color: var(--text-secondary);
}

.instrumen-card-desc {
  font-size: 0.85rem;
  color: var(--text-muted);
  line-height: 1.5;
  flex: 1;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.instrumen-card-stats {
  display: flex;
  gap: 1rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border-subtle);
}

.instrumen-card-stat {
  flex: 1;
  text-align: center;
}

.instrumen-card-stat-value {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--primary-600);
}

.instrumen-card-stat-label {
  font-size: 0.7rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* ========== DATA TABLE ========== */
.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}

.data-table thead th {
  text-align: left;
  padding: 0.85rem 1rem;
  background: var(--surface-muted);
  font-weight: 700;
  color: var(--text-secondary);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  border-bottom: 1px solid var(--border-subtle);
  white-space: nowrap;
}

.data-table tbody td {
  padding: 0.85rem 1rem;
  border-bottom: 1px solid var(--border-subtle);
  color: var(--text-primary);
  vertical-align: middle;
}

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

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

/* Badge di tabel */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.2rem 0.6rem;
  border-radius: var(--radius-full);
  font-size: 0.75rem;
  font-weight: 600;
  white-space: nowrap;
}

.badge-blue    { background: var(--primary-100); color: var(--primary-800); }
.badge-cyan    { background: #CFFAFE;            color: #0E7490; }
.badge-amber   { background: #FEF3C7;            color: #92400E; }
.badge-emerald { background: #D1FAE5;            color: #065F46; }
.badge-purple  { background: #EDE9FE;            color: #5B21B6; }
.badge-rose    { background: #FFE4E6;            color: #9F1239; }
.badge-gray    { background: var(--surface-muted); color: var(--text-secondary); }

/* ========== RESPONSIVE ========== */
@media (max-width: 1024px) {
  .sidebar {
    position: fixed;
    left: -260px;
    transition: left 0.3s ease;
  }
  .sidebar.open { left: 0; }
  .topbar-menu-toggle { display: inline-flex; }
}

@media (max-width: 640px) {
  .page-content { padding: 1.25rem; }
  .topbar { padding: 0.85rem 1rem; }
  .topbar-user-info { display: none; }
}

/* ================================================================
   FIX: Button Primary Hover Visibility
   ================================================================ */

.btn-primary,
a.btn-primary,
button.btn-primary {
  background: var(--primary-600) !important;
  color: #ffffff !important;
  border: 1px solid var(--primary-600) !important;
  font-weight: 600;
  transition: background 0.15s ease, transform 0.15s ease, box-shadow 0.15s ease;
}

.btn-primary:hover,
a.btn-primary:hover,
button.btn-primary:hover {
  background: var(--primary-700) !important;
  color: #ffffff !important;          /* TEKS TETAP PUTIH */
  border-color: var(--primary-700) !important;
  box-shadow: 0 6px 18px rgba(37, 99, 235, 0.25);
  transform: translateY(-1px);
}

.btn-primary:active,
a.btn-primary:active,
button.btn-primary:active {
  background: var(--primary-800) !important;
  color: #ffffff !important;
  transform: translateY(0);
}

.btn-primary:focus-visible,
a.btn-primary:focus-visible,
button.btn-primary:focus-visible {
  outline: 3px solid rgba(37, 99, 235, 0.35);
  outline-offset: 2px;
  color: #ffffff !important;
}

/* Secondary/ghost button (tombol abu-abu "Download Template") */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.55rem 1.1rem;
  border-radius: 10px;
  font-size: 0.9rem;
  font-weight: 600;
  text-decoration: none;
  border: 1px solid var(--border-subtle);
  cursor: pointer;
  transition: all 0.15s ease;
  background: white;
  color: var(--text-primary);
  font-family: inherit;
}

.btn:hover {
  background: var(--primary-50);
  border-color: var(--primary-300);
  color: var(--primary-700);
}

/* ================================================================
   FORM CONTROLS — untuk halaman Upload Import
   ================================================================ */

.form-group {
  margin-bottom: 1.25rem;
}

.form-label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 0.5rem;
}

.form-label-required::after {
  content: " *";
  color: var(--danger);
}

.form-input {
  display: block;
  width: 100%;
  padding: 0.7rem 0.95rem;
  font-size: 0.9rem;
  color: var(--text-primary);
  background: white;
  border: 1px solid var(--border-subtle);
  border-radius: 10px;
  transition: border-color 0.15s, box-shadow 0.15s;
  font-family: inherit;
}

.form-input:focus {
  outline: none;
  border-color: var(--primary-500);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.form-help {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 0.4rem;
}

.form-errors {
  color: var(--danger);
  font-size: 0.8rem;
  margin-top: 0.4rem;
}

/* Radio group — untuk mode import */
.radio-group {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 0.75rem;
  margin-top: 0.5rem;
}

.radio-card {
  position: relative;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.9rem 1rem;
  background: white;
  border: 2px solid var(--border-subtle);
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.radio-card:hover {
  border-color: var(--primary-300);
  background: var(--primary-50);
}

.radio-card input[type="radio"] {
  width: 18px;
  height: 18px;
  accent-color: var(--primary-600);
  flex-shrink: 0;
  cursor: pointer;
}

.radio-card input[type="radio"]:checked ~ .radio-label {
  color: var(--primary-700);
  font-weight: 600;
}

.radio-card:has(input:checked) {
  border-color: var(--primary-500);
  background: var(--primary-50);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.08);
}

.radio-label {
  flex: 1;
  font-size: 0.9rem;
  color: var(--text-primary);
  line-height: 1.4;
}

.radio-label-main {
  font-weight: 600;
  display: block;
}

.radio-label-sub {
  font-size: 0.75rem;
  color: var(--text-muted);
  font-weight: 400;
}

/* File dropzone */
.file-dropzone {
  position: relative;
  padding: 2.5rem 1.5rem;
  border: 2px dashed var(--border-default, #CBD5E1);
  border-radius: 12px;
  background: var(--surface-muted);
  text-align: center;
  transition: all 0.15s ease;
  cursor: pointer;
}

.file-dropzone:hover {
  border-color: var(--primary-400);
  background: var(--primary-50);
}

.file-dropzone input[type="file"] {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  cursor: pointer;
}

.file-dropzone-icon {
  font-size: 2.5rem;
  margin-bottom: 0.5rem;
  color: var(--primary-500);
}

.file-dropzone-text {
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 0.25rem;
}

.file-dropzone-hint {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.file-preview {
  display: none;
  align-items: center;
  gap: 0.75rem;
  padding: 0.85rem 1rem;
  background: var(--primary-50);
  border: 1px solid var(--primary-300);
  border-radius: 10px;
  margin-top: 0.75rem;
}

.file-preview.visible { display: flex; }

.file-preview-icon {
  color: var(--primary-600);
  flex-shrink: 0;
}

.file-preview-info {
  flex: 1;
  min-width: 0;
}

.file-preview-name {
  font-weight: 600;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.file-preview-meta {
  font-size: 0.8rem;
  color: var(--text-muted);
}

/* ================================================================
   TAB NAVIGATION — Preview Import
   ================================================================ */

.tab-nav {
  display: flex;
  gap: 0.25rem;
  border-bottom: 2px solid var(--border-subtle);
  margin-bottom: 1.25rem;
  overflow-x: auto;
}

.tab-link {
  padding: 0.75rem 1.25rem;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-muted);
  border: none;
  background: none;
  cursor: pointer;
  border-bottom: 3px solid transparent;
  margin-bottom: -2px;
  transition: all 0.15s ease;
  white-space: nowrap;
  font-family: inherit;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

.tab-link:hover {
  color: var(--primary-600);
}

.tab-link.active {
  color: var(--primary-700);
  border-bottom-color: var(--primary-600);
}

.tab-link-badge {
  background: var(--surface-muted);
  color: var(--text-secondary);
  font-size: 0.7rem;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 10px;
}

.tab-link.active .tab-link-badge {
  background: var(--primary-100);
  color: var(--primary-800);
}

.tab-pane { display: none; }
.tab-pane.active { display: block; }

/* ================================================================
   IMPORT STATUS BADGES — specific to import item status
   ================================================================ */

.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.25rem 0.7rem;
  font-size: 0.72rem;
  font-weight: 700;
  border-radius: var(--radius-full);
  white-space: nowrap;
}

.status-badge-will-create   { background: #D1FAE5; color: #065F46; }
.status-badge-will-update   { background: #FEF3C7; color: #92400E; }
.status-badge-created       { background: #10B981; color: white; }
.status-badge-updated       { background: #F59E0B; color: white; }
.status-badge-duplicate     { background: #E0E7FF; color: #3730A3; }
.status-badge-invalid       { background: #FEE2E2; color: #991B1B; }
.status-badge-skipped       { background: #E5E7EB; color: #4B5563; }
.status-badge-failed        { background: #EF4444; color: white; }