
:root {
  --radius-sm:   10px;
  --radius-md:   14px;
  --radius-lg:   20px;
  --radius-xl:   22px;
  --radius-2xl:  24px;
  --radius-pill: 50px;
  --radius-full: 9999px;

  /* Transitions */
  --transition-fast:   0.15s ease;
  --transition-normal: 0.25s;
}

/* =========================
   PROFIL PAGE
========================= */
.profil-page {
  min-height: 100vh;
  background: var(--color-bg-page);
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
}

/* ── HERO ── */
.profil-hero {
  height: 250px;
  position: relative;
  overflow: hidden;
  flex-shrink: 0;
}

.profil-hero-gradient {
  position: absolute;
  inset: 0;
  background: var(--color-brand-pale);
}

.profil-hero-pattern {
  position: absolute;
  inset: 0;
  opacity: 0.06;
  background-image: radial-gradient(circle, #fff 1px, transparent 1px);
  background-size: 20px 20px;
}

.profil-hero-shape {
  position: absolute;
  bottom: -40px;
  right: -40px;
  width: 160px;
  height: 160px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.06);
}

/* ── COVER EDIT ── */
.cover-edit-wrap {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 10;
}

.cover-edit-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 7px 13px;
  background: rgba(0, 0, 0, 0.38);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: var(--radius-full);
  color: #fff;
  font-size: 12.5px;
  font-weight: 500;
  cursor: pointer;
  transition: background var(--transition-fast), transform var(--transition-fast);
}

.cover-edit-btn:active {
  transform: scale(0.95);
  background: rgba(0, 0, 0, 0.55);
}

.cover-edit-btn i {
  font-size: 12px;
}

/* Dropdown */
.cover-dropdown {
  display: none;
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  min-width: 160px;
  background: var(--color-bg-card);
  border-radius: var(--radius-md);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.18);
  border: 1px solid rgba(0, 0, 0, 0.07);
  overflow: hidden;
  animation: dropdownIn 0.2s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}

.cover-dropdown.open {
  display: block;
}

@keyframes dropdownIn {
  from { opacity: 0; transform: translateY(-8px) scale(0.96); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

.cover-dropdown-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 13px 16px;
  font-size: 13.5px;
  font-weight: 500;
  color: var(--operasional-detail-title);
  background: none;
  border: none;
  cursor: pointer;
  text-align: left;
  transition: background var(--transition-fast);
}

.cover-dropdown-item:active {
  background: #f5f5f5;
}

.cover-dropdown-item i {
  font-size: 14px;
  color: #888;
  width: 18px;
  text-align: center;
}

.cover-dropdown-sep {
  height: 1px;
  background: #f0f0f0;
  margin: 0 12px;
}

.cover-dropdown-danger {
  color: var(--color-danger-light);
}

.cover-dropdown-danger i {
  color: var(--color-danger-light);
}

/* =====================
   CROP MODAL
===================== */
.crop-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: var(--color-overlay-dark);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 9999;
  align-items: center;
  justify-content: center;
  padding: 16px;
}
.crop-overlay.open { display: flex; }

.crop-modal {
  background: var(--color-crop-bg);
  border-radius: var(--radius-xl);
  width: 100%;
  max-width: 580px;
  overflow: hidden;
  box-shadow: 0 32px 80px rgba(0, 0, 0, 0.7);
  animation: cropIn 0.28s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}

@keyframes cropIn {
  from { opacity: 0; transform: scale(0.90) translateY(24px); }
  to   { opacity: 1; transform: scale(1) translateY(0); }
}

/* Head */
.crop-modal-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  padding: 18px 20px 14px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.07);
}

.crop-modal-title {
  display: block;
  font-size: 15px;
  font-weight: 600;
  color: #fff;
  margin-bottom: 3px;
}

.crop-modal-hint {
  display: block;
  font-size: 11.5px;
  color: rgba(255, 255, 255, 0.38);
}

.crop-modal-close {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.08);
  border: none;
  color: rgba(255, 255, 255, 0.55);
  font-size: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  transition: background var(--transition-fast), color var(--transition-fast);
}

.crop-modal-close:active {
  background: rgba(255, 255, 255, 0.15);
  color: #fff;
}

/* Workspace */
.crop-workspace {
  position: relative;
  width: 100%;
  height: 300px;
  background: var(--color-crop-workspace);
  overflow: hidden;
  user-select: none;
  touch-action: none;
  cursor: crosshair;
}

#cropImg {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  max-width: 100%;
  max-height: 100%;
  pointer-events: none;
  -webkit-user-drag: none;
  display: block;
}

/* Crop Box */
.crop-box {
  position: absolute;
  border: 2px solid var(--color-brand-light);
  box-shadow: 0 0 0 9999px rgba(0, 0, 0, 0.52);
  cursor: move;
  box-sizing: border-box;
  min-width: 40px;
  min-height: 40px;
}

