/* =========================================================
   SISTEM INFORMASI REKAM MEDIS SANTRI — Design System CSS
   ========================================================= */

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

/* --- CSS Custom Properties (Design Tokens) --- */
:root {
  /* Primary Palette — Teal/Emerald */
  --primary-50: #f0fdfa;
  --primary-100: #ccfbf1;
  --primary-200: #99f6e4;
  --primary-300: #5eead4;
  --primary-400: #2dd4bf;
  --primary-500: #14b8a6;
  --primary-600: #0d9488;
  --primary-700: #0f766e;
  --primary-800: #115e59;
  --primary-900: #134e4a;

  /* Neutral Palette */
  --gray-50: #f8fafc;
  --gray-100: #f1f5f9;
  --gray-200: #e2e8f0;
  --gray-300: #cbd5e1;
  --gray-400: #94a3b8;
  --gray-500: #64748b;
  --gray-600: #475569;
  --gray-700: #334155;
  --gray-800: #1e293b;
  --gray-900: #0f172a;

  /* Accent Colors */
  --accent-blue: #3b82f6;
  --accent-purple: #8b5cf6;
  --accent-pink: #ec4899;
  --accent-orange: #f97316;
  --accent-yellow: #eab308;
  --accent-red: #ef4444;
  --accent-green: #22c55e;

  /* Semantic Colors */
  --success: #10b981;
  --warning: #f59e0b;
  --danger: #ef4444;
  --info: #3b82f6;

  /* Gradients */
  --gradient-primary: linear-gradient(135deg, #0d9488 0%, #14b8a6 50%, #2dd4bf 100%);
  --gradient-sidebar: linear-gradient(180deg, #0f172a 0%, #1e293b 100%);
  --gradient-card-1: linear-gradient(135deg, #0d9488 0%, #06b6d4 100%);
  --gradient-card-2: linear-gradient(135deg, #8b5cf6 0%, #a78bfa 100%);
  --gradient-card-3: linear-gradient(135deg, #f97316 0%, #fb923c 100%);
  --gradient-card-4: linear-gradient(135deg, #ec4899 0%, #f472b6 100%);
  --gradient-hero: linear-gradient(135deg, #0f766e 0%, #0d9488 30%, #14b8a6 60%, #2dd4bf 100%);

  /* Shadows */
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.07), 0 2px 4px -2px rgba(0, 0, 0, 0.05);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.08), 0 4px 6px -4px rgba(0, 0, 0, 0.04);
  --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.04);
  --shadow-2xl: 0 25px 50px -12px rgba(0, 0, 0, 0.15);
  --shadow-primary: 0 10px 30px -5px rgba(13, 148, 136, 0.3);
  --shadow-card: 0 1px 3px rgba(0,0,0,0.04), 0 6px 16px rgba(0,0,0,0.04);

  /* Layout */
  --sidebar-width: 260px;
  --sidebar-collapsed-width: 72px;
  --navbar-height: 64px;
  --border-radius: 12px;
  --border-radius-sm: 8px;
  --border-radius-lg: 16px;
  --border-radius-xl: 20px;

  /* Transitions */
  --transition-fast: 0.15s ease;
  --transition-base: 0.25s ease;
  --transition-slow: 0.4s ease;
  --transition-spring: 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}

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

html {
  scroll-behavior: smooth;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-size: 0.9rem;
  line-height: 1.6;
  color: var(--gray-700);
  background-color: var(--gray-100);
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

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

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

/* --- Scrollbar --- */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
::-webkit-scrollbar-track {
  background: transparent;
}
::-webkit-scrollbar-thumb {
  background: var(--gray-300);
  border-radius: 10px;
}
::-webkit-scrollbar-thumb:hover {
  background: var(--gray-400);
}

/* =========================================================
   LOGIN PAGE
   ========================================================= */

/* --- Body --- */
.login-page {
  min-height: 100vh;
  background: var(--gradient-hero);
  position: relative;
  overflow-x: hidden;
  overflow-y: auto;
}

/* --- Background Blobs --- */
.login-bg {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
}

.login-blob {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  opacity: 0.5;
  animation: floatBlob 20s ease-in-out infinite;
}

.login-blob-1 {
  width: 500px;
  height: 500px;
  background: rgba(45, 212, 191, 0.3);
  top: -15%;
  right: -10%;
  animation-duration: 20s;
}

.login-blob-2 {
  width: 400px;
  height: 400px;
  background: rgba(13, 148, 136, 0.25);
  bottom: -10%;
  left: -10%;
  animation-duration: 25s;
  animation-direction: reverse;
}

.login-blob-3 {
  width: 300px;
  height: 300px;
  background: rgba(255, 255, 255, 0.1);
  top: 40%;
  left: 50%;
  animation-duration: 18s;
}

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

/* --- Centering Container --- */
.login-container {
  position: relative;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 100vh;
  padding: 2rem 1rem;
  box-sizing: border-box;
}

/* --- Card --- */
.login-card {
  position: relative;
  z-index: 10;
  width: 100%;
  max-width: 440px;
  padding: 2.5rem 3rem;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: var(--border-radius-xl);
  box-shadow: var(--shadow-2xl);
  animation: slideUp 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
}

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

/* --- Logo, Title, Subtitle --- */
.login-header {
  text-align: center;
  margin-bottom: 0.5rem;
}

.login-logo {
  width: 64px;
  height: 64px;
  background: var(--gradient-primary);
  border-radius: var(--border-radius);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 1.5rem;
  font-size: 1.8rem;
  color: #fff;
  box-shadow: var(--shadow-primary);
}

.login-title {
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--gray-900);
  text-align: center;
  margin-bottom: 0.5rem;
}

.login-subtitle {
  font-size: 0.875rem;
  color: var(--gray-500);
  text-align: center;
  margin-bottom: 2rem;
}

/* --- Input Group with Icon --- */
.login-input-group {
  position: relative;
  display: flex;
  align-items: center;
}

.login-input-group > i:first-child {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 1rem;
  color: var(--gray-400);
  pointer-events: none;
  z-index: 2;
}

.login-input-group .form-control-custom {
  padding-left: 2.5rem;
  width: 100%;
}

/* --- Password Toggle Button --- */
.login-toggle-password {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  padding: 0.25rem 0.4rem;
  cursor: pointer;
  color: var(--gray-400);
  font-size: 1rem;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color var(--transition-fast);
}

.login-toggle-password:hover {
  color: var(--gray-600);
}

/* --- Login Button --- */
.login-btn {
  padding: 0.75rem 1.5rem;
  font-size: 0.95rem;
  border-radius: var(--border-radius-sm);
  margin-top: 0.5rem;
}

/* --- Demo Info --- */
.login-demo-info {
  margin-top: 1.5rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--gray-200);
  font-size: 0.8rem;
  color: var(--gray-500);
}

.login-demo-info p {
  margin-bottom: 0.25rem;
}

.login-demo-info code {
  background: var(--primary-50);
  color: var(--primary-700);
  padding: 0.15rem 0.4rem;
  border-radius: 4px;
  font-size: 0.78rem;
}

/* --- Responsive --- */
@media (max-width: 768px) {
  .login-container {
    align-items: flex-start;
    padding: 1.5rem 1rem;
  }
  .login-card {
    max-width: 100%;
    padding: 2rem 1.5rem;
    border-radius: var(--border-radius-lg);
  }
  .login-title {
    font-size: 1.25rem;
  }
  .login-logo {
    width: 52px;
    height: 52px;
    font-size: 1.4rem;
    margin-bottom: 1rem;
  }
  .login-subtitle {
    margin-bottom: 1.25rem;
    font-size: 0.8rem;
  }
}

@media (max-width: 400px) {
  .login-container {
    padding: 1rem 0.75rem;
  }
  .login-card {
    padding: 1.5rem 1.25rem;
  }
}

/* --- Form Controls (Global) --- */
.form-label-custom {
  font-weight: 600;
  font-size: 0.8rem;
  color: var(--gray-600);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 0.4rem;
}

.form-control-custom {
  padding: 0.7rem 1rem;
  border: 1.5px solid var(--gray-200);
  border-radius: var(--border-radius-sm);
  font-size: 0.9rem;
  font-family: 'Inter', sans-serif;
  color: var(--gray-800);
  background: var(--gray-50);
  transition: all var(--transition-fast);
}

.form-control-custom:focus {
  outline: none;
  border-color: var(--primary-500);
  box-shadow: 0 0 0 3px rgba(13, 148, 136, 0.15);
  background: #fff;
}

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

.form-select-custom {
  padding: 0.7rem 1rem;
  border: 1.5px solid var(--gray-200);
  border-radius: var(--border-radius-sm);
  font-size: 0.9rem;
  font-family: 'Inter', sans-serif;
  color: var(--gray-800);
  background-color: var(--gray-50);
  transition: all var(--transition-fast);
}

.form-select-custom:focus {
  outline: none;
  border-color: var(--primary-500);
  box-shadow: 0 0 0 3px rgba(13, 148, 136, 0.15);
  background-color: #fff;
}

/* --- Buttons --- */
.btn-primary-custom {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.7rem 1.5rem;
  background: var(--gradient-primary);
  border: none;
  border-radius: var(--border-radius-sm);
  color: #fff;
  font-weight: 600;
  font-size: 0.9rem;
  font-family: 'Inter', sans-serif;
  cursor: pointer;
  transition: all var(--transition-base);
  box-shadow: var(--shadow-primary);
}

.btn-primary-custom:hover {
  transform: translateY(-2px);
  box-shadow: 0 14px 35px -5px rgba(13, 148, 136, 0.4);
  color: #fff;
}

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

.btn-secondary-custom {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.7rem 1.5rem;
  background: #fff;
  border: 1.5px solid var(--gray-200);
  border-radius: var(--border-radius-sm);
  color: var(--gray-700);
  font-weight: 600;
  font-size: 0.9rem;
  font-family: 'Inter', sans-serif;
  cursor: pointer;
  transition: all var(--transition-base);
}

.btn-secondary-custom:hover {
  background: var(--gray-50);
  border-color: var(--gray-300);
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
  color: var(--gray-700);
}

.btn-danger-custom {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.7rem 1.5rem;
  background: var(--danger);
  border: none;
  border-radius: var(--border-radius-sm);
  color: #fff;
  font-weight: 600;
  font-size: 0.9rem;
  font-family: 'Inter', sans-serif;
  cursor: pointer;
  transition: all var(--transition-base);
}

.btn-danger-custom:hover {
  background: #dc2626;
  transform: translateY(-1px);
  box-shadow: 0 10px 25px -5px rgba(239, 68, 68, 0.35);
  color: #fff;
}

.btn-success-custom {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.7rem 1.5rem;
  background: var(--success);
  border: none;
  border-radius: var(--border-radius-sm);
  color: #fff;
  font-weight: 600;
  font-size: 0.9rem;
  font-family: 'Inter', sans-serif;
  cursor: pointer;
  transition: all var(--transition-base);
}

.btn-success-custom:hover {
  background: #059669;
  transform: translateY(-1px);
  box-shadow: 0 10px 25px -5px rgba(16, 185, 129, 0.35);
  color: #fff;
}

.btn-warning-custom {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.55rem 1rem;
  background: var(--warning);
  border: none;
  border-radius: var(--border-radius-sm);
  color: #fff;
  font-weight: 600;
  font-size: 0.8rem;
  font-family: 'Inter', sans-serif;
  cursor: pointer;
  transition: all var(--transition-base);
}

.btn-warning-custom:hover {
  background: #d97706;
  transform: translateY(-1px);
  color: #fff;
}

.btn-sm-custom {
  padding: 0.4rem 0.85rem;
  font-size: 0.78rem;
  border-radius: 6px;
}

.btn-icon {
  width: 36px;
  height: 36px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--border-radius-sm);
  border: none;
  cursor: pointer;
  transition: all var(--transition-fast);
  font-size: 0.9rem;
}

/* =========================================================
   LAYOUT — Sidebar + Main Content
   ========================================================= */
.app-layout {
  display: flex;
  min-height: 100vh;
}

/* --- Sidebar --- */
.sidebar {
  position: fixed;
  top: 0;
  left: 0;
  width: var(--sidebar-width);
  height: 100vh;
  background: var(--gradient-sidebar);
  z-index: 1000;
  display: flex;
  flex-direction: column;
  transition: all var(--transition-base);
  overflow-y: auto;
  overflow-x: hidden;
}

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

.sidebar-logo {
  width: 40px;
  height: 40px;
  background: var(--gradient-primary);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  color: #fff;
  flex-shrink: 0;
}

.sidebar-brand {
  display: flex;
  flex-direction: column;
}

.sidebar-brand-name {
  font-size: 0.95rem;
  font-weight: 700;
  color: #fff;
  line-height: 1.2;
}

.sidebar-brand-sub {
  font-size: 0.7rem;
  color: var(--gray-400);
  font-weight: 400;
}

.sidebar-nav {
  flex: 1;
  padding: 1rem 0.75rem;
}

.sidebar-nav-section {
  margin-bottom: 1.5rem;
}

.sidebar-nav-title {
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1.2px;
  color: var(--gray-500);
  padding: 0 0.75rem;
  margin-bottom: 0.5rem;
}

.sidebar-nav-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.65rem 0.75rem;
  border-radius: var(--border-radius-sm);
  color: var(--gray-400);
  font-size: 0.85rem;
  font-weight: 500;
  transition: all var(--transition-fast);
  margin-bottom: 2px;
  cursor: pointer;
  text-decoration: none;
}

.sidebar-nav-item i {
  font-size: 1.1rem;
  width: 22px;
  text-align: center;
  flex-shrink: 0;
}

.sidebar-nav-item:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
}

