/* ==========================================================================
   1. VARIABLES & THEMING (Pilihan Warna & Fondasi Visual)
   ========================================================================== */
:root {
  /* Main Colors */
  --primary: #0d9488;          /* Hijau Teal/Emerald Medis */
  --primary-hover: #0f766e;
  --primary-light: #f0fdf4;    /* Hijau sangat muda untuk background card/badge */

  --secondary: #64748b;        /* Muted Gray untuk teks sekunder */
  --secondary-light: #f8fafc;

  /* Status Colors */
  --warning: #f59e0b;          /* Kuning Alert/Pending */
  --warning-light: #fffbeb;
  --success: #10b981;          /* Hijau Aktif/Approved */
  --danger: #ef4444;           /* Merah Error/Dibatalkan */
  --danger-light: #fef2f2;
  --info: #0284c7;             /* Biru Informasi */
  --info-light: #f0f9ff;

  /* Neutrals & Surfaces */
  --bg-body: #f8fafc;
  --surface: #ffffff;
  --border: #e2e8f0;
  --text-main: #0f172a;
  --text-muted: #64748b;

  /* Typography */
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;

  /* Shadows & Radius */
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 20px;
  --radius-full: 9999px;

  --shadow-sm: 0 1px 3px rgba(0,0,0,0.05), 0 1px 2px rgba(0,0,0,0.03);
  --shadow-md: 0 4px 6px -1px rgba(0,0,0,0.05), 0 2px 4px -1px rgba(0,0,0,0.03);
}

/* ==========================================================================
   2. BASE RESET
   ========================================================================== */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: var(--font-sans);
  background-color: var(--bg-body);
  color: var(--text-main);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

a {
  color: var(--primary);
  text-decoration: none;
}
a:hover {
  text-decoration: underline;
}

/* ==========================================================================
   3. LAYOUT & GRID SYSTEM
   ========================================================================== */
.container {
  width: 100%;
  max-width: 1200px;
  margin-left: auto;
  margin-right: auto;
  padding-left: 1.5rem;
  padding-right: 1.5rem;
}

.py-4 { padding-top: 1.5rem; padding-bottom: 1.5rem; }
.mb-2 { margin-bottom: 0.5rem; }
.mb-4 { margin-bottom: 1.5rem; }

/* Grid Generator */
.grid {
  display: grid;
  gap: 1.5rem;
}
.grid-cols-4 { grid-template-columns: repeat(4, 1fr); }
.grid-cols-2 { grid-template-columns: repeat(2, 1fr); }
.grid-cols-12 { grid-template-columns: repeat(12, 1fr); }

@media (max-width: 992px) {
  .grid-cols-4 { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 640px) {
  .grid-cols-4, .grid-cols-2 { grid-template-columns: 1fr; }
}

/* ==========================================================================
   4. COMPONENTS (Card, Alert, Badge, Button, Table, Form)
   ========================================================================== */

/* --- CARDS --- */
.card {
  background: var(--surface);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  padding: 1.25rem;
  transition: transform 0.2s, box-shadow 0.2s;
}

/* --- BUTTONS --- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.5rem 1.25rem;
  font-size: 0.875rem;
  font-weight: 600;
  border-radius: var(--radius-full);
  border: 1px solid transparent;
  cursor: pointer;
  transition: all 0.2s ease;
  text-decoration: none;
}

.btn-primary {
  background-color: var(--primary);
  color: #ffffff;
}
.btn-primary:hover {
  background-color: var(--primary-hover);
  color: #ffffff;
  text-decoration: none;
}

.btn-warning {
  background-color: var(--warning);
  color: #ffffff;
}
.btn-warning:hover {
  opacity: 0.9;
  color: #ffffff;
  text-decoration: none;
}

.btn-outline {
  background: transparent;
  border-color: var(--border);
  color: var(--text-main);
}
.btn-outline:hover {
  background-color: var(--secondary-light);
  text-decoration: none;
}

.btn-sm {
  padding: 0.35rem 0.85rem;
  font-size: 0.775rem;
}

/* --- ALERTS --- */
.alert {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1rem 1.25rem;
  border-radius: var(--radius-md);
  margin-bottom: 1.5rem;
}
.alert-warning {
  background-color: var(--warning-light);
  border: 1px solid #fde68a;
  color: #92400e;
}
.alert-danger {
  background-color: var(--danger-light);
  border: 1px solid #fecaca;
  color: #991b1b;
}

/* --- BADGES --- */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 0.25rem 0.75rem;
  font-size: 0.75rem;
  font-weight: 600;
  border-radius: var(--radius-full);
}
.badge-warning { background: var(--warning-light); color: #b45309; }
.badge-success { background: var(--primary-light); color: var(--primary-hover); }
.badge-secondary { background: var(--secondary-light); color: var(--secondary); border: 1px solid var(--border); }

/* --- TABLES --- */
.table-container {
  width: 100%;
  overflow-x: auto;
}
.table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 0.875rem;
}
.table th {
  background-color: var(--secondary-light);
  color: var(--text-muted);
  font-weight: 600;
  padding: 0.75rem 1rem;
  text-transform: uppercase;
  font-size: 0.75rem;
  border-bottom: 1px solid var(--border);
}
.table td {
  padding: 1rem;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}