/* Rule of thirds grid */
.crop-grid { position: absolute; inset: 0; pointer-events: none; }
.cg-line   { position: absolute; background: rgba(255, 255, 255, 0.16); }
.cg-h1 { width: 100%; height: 1px; top: 33.33%; }
.cg-h2 { width: 100%; height: 1px; top: 66.66%; }
.cg-v1 { height: 100%; width: 1px; left: 33.33%; }
.cg-v2 { height: 100%; width: 1px; left: 66.66%; }

/* Corner handles */
.crop-handle {
  position: absolute;
  width: 16px;
  height: 16px;
  background: var(--color-brand-light);
  border-radius: 4px;
  border: 2px solid #fff;
  z-index: 10;
}
.ch-tl { top: -8px;    left: -8px;   cursor: nw-resize; }
.ch-tr { top: -8px;    right: -8px;  cursor: ne-resize; }
.ch-bl { bottom: -8px; left: -8px;   cursor: sw-resize; }
.ch-br { bottom: -8px; right: -8px;  cursor: se-resize; }

/* Footer */
.crop-modal-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 20px;
  border-top: 1px solid rgba(255, 255, 255, 0.07);
  gap: 12px;
}

.crop-size-info {
  font-size: 11.5px;
  color: rgba(255, 255, 255, 0.30);
  font-variant-numeric: tabular-nums;
}

.crop-foot-btns {
  display: flex;
  gap: 10px;
  align-items: center;
}

.crop-btn-cancel {
  padding: 9px 18px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.55);
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid rgba(255, 255, 255, 0.09);
  cursor: pointer;
  transition: background var(--transition-fast);
}
.crop-btn-cancel:active { background: rgba(255, 255, 255, 0.12); }

.crop-btn-confirm {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px 20px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 600;
  color: #fff;
  background: linear-gradient(135deg, var(--color-brand-light), var(--color-brand-mid));
  border: none;
  cursor: pointer;
  box-shadow: 0 4px 16px var(--shadow-brand-glow);
  transition: transform var(--transition-fast), box-shadow var(--transition-fast);
}
.crop-btn-confirm:active {
  transform: scale(0.95);
  box-shadow: 0 2px 8px rgba(176, 138, 92, 0.25);
}

/* ── BODY ── */
.profil-body {
  flex: 1;
  background: var(--color-bg-body);
  border-radius: var(--radius-pill) var(--radius-pill) 0 0;
  margin-top: -70px;
  padding: 0 16px 100px;
  position: relative;
  box-shadow:
    rgba(121, 85, 72, 0.40) 0px -5px,
    rgba(121, 85, 72, 0.30) 0px -10px,
    rgba(121, 85, 72, 0.20) 0px -15px,
    rgba(121, 85, 72, 0.10) 0px -20px,
    rgba(121, 85, 72, 0.05) 0px -25px;
  z-index: 2;
}

/* ── AVATAR SECTION ── */
.profil-avatar-section {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-top: -50px;
  padding-bottom: 20px;
}

.profil-avatar-wrap {
  position: relative;
  margin-bottom: 14px;
}

.profil-avatar {
  width: 100px;
  height: 100px;
  border-radius: 50%;
  background: linear-gradient(145deg, var(--color-brand-primary), var(--color-brand-mid));
  border: 4px solid #fff;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 34px;
  font-weight: 700;
  box-shadow:
    0 12px 32px var(--shadow-brown-1),
    0 2px 8px var(--shadow-brown-2);
}

.profil-avatar-status {
  position: absolute;
  bottom: 5px;
  right: 5px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--color-status-online);
  border: 2.5px solid #fff;
  box-shadow: 0 2px 6px rgba(34, 197, 94, 0.4);
}

/* ── IDENTITY ── */
.profil-identity {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}

.profil-hero-name {
  font-size: 21px;
  font-weight: 700;
  color: var(--color-text-primary);
}

.profil-hero-email {
  font-size: 13px;
  color: var(--color-text-secondary);
}

/* ── SECTION LABEL ── */
.profil-section-label {
  font-size: 11px;
  font-weight: 700;
  color: var(--color-text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.7px;
  margin: 20px 4px 8px;
}

/* ── CARD ── */
.profil-card {
  background: var(--color-bg-card);
  border-radius: var(--radius-lg);
  padding: 4px 16px;
  box-shadow:
    0 2px 12px var(--shadow-brown-card),
    0 1px 3px var(--shadow-brown-card-2);
}

.profil-card-sep {
  height: 1px;
  background: var(--color-bg-sep);
  margin: 0 0 0 50px;
}

.profil-card-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 13px 0;
}

/* ── ICON ── */
.profil-card-icon {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  flex-shrink: 0;
}

.profil-card-icon.brown  { background: var(--color-icon-brown-bg);  color: var(--color-icon-brown); }
.profil-card-icon.blue   { background: var(--color-icon-blue-bg);   color: var(--color-icon-blue); }
.profil-card-icon.purple { background: var(--color-icon-purple-bg); color: var(--color-icon-purple); }
.profil-card-icon.green  { background: var(--color-icon-green-bg);  color: var(--color-icon-green); }
.profil-card-icon.orange { background: var(--color-icon-orange-bg); color: var(--color-icon-orange); }
.profil-card-icon.gray   { background: var(--color-icon-gray-bg);   color: var(--color-icon-gray); }