.sidebar-nav-item.active {
  background: rgba(13, 148, 136, 0.2);
  color: var(--primary-400);
  font-weight: 600;
}

.sidebar-nav-item.active::before {
  content: '';
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 3px;
  height: 24px;
  background: var(--primary-400);
  border-radius: 0 4px 4px 0;
}

.sidebar-footer {
  padding: 1rem 1.25rem;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  flex-shrink: 0;
}

.sidebar-user {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.sidebar-user-avatar {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  background: var(--gradient-card-2);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-weight: 700;
  font-size: 0.85rem;
  flex-shrink: 0;
}

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

.sidebar-user-name {
  font-size: 0.8rem;
  font-weight: 600;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sidebar-user-role {
  font-size: 0.7rem;
  color: var(--gray-400);
}

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

/* --- Top Navbar --- */
.top-navbar {
  height: var(--navbar-height);
  background: rgba(255, 255, 255, 0.8);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--gray-200);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 2rem;
  position: sticky;
  top: 0;
  z-index: 100;
}

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

.sidebar-toggle {
  display: none;
  width: 38px;
  height: 38px;
  border: none;
  background: var(--gray-100);
  border-radius: var(--border-radius-sm);
  color: var(--gray-600);
  font-size: 1.2rem;
  cursor: pointer;
  transition: all var(--transition-fast);
  align-items: center;
  justify-content: center;
}

.sidebar-toggle:hover {
  background: var(--gray-200);
}

.page-title-section h1 {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--gray-900);
  margin: 0;
}