.table tr:last-child td { border-bottom: none; }
.table tr:hover td { background-color: #fafafa; }

/* --- FORMS & INPUTS --- */
.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}
.form-label {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-main);
}
.form-control {
  width: 100%;
  padding: 0.65rem 1rem;
  font-size: 0.875rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  outline: none;
  background-color: #ffffff;
  transition: border-color 0.2s;
}
.form-control:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(13, 148, 136, 0.15);
}
.form-control.is-invalid {
  border-color: var(--danger);
}
.invalid-feedback {
  color: var(--danger);
  font-size: 0.75rem;
  margin-top: 0.25rem;
}

/* --- CUSTOM INPUT WITH ICON (PERBAIKAN UTAMA) --- */
.input-group-custom {
  display: flex;
  align-items: center;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background-color: #ffffff;
  padding: 0 0.85rem;
  transition: border-color 0.2s, box-shadow 0.2s;
}

/* Border berubah saat diklik / diisi */
.input-group-custom:focus-within {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(13, 148, 136, 0.15);
}

.input-group-custom i {
  color: var(--text-muted);
  font-size: 1.1rem;
  margin-right: 0.5rem;
  flex-shrink: 0;
}

.input-group-custom .form-control {
  border: none !important;
  box-shadow: none !important;
  padding: 0.65rem 0.25rem !important;
  background: transparent !important;
  width: 100%;
}

.input-group-custom.is-invalid {
  border-color: var(--danger);
}

/* --- CUSTOM SWITCH --- */
.switch {
  position: relative;
  display: inline-block;
  width: 44px;
  height: 24px;
}
.switch input { opacity: 0; width: 0; height: 0; }
.slider {
  position: absolute; cursor: pointer;
  top: 0; left: 0; right: 0; bottom: 0;
  background-color: #cbd5e1;
  transition: .3s;
  border-radius: var(--radius-full);
}
.slider:before {
  position: absolute; content: "";
  height: 18px; width: 18px;
  left: 3px; bottom: 3px;
  background-color: white;
  transition: .3s;
  border-radius: 50%;
}
input:checked + .slider { background-color: var(--success); }
input:checked + .slider:before { transform: translateX(20px); }
input:disabled + .slider { opacity: 0.5; cursor: not-allowed; }

/* ==========================================================================
   5. UTILITIES
   ========================================================================== */