/* ── CARD INFO ── */
.profil-card-info {
  flex: 1;
  min-width: 0;
}

.profil-card-label {
  font-size: 10px;
  color: var(--color-text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.4px;
  margin-bottom: 2px;
  font-weight: 500;
}

.profil-card-value {
  font-size: 14px;
  font-weight: 600;
  color: var(--color-text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ── MENU ── */
.profil-menu-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 13px 0;
  cursor: pointer;
  transition: opacity var(--transition-fast);
  -webkit-tap-highlight-color: transparent;
}

.profil-menu-item:active {
  opacity: 0.55;
}

.profil-menu-left {
  display: flex;
  align-items: center;
  gap: 14px;
  font-size: 14px;
  font-weight: 500;
  color: var(--color-text-primary);
}

.profil-menu-arrow {
  font-size: 11px;
  color: var(--color-arrow);
}

.profil-storage-item {
  padding: 14px 0;
}

.profil-storage-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}

.profil-storage-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--color-text-secondary);
  display: flex;
  align-items: center;
  gap: 6px;
}

.profil-storage-label i {
  color: var(--color-brand-mid);
}

.profil-storage-value {
  font-size: 13px;
  font-weight: 700;
  color: var(--color-text-primary);
}

.profil-storage-bar-wrap {
  width: 100%;
  height: 6px;
  background: var(--color-bg-storage-bar);
  border-radius: var(--radius-full);
  overflow: hidden;
  margin-bottom: 6px;
}

.profil-storage-bar-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--color-brand-primary), var(--color-brand-mid));
  border-radius: var(--radius-full);
  transition: width 0.6s ease;
}

.profil-storage-detail {
  font-size: 11px;
  color: var(--color-text-secondary);
}

.profil-storage-clear-btn {
  border: none;
  background: var(--color-clear-btn-bg);
  color: var(--color-icon-orange);
  font-size: 12px;
  font-weight: 600;
  padding: 7px 14px;
  border-radius: var(--radius-sm);
  flex-shrink: 0;
  transition: var(--transition-fast);
}

.profil-storage-clear-btn:active {
  transform: scale(0.95);
  background: var(--color-danger-bg-hover);
}

/* ── LOGOUT ── */
.profil-logout-btn {
  width: 100%;
  height: 54px;
  border: none;
  border-radius: 16px;
  background: linear-gradient(135deg, var(--color-brand-dark), var(--color-brand-mid));
  color: #fff;
  font-size: 15px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-top: 20px;
  box-shadow:
    0 8px 20px var(--shadow-brand-dark),
    0 2px 6px var(--shadow-brand-dark-2);
  transition: transform var(--transition-fast), box-shadow var(--transition-fast);
  -webkit-tap-highlight-color: transparent;
}

.profil-logout-btn:active {
  transform: scale(0.97);
  box-shadow: 0 4px 10px rgba(90, 52, 16, 0.2);
}

.logout-modal-overlay {
  position: fixed;
  inset: 0;
  background: var(--color-overlay-logout);
  backdrop-filter: blur(6px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 99999;
  opacity: 0;
  visibility: hidden;
  transition: var(--transition-normal);
}

.logout-modal-overlay.open {
  opacity: 1;
  visibility: visible;
}

.logout-modal {
  width: 90%;
  max-width: 340px;
  background: var(--color-bg-card);
  border-radius: var(--radius-2xl);
  padding: 24px;
  text-align: center;
  transform: translateY(12px);
  transition: var(--transition-normal);
}

.logout-modal-overlay.open .logout-modal {
  transform: translateY(0);
}

.logout-modal-icon {
  width: 64px;
  height: 64px;
  margin: auto;
  border-radius: 50%;
  background: var(--color-danger-bg);
  color: var(--color-icon-orange);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
}

.logout-modal-title {
  margin-top: 16px;
  font-size: 18px;
  font-weight: 700;
  color: var(--color-text-dark);
}

.logout-modal-text {
  margin-top: 8px;
  font-size: 14px;
  color: var(--color-text-gray);
  line-height: 1.5;
}

.logout-modal-actions {
  margin-top: 20px;
  display: flex;
  gap: 10px;
}

.logout-btn-cancel,
.logout-btn-confirm {
  flex: 1;
  height: 44px;
  border: none;
  border-radius: var(--radius-sm);
  font-weight: 600;
}

.logout-btn-cancel {
  background: #f3f4f6;
}

.logout-btn-confirm {
  background: var(--color-danger);
  color: #fff;
}

/* ── VERSION ── */
.profil-version {
  text-align: center;
  font-size: 11px;
  color: var(--color-text-muted);
  margin-top: 16px;
  padding-bottom: 20px;
}