.page-title-section p {
  font-size: 0.78rem;
  color: var(--gray-500);
  margin: 0;
}

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

.navbar-icon-btn {
  width: 38px;
  height: 38px;
  border: none;
  background: var(--gray-100);
  border-radius: var(--border-radius-sm);
  color: var(--gray-600);
  font-size: 1.1rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  transition: all var(--transition-fast);
}

.navbar-icon-btn:hover {
  background: var(--gray-200);
  color: var(--gray-800);
}

.navbar-notification-badge {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 8px;
  height: 8px;
  background: var(--danger);
  border-radius: 50%;
  border: 2px solid #fff;
}

/* --- Content Area --- */
.content-area {
  padding: 2rem;
}

/* =========================================================
   DASHBOARD COMPONENTS
   ========================================================= */

/* --- Stat Cards --- */
.stat-card {
  background: #fff;
  border-radius: var(--border-radius);
  padding: 1.5rem;
  position: relative;
  overflow: hidden;
  box-shadow: var(--shadow-card);
  transition: all var(--transition-base);
  border: 1px solid transparent;
}

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

.stat-card-gradient {
  color: #fff;
  border: none;
}

.stat-card-gradient.teal { background: var(--gradient-card-1); }
.stat-card-gradient.purple { background: var(--gradient-card-2); }
.stat-card-gradient.orange { background: var(--gradient-card-3); }
.stat-card-gradient.pink { background: var(--gradient-card-4); }

