/* =========================================
   profil.css — Profile page & navbar dropdown
   ========================================= */

/* ---- USER DROPDOWN TOGGLE ---- */
.user-dropdown-toggle {
  font-size: 0.88rem !important;
  font-weight: 500 !important;
  color: var(--dark) !important;
  padding: 6px 10px !important;
  border: 1.5px solid var(--border) !important;
  border-radius: 100px !important;
  transition: all .2s !important;
}

.user-dropdown-toggle:hover {
  background: var(--cream) !important;
  border-color: var(--gold) !important;
}

.user-avatar-sm {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--warm-brown), #A05C40);
  color: #fff;
  font-size: 0.7rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

/* ---- DROPDOWN MENU ---- */
.user-dropdown-menu {
  min-width: 260px !important;
  border: 1px solid var(--border) !important;
  border-radius: 16px !important;
  box-shadow: 0 12px 40px rgba(0,0,0,0.12) !important;
  padding: 8px !important;
  margin-top: 8px !important;
}

.dropdown-user-info {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 12px 14px;
}

.dui-avatar {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--warm-brown), #A05C40);
  color: #fff;
  font-size: 0.9rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.dui-name {
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--dark);
  line-height: 1.2;
}

.dui-email {
  font-size: 0.78rem;
  color: var(--muted);
  margin-top: 1px;
}