.flex { display: flex; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-2 { gap: 0.5rem; }
.gap-3 { gap: 0.75rem; }
.text-muted { color: var(--text-muted); }
.text-danger { color: var(--danger); }
.text-sm { font-size: 0.85rem; }
.fw-bold { font-weight: 700; }
.avatar { border-radius: 50%; object-fit: cover; }
.icon-box {
  width: 42px;
  height: 42px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
}

.w-full { width: 100%; }
.text-center { text-align: center; }
.text-end { text-align: right; }
.mt-1 { margin-top: 0.25rem; }
.mt-2 { margin-top: 0.5rem; }
.mb-3 { margin-bottom: 1rem; }
.block { display: block; }


/* ==========================================================================
   6. SPLIT LAYOUT LOGIN PAGE (Sesuai Desain Gambar)
   ========================================================================== */
.login-body-wrapper {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: #dbeafe; /* Warna Background Biru Muda */
  padding: 1.5rem;
  margin: 0;
}

.login-wrapper {
  width: 100%;
  max-width: 900px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  align-items: center;
  gap: 2rem;
}

/* Kolom Kiri - Branding */
.login-left {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 1rem;
}

.brand-container {
  max-width: 320px;
}

.brand-logo {
  width: 180px;
  height: auto;
  margin-bottom: 0.75rem;
}

.brand-title {
  font-size: 1.6rem;
  font-weight: 800;
  color: #0f172a;
  letter-spacing: 1px;
  margin: 0;
  line-height: 1.2;
}

.brand-subtitle {
  font-size: 1.1rem;
  font-weight: 700;
  color: #0f172a;
  letter-spacing: 2px;
  margin-top: 2px;
  margin-bottom: 1.5rem;
}

.brand-description {
  font-size: 0.95rem;
  color: #334155;
  line-height: 1.4;
  font-weight: 500;
}

/* Kolom Kanan - Card Login */
.login-right {
  display: flex;
  justify-content: center;
  align-items: center;
}

.login-card-modern {
  width: 100%;
  max-width: 360px;
  background: #ffffff;
  border-radius: 16px;
  padding: 2.25rem 2rem;
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.05);
}

.auth-title {
  font-size: 1.75rem;
  font-weight: 700;
  color: #0f172a;
  margin-bottom: 0.25rem;
}

.auth-subtitle {
  font-size: 0.9rem;
  color: #475569;
  margin-bottom: 1.75rem;
}

/* Outlined Input Style (Sesuai Desain Border Kotak Hitam Tipis) */
.form-control-outlined {
  width: 100%;
  padding: 0.65rem 0.85rem;
  font-size: 0.9rem;
  border: 1.5px solid #334155;
  border-radius: 2px;
  outline: none;
  background-color: #ffffff;
  color: #0f172a;
  transition: border-color 0.2s;
}

.form-control-outlined::placeholder {
  color: #64748b;
}

.form-control-outlined:focus {
  border-color: #0d9488;
  box-shadow: 0 0 0 2px rgba(13, 148, 136, 0.2);
}

.form-control-outlined.is-invalid {
  border-color: #ef4444;
}

/* Tombol Login Teal Kotak Sesuai Gambar */
.btn-login-flat {
  background-color: #1592a6;
  color: #ffffff;
  font-weight: 600;
  font-size: 1rem;
  padding: 0.65rem 1rem;
  border-radius: 2px;
  border: none;
  cursor: pointer;
  transition: background-color 0.2s;
}

.btn-login-flat:hover {
  background-color: #0e7490;
  color: #ffffff;
}

.link-register {
  color: #1592a6;
  font-weight: 600;
  text-decoration: none;
}

.link-register:hover {
  text-decoration: underline;
}

/* Responsif Layar HP (Mobile) */
@media (max-width: 768px) {
  .login-wrapper {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }

  .brand-logo {
    width: 120px;
  }

  .brand-title {
    font-size: 1.3rem;
  }

  .login-card-modern {
    padding: 1.75rem 1.5rem;
  }
}

/* ==========================================================================
   SIDEBAR CLIENT (SESUAI DESAIN ACUAN)
   ========================================================================== */
.sidebar {
    width: 260px;
    background-color: #2b9cb0; /* Warna Biru Toska / Teal khas gambar */
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    position: fixed;
    top: 0;
    bottom: 0;
    left: 0;
    z-index: 100;
    padding: 1rem 0;
    transition: all 0.3s ease;
}

.sidebar-nav {
    padding: 0.75rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    flex-grow: 1;
}

/* Base Nav Link */
.nav-item-link {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    padding: 0.75rem 1.15rem;
    color: #1e293b; /* Warna teks gelap */
    text-decoration: none !important;
    font-size: 0.9rem;
    font-weight: 700;
    border-radius: 10px;
    transition: all 0.2s ease;
}