.stat-card-gradient::before {
  content: '';
  position: absolute;
  top: -30%;
  right: -20%;
  width: 140px;
  height: 140px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.12);
}

.stat-card-gradient::after {
  content: '';
  position: absolute;
  bottom: -20%;
  right: 10%;
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.08);
}

.stat-card-icon {
  width: 48px;
  height: 48px;
  border-radius: var(--border-radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.3rem;
  margin-bottom: 1rem;
}

.stat-card-gradient .stat-card-icon {
  background: rgba(255, 255, 255, 0.2);
  color: #fff;
}

.stat-card:not(.stat-card-gradient) .stat-card-icon {
  background: var(--primary-50);
  color: var(--primary-600);
}

.stat-card-value {
  font-size: 1.8rem;
  font-weight: 800;
  line-height: 1;
  margin-bottom: 0.25rem;
  position: relative;
  z-index: 1;
}

.stat-card-label {
  font-size: 0.8rem;
  font-weight: 500;
  opacity: 0.85;
  position: relative;
  z-index: 1;
}

.stat-card-change {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  font-size: 0.75rem;
  font-weight: 600;
  margin-top: 0.5rem;
  padding: 0.2rem 0.5rem;
  border-radius: 20px;
  position: relative;
  z-index: 1;
}

.stat-card-gradient .stat-card-change {
  background: rgba(255, 255, 255, 0.2);
}

.stat-card-change.up {
  color: var(--success);
  background: rgba(16, 185, 129, 0.1);
}

.stat-card-change.down {
  color: var(--danger);
  background: rgba(239, 68, 68, 0.1);
}

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

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

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

.chart-card-title {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--gray-900);
}