.dui-badge {
  display: inline-block;
  margin-top: 5px;
  font-size: 0.68rem;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 100px;
  background: linear-gradient(135deg, #C8963E, #A57930);
  color: #fff;
  text-transform: uppercase;
  letter-spacing: .05em;
}

.dropdown-divider {
  margin: 4px 0 !important;
  border-color: var(--border) !important;
}

.dropdown-item {
  border-radius: 10px !important;
  font-size: 0.875rem !important;
  padding: 9px 12px !important;
  color: var(--dark) !important;
  transition: all .15s !important;
  display: flex !important;
  align-items: center !important;
  gap: 8px !important;
}

.dropdown-item:hover {
  background: var(--cream) !important;
  color: var(--warm-brown) !important;
}

.dropdown-item.active {
  background: var(--cream) !important;
  color: var(--warm-brown) !important;
  font-weight: 500 !important;
}

.dd-icon { font-size: 1rem; width: 18px; text-align: center; }

.dd-logout { color: #C0392B !important; }
.dd-logout:hover { background: #FDEDEC !important; color: #922B21 !important; }

/* ---- PROFILE BANNER ---- */
.profile-banner {
  background: linear-gradient(160deg, #2C1810 0%, #5C3317 60%, #8B5E3C 100%);
  padding: 48px 0;
}

.profile-hero-inner {
  display: flex;
  align-items: center;
  gap: 24px;
  flex-wrap: wrap;
}

.profile-avatar-lg {
  width: 88px;
  height: 88px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--gold), #A57930);
  color: #fff;
  font-size: 1.8rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  border: 3px solid rgba(255,255,255,0.25);
}

.profile-hero-info { flex: 1; min-width: 0; }

.profile-badge-paket {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 600;
  padding: 3px 12px;
  border-radius: 100px;
  background: rgba(200,150,62,0.25);
  color: var(--gold);
  border: 1px solid rgba(200,150,62,0.4);
  text-transform: uppercase;
  letter-spacing: .06em;
  margin-bottom: 8px;
}

.profile-hero-name {
  font-family: var(--font-display);
  font-size: clamp(1.6rem, 3vw, 2.2rem);
  font-weight: 700;
  color: #fff;
  margin-bottom: 8px;
}

.profile-hero-meta {
  font-size: 0.85rem;
  color: rgba(255,255,255,0.6);
  margin: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.profile-sep { opacity: .4; }

/* ---- STATS BAR ---- */
.profile-stats-bar {
  background: var(--dark);
  border-bottom: 1px solid rgba(255,255,255,0.06);
}

.pstat {
  padding: 20px 24px;
  text-align: center;
  border-right: 1px solid rgba(255,255,255,0.07);
}

.pstat:last-child { border-right: none; }

.pstat-num {
  font-family: var(--font-display);
  font-size: 1.8rem;
  font-weight: 700;
  color: var(--gold);
  line-height: 1;
}

.pstat-label {
  font-size: 0.75rem;
  color: rgba(255,255,255,0.45);
  text-transform: uppercase;
  letter-spacing: .07em;
  margin-top: 4px;
}

/* ---- SIDEBAR ---- */
.profile-sidebar {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 16px;
  position: sticky;
  top: 80px;
}

.profile-sidenav {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.sidenav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border-radius: 10px;
  font-size: 0.88rem;
  color: var(--muted);
  text-decoration: none;
  transition: all .18s;
  cursor: pointer;
}

.sidenav-item:hover {
  background: var(--cream);
  color: var(--dark);
}

.sidenav-item.active {
  background: var(--cream);
  color: var(--warm-brown);
  font-weight: 500;
}

.sidenav-logout {
  color: #C0392B !important;
  margin-top: 4px;
}

.sidenav-logout:hover { background: #FDEDEC !important; }

/* ---- TAB PANELS ---- */
.tab-content-panel { display: none; }
.tab-content-panel.active { display: block; }

.panel-header {
  margin-bottom: 28px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--border);
}

.panel-title {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.4rem;
  margin-bottom: 4px;
}

.panel-desc { font-size: 0.88rem; color: var(--muted); margin: 0; }

/* ---- INFO GRID ---- */
.info-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin-bottom: 28px;
}

@media (max-width: 576px) { .info-grid { grid-template-columns: 1fr; } }

.info-field label {
  font-size: 0.75rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: .07em;
  color: var(--muted);
  display: block;
  margin-bottom: 4px;
}

.info-value {
  font-size: 0.95rem;
  color: var(--dark);
  padding: 10px 14px;
  background: var(--cream);
  border-radius: 10px;
  border: 1px solid var(--border);
}

.badge-paket {
  display: inline-block;
  background: linear-gradient(135deg, #C8963E, #A57930);
  color: #fff;
  font-size: 0.75rem;
  font-weight: 600;
  padding: 4px 12px;
  border-radius: 100px;
}

.panel-action { padding-top: 8px; }

/* ---- LOANS ---- */
.loan-list { display: flex; flex-direction: column; gap: 16px; }

.loan-item {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 14px;
  flex-wrap: wrap;
}

.loan-cover {
  width: 52px;
  height: 68px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.loan-info { flex: 1; min-width: 0; }
.loan-info h6 { font-weight: 600; margin-bottom: 2px; font-size: 0.95rem; }
.loan-info p { font-size: 0.8rem; color: var(--muted); margin-bottom: 8px; }

.loan-meta { display: flex; gap: 12px; flex-wrap: wrap; }
.loan-date { font-size: 0.78rem; color: var(--muted); }
.loan-due { font-size: 0.78rem; font-weight: 500; padding: 2px 8px; border-radius: 6px; }
.due-ok { background: #EAF6EE; color: #1E8449; }
.due-warn { background: #FEF9E7; color: #B7770D; }
.due-late { background: #FDEDEC; color: #922B21; }

/* ---- RIWAYAT TABLE ---- */
.riwayat-table { font-size: 0.88rem; }
.riwayat-table th { font-size: 0.75rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); font-weight: 500; border-bottom: 1px solid var(--border) !important; }
.riwayat-table td { vertical-align: middle; padding: 12px 8px; border-bottom: 1px solid var(--border) !important; }

.badge-status { font-size: 0.72rem; font-weight: 600; padding: 3px 10px; border-radius: 100px; }
.badge-status.ok { background: #EAF6EE; color: #1E8449; }
.badge-status.late { background: #FDEDEC; color: #922B21; }

/* ---- FAVORIT ---- */
.fav-book-card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 14px;
  overflow: hidden;
}

.fav-cover {
  height: 100px;
  position: relative;
  display: flex;
  align-items: flex-start;
  justify-content: flex-end;
  padding: 8px;
}

.fav-remove {
  background: rgba(0,0,0,0.35);
  color: #fff;
  border: none;
  border-radius: 50%;
  width: 24px;
  height: 24px;
  font-size: 1rem;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background .15s;
}

.fav-remove:hover { background: rgba(192,57,43,0.8); }

.fav-info { padding: 12px; }

/* ---- NOTIF ---- */
.notif-list { display: flex; flex-direction: column; gap: 12px; }

.notif-item {
  display: flex;
  gap: 14px;
  align-items: flex-start;
  padding: 16px;
  border-radius: 12px;
  background: var(--cream);
  border: 1px solid var(--border);
}

.notif-info { border-color: #AED6F1; background: #EBF5FB; }
.notif-success { border-color: #A9DFBF; background: #EAFAF1; }

.notif-icon { font-size: 1.3rem; flex-shrink: 0; }
.notif-body p { font-size: 0.88rem; margin-bottom: 4px; color: var(--dark); }
.notif-time { font-size: 0.75rem; color: var(--muted); }

/* ---- SECURITY ---- */
.security-card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 24px;
}

.security-card h6 { font-weight: 600; margin-bottom: 4px; }
.danger-zone { border-color: #F5B7B1; }

.session-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 0;
  border-top: 1px solid var(--border);
  margin-top: 12px;
}

/* ---- EDIT MODAL ---- */
.edit-modal-box {
  background: #fff;
  border-radius: 20px;
  padding: 32px;
  width: 100%;
  max-width: 500px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 24px 60px rgba(0,0,0,0.2);
}

.edit-avatar-preview {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--warm-brown), #A05C40);
  color: #fff;
  font-size: 1.4rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto;
}