.nav-item-link i {
    font-size: 1.25rem;
    color: #1e293b;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Hover State */
.nav-item-link:hover {
    background-color: rgba(255, 255, 255, 0.2);
    color: #0f172a;
}

/* Active State (Kartu Putih seperti di gambar) */
.nav-item-link.active {
    background-color: #ffffff;
    color: #1e293b;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.nav-item-link.active i {
    color: #1e293b;
}

/* Logout Button di bagian bawah sidebar */
.sidebar-footer {
    padding: 0 0.75rem;
}

.btn-sidebar-logout {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 0.85rem;
    padding: 0.75rem 1.15rem;
    color: #1e293b;
    background: transparent;
    border: none;
    font-size: 0.9rem;
    font-weight: 700;
    border-radius: 10px;
    cursor: pointer;
    transition: background 0.2s ease;
    text-align: left;
}

.btn-sidebar-logout i {
    font-size: 1.25rem;
    color: #1e293b;
}

.btn-sidebar-logout:hover {
    background-color: rgba(255, 255, 255, 0.2);
}

/* --- SIDEBAR BRAND / LOGO AREA (FIXED) --- */
a.sidebar-brand,
a.sidebar-brand:hover,
a.sidebar-brand:focus,
a.sidebar-brand:active,
a.sidebar-brand * {
    text-decoration: none !important;
    text-decoration-line: none !important;
    box-shadow: none !important;
}

.sidebar-brand {
    padding: 1.25rem 1rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    /* Hilangkan border-bottom jika tidak ingin ada garis di bawah logo/sidebar header */
    border-bottom: 1px solid #e0f2fe;
}

.sidebar-brand-img {
    height: 42px;
    width: auto;
    object-fit: contain;
    flex-shrink: 0;
}

.sidebar-brand-text {
    display: flex;
    flex-direction: column;
    justify-content: center;
    line-height: 1.1;
}

.sidebar-brand-title {
    font-weight: 400;
    font-size: 0.95rem;
    color: #0369a1;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

.sidebar-brand-subtitle {
    font-weight: 700;
    font-size: 0.7rem;
    color: #0284c7;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    margin-top: 2px;
}


/* ==========================================================================
   HALAMAN PROFIL KLIEN
   ========================================================================== */
.profile-container {
    padding: 2rem;
    background-color: #e0f2fe; /* Background biru muda soft sesuai gambar */
    min-height: calc(100vh - 60px);
}

.page-title {
    font-size: 2rem;
    font-weight: 800;
    color: #0f172a;
    margin-bottom: 0.25rem;
    font-family: Georgia, 'Times New Roman', serif; /* Font serif sesuai acuan gambar */
}

.page-subtitle {
    font-size: 0.95rem;
    color: #334155;
    font-weight: 500;
}

/* Card Utama */
.profile-card {
    background: #ffffff;
    border-radius: 4px;
    border: 2px solid #a855f7; /* Frame border ungu seperti pada gambar */
    padding: 2.5rem 3rem;
    max-width: 580px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.03);
    margin-top: 1.5rem;
}

.profile-card-title {
    font-size: 1.5rem;
    font-weight: 800;
    color: #0f172a;
    text-align: center;
    margin-bottom: 2.5rem;
    font-family: Georgia, 'Times New Roman', serif;
}

/* Row Data Info */
.profile-info-grid {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
    margin-bottom: 2.5rem;
}

.profile-info-row {
    display: grid;
    grid-template-columns: 140px 15px 1fr;
    align-items: center;
    font-size: 0.95rem;
}

.info-label {
    font-weight: 700;
    color: #334155;
}

.info-separator {
    font-weight: 700;
    color: #334155;
}

.info-value {
    font-weight: 600;
    color: #1e293b;
}

/* Tombol Edit Profil */
.profile-action {
    display: flex;
    justify-content: center;
}

.btn-edit-profile {
    background-color: #1b91a8; /* Warna teal khas tombol */
    color: #ffffff;
    font-weight: 700;
    font-size: 0.9rem;
    padding: 0.65rem 2.5rem;
    border-radius: 2px;
    border: none;
    text-decoration: none !important;
    display: inline-block;
    transition: background-color 0.2s ease;
}

.btn-edit-profile:hover {
    background-color: #136f82;
    color: #ffffff;
}

/* Responsive Handling */
@media (max-width: 640px) {
    .profile-card {
        padding: 1.5rem;
    }
    .profile-info-row {
        grid-template-columns: 110px 10px 1fr;
        font-size: 0.875rem;
    }
}