.chart-card-subtitle {
  font-size: 0.75rem;
  color: var(--gray-500);
  margin-top: 2px;
}

.chart-card-body {
  padding: 1.5rem;
}

.chart-card-actions {
  display: flex;
  gap: 0.25rem;
}

.chart-filter-btn {
  padding: 0.3rem 0.7rem;
  border: 1px solid var(--gray-200);
  background: transparent;
  border-radius: 6px;
  font-size: 0.72rem;
  font-weight: 500;
  color: var(--gray-500);
  cursor: pointer;
  transition: all var(--transition-fast);
  font-family: 'Inter', sans-serif;
}

.chart-filter-btn:hover,
.chart-filter-btn.active {
  background: var(--primary-600);
  border-color: var(--primary-600);
  color: #fff;
}

/* =========================================================
   DATA TABLES
   ========================================================= */
.data-card {
  background: #fff;
  border-radius: var(--border-radius);
  box-shadow: var(--shadow-card);
  border: 1px solid var(--gray-100);
  overflow: hidden;
}

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

.data-card-title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--gray-900);
}

.data-card-body {
  padding: 0;
}

.data-card-body .table {
  margin-bottom: 0;
}

/* Custom table styling */
.table-custom {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
}

.table-custom thead th {
  background: var(--gray-50);
  padding: 0.8rem 1rem;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--gray-600);
  border-bottom: 2px solid var(--gray-100);
  white-space: nowrap;
}

.table-custom tbody td {
  padding: 0.85rem 1rem;
  font-size: 0.85rem;
  color: var(--gray-700);
  border-bottom: 1px solid var(--gray-100);
  vertical-align: middle;
}

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

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

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

/* --- Badges --- */
.badge-custom {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.3rem 0.7rem;
  border-radius: 20px;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.3px;
}

.badge-success {
  background: rgba(16, 185, 129, 0.1);
  color: #059669;
}

.badge-warning {
  background: rgba(245, 158, 11, 0.1);
  color: #d97706;
}

.badge-danger {
  background: rgba(239, 68, 68, 0.1);
  color: #dc2626;
}

.badge-info {
  background: rgba(59, 130, 246, 0.1);
  color: #2563eb;
}

.badge-primary {
  background: rgba(13, 148, 136, 0.1);
  color: var(--primary-700);
}

.badge-purple {
  background: rgba(139, 92, 246, 0.1);
  color: #7c3aed;
}

/* --- Action Buttons in Tables --- */
.action-btns {
  display: flex;
  gap: 0.3rem;
}

.action-btn {
  width: 32px;
  height: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: none;
  border-radius: 6px;
  font-size: 0.85rem;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.action-btn-view {
  background: rgba(59, 130, 246, 0.1);
  color: var(--info);
}
.action-btn-view:hover {
  background: var(--info);
  color: #fff;
}

.action-btn-edit {
  background: rgba(245, 158, 11, 0.1);
  color: var(--warning);
}
.action-btn-edit:hover {
  background: var(--warning);
  color: #fff;
}

.action-btn-delete {
  background: rgba(239, 68, 68, 0.1);
  color: var(--danger);
}
.action-btn-delete:hover {
  background: var(--danger);
  color: #fff;
}

.action-btn-print {
  background: rgba(13, 148, 136, 0.1);
  color: var(--primary-600);
}
.action-btn-print:hover {
  background: var(--primary-600);
  color: #fff;
}

/* =========================================================
   FORM PAGE
   ========================================================= */
.form-card {
  background: #fff;
  border-radius: var(--border-radius);
  box-shadow: var(--shadow-card);
  border: 1px solid var(--gray-100);
  overflow: hidden;
}

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

.form-card-title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--gray-900);
}

.form-card-body {
  padding: 1.5rem;
}

.form-section-title {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--gray-800);
  padding-bottom: 0.5rem;
  border-bottom: 2px solid var(--primary-100);
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.form-section-title i {
  color: var(--primary-600);
}

/* =========================================================
   TIMELINE (Riwayat Rekam Medis)
   ========================================================= */
.timeline {
  position: relative;
  padding-left: 2rem;
}

.timeline::before {
  content: '';
  position: absolute;
  left: 8px;
  top: 0;
  bottom: 0;
  width: 2px;
  background: linear-gradient(to bottom, var(--primary-400) 0%, var(--gray-200) 100%);
}

.timeline-item {
  position: relative;
  padding-bottom: 2rem;
  animation: fadeInUp 0.5s ease forwards;
  opacity: 0;
}

.timeline-item:nth-child(1) { animation-delay: 0s; }
.timeline-item:nth-child(2) { animation-delay: 0.1s; }
.timeline-item:nth-child(3) { animation-delay: 0.2s; }
.timeline-item:nth-child(4) { animation-delay: 0.3s; }
.timeline-item:nth-child(5) { animation-delay: 0.4s; }

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

.timeline-dot {
  position: absolute;
  left: -2rem;
  top: 0.25rem;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--primary-500);
  border: 3px solid #fff;
  box-shadow: 0 0 0 3px rgba(13, 148, 136, 0.2);
  z-index: 1;
}

.timeline-dot.warning {
  background: var(--warning);
  box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.2);
}

.timeline-dot.danger {
  background: var(--danger);
  box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.2);
}

.timeline-card {
  background: #fff;
  border-radius: var(--border-radius);
  padding: 1.25rem;
  box-shadow: var(--shadow-card);
  border: 1px solid var(--gray-100);
  transition: all var(--transition-base);
}

.timeline-card:hover {
  box-shadow: var(--shadow-lg);
  border-color: var(--primary-200);
}

.timeline-date {
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--primary-600);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.timeline-title {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--gray-900);
  margin: 0.35rem 0;
}

.timeline-text {
  font-size: 0.82rem;
  color: var(--gray-600);
  line-height: 1.5;
}

.timeline-meta {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-top: 0.75rem;
  flex-wrap: wrap;
}

.timeline-meta-item {
  display: flex;
  align-items: center;
  gap: 0.3rem;
  font-size: 0.72rem;
  color: var(--gray-500);
}

.timeline-meta-item i {
  color: var(--primary-500);
}

/* =========================================================
   SANTRI PROFILE HEADER
   ========================================================= */
.profile-header {
  background: var(--gradient-hero);
  border-radius: var(--border-radius-lg);
  padding: 2rem;
  color: #fff;
  display: flex;
  align-items: center;
  gap: 1.5rem;
  margin-bottom: 1.5rem;
  position: relative;
  overflow: hidden;
}

.profile-header::before {
  content: '';
  position: absolute;
  top: -50%;
  right: -10%;
  width: 300px;
  height: 300px;
  border-radius: 50%;
  background: rgba(255,255,255,0.08);
}

.profile-avatar {
  width: 80px;
  height: 80px;
  border-radius: var(--border-radius);
  background: rgba(255,255,255,0.15);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  flex-shrink: 0;
  border: 3px solid rgba(255,255,255,0.3);
  position: relative;
  z-index: 1;
}

.profile-info {
  position: relative;
  z-index: 1;
}

.profile-name {
  font-size: 1.3rem;
  font-weight: 800;
}

.profile-detail {
  font-size: 0.82rem;
  opacity: 0.9;
  margin-top: 0.25rem;
}

.profile-badges {
  display: flex;
  gap: 0.5rem;
  margin-top: 0.5rem;
}

.profile-badge {
  padding: 0.25rem 0.7rem;
  background: rgba(255,255,255,0.2);
  border-radius: 20px;
  font-size: 0.72rem;
  font-weight: 600;
}

/* =========================================================
   MODALS
   ========================================================= */
.modal-content {
  border: none;
  border-radius: var(--border-radius-lg);
  box-shadow: var(--shadow-2xl);
}

.modal-header {
  border-bottom: 1px solid var(--gray-100);
  padding: 1.25rem 1.5rem;
}

.modal-title {
  font-weight: 700;
  font-size: 1.05rem;
  color: var(--gray-900);
}

.modal-body {
  padding: 1.5rem;
}

.modal-footer {
  border-top: 1px solid var(--gray-100);
  padding: 1rem 1.5rem;
}

/* =========================================================
   REPORT / LAPORAN
   ========================================================= */
.report-filter-card {
  background: #fff;
  border-radius: var(--border-radius);
  box-shadow: var(--shadow-card);
  border: 1px solid var(--gray-100);
  padding: 1.5rem;
  margin-bottom: 1.5rem;
}

.report-filter-title {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--gray-800);
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.report-filter-title i {
  color: var(--primary-600);
}

/* =========================================================
   EMPTY STATE
   ========================================================= */
.empty-state {
  text-align: center;
  padding: 3rem 1.5rem;
}

.empty-state-icon {
  width: 80px;
  height: 80px;
  background: var(--gray-100);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  color: var(--gray-400);
  margin: 0 auto 1rem;
}

.empty-state-title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--gray-700);
  margin-bottom: 0.5rem;
}

.empty-state-text {
  font-size: 0.85rem;
  color: var(--gray-500);
  max-width: 400px;
  margin: 0 auto;
}

/* =========================================================
   ANIMATIONS
   ========================================================= */
.fade-in {
  animation: fadeIn 0.5s ease forwards;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.slide-in-left {
  animation: slideInLeft 0.4s ease forwards;
}

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

.scale-in {
  animation: scaleIn 0.3s var(--transition-spring) forwards;
}

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

/* Stagger children animation */
.stagger-children > * {
  opacity: 0;
  animation: fadeInUp 0.5s ease forwards;
}

.stagger-children > *:nth-child(1) { animation-delay: 0.05s; }
.stagger-children > *:nth-child(2) { animation-delay: 0.1s; }
.stagger-children > *:nth-child(3) { animation-delay: 0.15s; }
.stagger-children > *:nth-child(4) { animation-delay: 0.2s; }
.stagger-children > *:nth-child(5) { animation-delay: 0.25s; }
.stagger-children > *:nth-child(6) { animation-delay: 0.3s; }

/* =========================================================
   DATATABLE OVERRIDES
   ========================================================= */
.dataTables_wrapper .dataTables_length select,
.dataTables_wrapper .dataTables_filter input {
  border: 1.5px solid var(--gray-200);
  border-radius: 6px;
  padding: 0.4rem 0.75rem;
  font-size: 0.85rem;
  font-family: 'Inter', sans-serif;
  outline: none;
}

.dataTables_wrapper .dataTables_filter input:focus {
  border-color: var(--primary-500);
  box-shadow: 0 0 0 3px rgba(13, 148, 136, 0.15);
}

.dataTables_wrapper .dataTables_length,
.dataTables_wrapper .dataTables_filter,
.dataTables_wrapper .dataTables_info,
.dataTables_wrapper .dataTables_paginate {
  padding: 0.75rem 1rem;
  font-size: 0.82rem;
  color: var(--gray-600);
}

.dataTables_wrapper .dataTables_paginate .paginate_button {
  padding: 0.3rem 0.65rem;
  margin: 0 2px;
  border-radius: 6px !important;
  border: 1px solid var(--gray-200) !important;
  font-size: 0.8rem;
  color: var(--gray-600) !important;
  background: transparent !important;
  transition: all var(--transition-fast);
}

.dataTables_wrapper .dataTables_paginate .paginate_button:hover {
  background: var(--primary-50) !important;
  border-color: var(--primary-500) !important;
  color: var(--primary-700) !important;
}

.dataTables_wrapper .dataTables_paginate .paginate_button.current {
  background: var(--primary-600) !important;
  border-color: var(--primary-600) !important;
  color: #fff !important;
}

/* =========================================================
   RESPONSIVE
   ========================================================= */
@media (max-width: 991.98px) {
  .sidebar {
    transform: translateX(-100%);
  }

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

  .sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 999;
    backdrop-filter: blur(4px);
  }

  .sidebar-overlay.show {
    display: block;
  }

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

  .sidebar-toggle {
    display: flex;
  }

  .content-area {
    padding: 1rem;
  }

  .top-navbar {
    padding: 0 1rem;
  }

  .profile-header {
    flex-direction: column;
    text-align: center;
  }
}

@media (max-width: 575.98px) {
  .stat-card-value {
    font-size: 1.5rem;
  }

  .login-card {
    margin: 1rem;
    padding: 2rem;
  }

  .data-card-header {
    flex-direction: column;
    align-items: flex-start;
  }
}

/* =========================================================
   UTILITIES
   ========================================================= */
.text-primary-custom { color: var(--primary-600); }
.text-success { color: var(--success); }
.text-warning { color: var(--warning); }
.text-danger { color: var(--danger); }
.text-info { color: var(--info); }
.text-muted-custom { color: var(--gray-500); }

.bg-primary-light { background: var(--primary-50); }
.bg-success-light { background: rgba(16, 185, 129, 0.1); }
.bg-warning-light { background: rgba(245, 158, 11, 0.1); }
.bg-danger-light { background: rgba(239, 68, 68, 0.1); }
.bg-info-light { background: rgba(59, 130, 246, 0.1); }

.rounded-custom { border-radius: var(--border-radius); }
.shadow-custom { box-shadow: var(--shadow-card); }

.fw-800 { font-weight: 800; }

/* Password toggle */
.password-toggle {
  position: relative;
}
.password-toggle .toggle-btn {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  border: none;
  background: transparent;
  color: var(--gray-400);
  cursor: pointer;
  font-size: 1rem;
}

/* Checkbox custom */
.form-check-input-custom:checked {
  background-color: var(--primary-600);
  border-color: var(--primary-600);
}

/* Search box */
.search-box {
  position: relative;
}

.search-box input {
  padding-left: 2.5rem;
}

.search-box i {
  position: absolute;
  left: 0.85rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--gray-400);
  font-size: 0.9rem;
}
