* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Arial, sans-serif;
  background: #f0f2f5;
  color: #1a1a2e;
}

/* ===== LAYOUT ===== */
.wrap { max-width: 1040px; margin: 0 auto; padding: 28px 24px 72px; }

/* ===== HEADER ===== */
header {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 28px; flex-wrap: wrap; gap: 12px;
}
.header-brand h1 {
  font-size: 22px; font-weight: 700; margin: 0;
  background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
  background-clip: text;
}
.header-brand p { font-size: 12px; color: #8b8fa8; margin: 3px 0 0; }
.header-right {
  display: flex; align-items: center; gap: 6px; font-size: 13px;
}
.header-right .user-pill {
  display: flex; align-items: center; gap: 8px;
  background: #fff; border: 1px solid #e2e5ef; border-radius: 999px;
  padding: 6px 14px 6px 8px;
}
.header-right .avatar {
  width: 26px; height: 26px; border-radius: 50%;
  background: linear-gradient(135deg, #667eea, #764ba2);
  display: flex; align-items: center; justify-content: center;
  font-size: 11px; font-weight: 700; color: #fff;
}
.header-right .user-name { font-size: 13px; font-weight: 500; color: #1a1a2e; }
.header-right a {
  color: #8b8fa8; text-decoration: none; font-size: 13px;
  padding: 7px 14px; border-radius: 8px; border: 1px solid #e2e5ef;
  background: #fff; font-weight: 500; transition: all 0.15s;
}
.header-right a:hover { border-color: #c5c9dc; color: #1a1a2e; }
.header-right a.btn-logout {
  color: #dc2626; border-color: #fecaca; background: #fff5f5;
}
.header-right a.btn-logout:hover { background: #fee2e2; }

/* ===== STAT CARDS ===== */
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 24px; }
.stat-card {
  background: #fff; border-radius: 14px; padding: 18px 20px;
  border: 1px solid #e2e5ef;
  display: flex; align-items: center; gap: 14px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.04);
  transition: box-shadow 0.15s;
}
.stat-card:hover { box-shadow: 0 4px 12px rgba(0,0,0,0.08); }
.stat-icon {
  width: 42px; height: 42px; border-radius: 12px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center; font-size: 18px;
}
.stat-icon.blue   { background: #eff6ff; }
.stat-icon.amber  { background: #fffbeb; }
.stat-icon.purple { background: #f5f3ff; }
.stat-icon.green  { background: #f0fdf4; }
.stat-text .label { font-size: 11px; color: #8b8fa8; margin: 0 0 4px; font-weight: 500; text-transform: uppercase; letter-spacing: 0.04em; }
.stat-text .value { font-size: 24px; font-weight: 700; margin: 0; color: #1a1a2e; line-height: 1; }
@media (max-width: 700px) {
  .stats { grid-template-columns: repeat(2, 1fr); }
}

/* ===== CHARTS ===== */
.charts-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin-bottom: 24px; }
.chart-card {
  background: #fff; border-radius: 14px; padding: 16px 18px;
  border: 1px solid #e2e5ef; box-shadow: 0 1px 3px rgba(0,0,0,0.04);
  display: flex; flex-direction: column; overflow: hidden;
}
.chart-title {
  font-size: 11px; font-weight: 600; color: #8b8fa8;
  margin: 0 0 12px; text-transform: uppercase; letter-spacing: 0.06em;
}
.chart-box { position: relative; height: 150px; }
@media (max-width: 640px) {
  .charts-grid { grid-template-columns: 1fr; }
}

/* ===== TABS ===== */
.tabs-wrap { display: flex; align-items: center; gap: 10px; margin-bottom: 20px; }
.tabs {
  display: flex; gap: 4px;
  background: #fff; border: 1px solid #e2e5ef; border-radius: 12px;
  padding: 5px; overflow-x: auto; flex: 1;
  scrollbar-width: none;
}
.tabs::-webkit-scrollbar { display: none; }
.tab-btn {
  padding: 8px 18px; font-size: 13px; border-radius: 8px; text-decoration: none;
  color: #8b8fa8; font-weight: 500; border: none; transition: all 0.15s;
  white-space: nowrap; flex-shrink: 0;
}
.tab-btn.active { background: #1a1a2e; color: #fff; }
.tab-btn:hover:not(.active) { background: #f0f2f5; color: #1a1a2e; }
.tab-manage-btn {
  flex-shrink: 0; width: 34px; height: 34px; border-radius: 9px;
  background: #fff; border: 1px solid #e2e5ef; color: #8b8fa8;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; font-size: 17px; text-decoration: none;
  transition: all 0.15s;
}
.tab-manage-btn:hover { border-color: #c5c9dc; color: #1a1a2e; background: #f8f9fc; }

/* ===== BUTTONS ===== */
.add-bar { display: flex; justify-content: flex-end; margin-bottom: 14px; }
button, .btn {
  font-family: inherit; cursor: pointer; border-radius: 9px; font-size: 13px; padding: 9px 18px;
  text-decoration: none; display: inline-flex; align-items: center; gap: 6px;
  font-weight: 500; transition: all 0.15s; border: none;
}
.btn-primary { background: #1a1a2e; color: #fff; }
.btn-primary:hover { background: #2d2d4e; transform: translateY(-1px); box-shadow: 0 4px 12px rgba(26,26,46,0.25); }
.btn-ghost { background: #fff; border: 1px solid #e2e5ef; color: #6b7080; padding: 6px 12px; font-size: 12px; }
.btn-ghost:hover { border-color: #c5c9dc; color: #1a1a2e; background: #f8f9fc; }
.btn-danger { color: #dc2626 !important; border-color: #fecaca !important; }
.btn-danger:hover { background: #fff5f5 !important; }

/* ===== TASK / ARAHAN / ASSESSMENT CARDS ===== */
.card {
  background: #fff; border: 1px solid #e2e5ef; border-radius: 14px;
  padding: 18px 20px; margin-bottom: 10px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.04);
  transition: box-shadow 0.15s, transform 0.15s;
}
.card:hover { box-shadow: 0 4px 16px rgba(0,0,0,0.08); transform: translateY(-1px); }
.card .top { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; margin-bottom: 10px; }
.card .title { font-size: 14px; font-weight: 600; margin: 0; color: #1a1a2e; }
.card .meta { font-size: 12px; color: #8b8fa8; margin: 4px 0 0; }

/* ===== BADGE ===== */
.badge {
  font-size: 11px; padding: 4px 11px; border-radius: 999px;
  white-space: nowrap; font-weight: 600; letter-spacing: 0.02em; flex-shrink: 0;
}
.badge.ontrack  { background: #fef9c3; color: #854d0e; }
.badge.late     { background: #fee2e2; color: #b91c1c; }
.badge.done     { background: #dcfce7; color: #15803d; }
.badge.process  { background: #dbeafe; color: #1d4ed8; }

/* ===== PROGRESS BAR ===== */
.progress-row { display: flex; align-items: center; gap: 10px; }
.progress-bar-bg {
  flex: 1; height: 7px; background: #f0f2f5; border-radius: 999px; overflow: hidden;
}
.progress-bar-fill { height: 100%; border-radius: 999px; transition: width 0.4s ease; }
.progress-label { font-size: 12px; color: #8b8fa8; font-weight: 600; min-width: 36px; text-align: right; }

/* ===== CARD ACTIONS ===== */
.card-actions { display: flex; gap: 6px; margin-top: 12px; padding-top: 12px; border-top: 1px solid #f0f2f5; }

/* ===== EMPTY STATE ===== */
.empty {
  text-align: center; padding: 60px 0; color: #b0b4c8; font-size: 14px;
  background: #fff; border: 1px dashed #d4d8e8; border-radius: 14px;
}
.empty::before { content: '📋'; display: block; font-size: 32px; margin-bottom: 12px; }

/* ===== MODAL ===== */
.modal-overlay {
  position: fixed; inset: 0; background: rgba(15,15,30,0.5); backdrop-filter: blur(4px);
  display: flex; align-items: center; justify-content: center; z-index: 50; padding: 16px;
}
.modal {
  background: #fff; border-radius: 18px; padding: 26px 28px;
  width: 100%; max-width: 440px; max-height: 90vh; overflow-y: auto;
  box-shadow: 0 20px 60px rgba(0,0,0,0.2);
}
.modal h2 { font-size: 17px; margin: 0 0 20px; font-weight: 700; color: #1a1a2e; }
.field { margin-bottom: 14px; }
.field label { display: block; font-size: 12px; color: #8b8fa8; margin-bottom: 5px; font-weight: 500; }
.field input, .field select, .field textarea {
  width: 100%; padding: 9px 12px; border: 1px solid #e2e5ef; border-radius: 9px;
  font-size: 13px; font-family: inherit; color: #1a1a2e; background: #fff;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.field input:focus, .field select:focus, .field textarea:focus {
  outline: none; border-color: #667eea; box-shadow: 0 0 0 3px rgba(102,126,234,0.12);
}
.field input[type="range"] { padding: 0; border: none; background: transparent; }
.modal-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 22px; padding-top: 18px; border-top: 1px solid #f0f2f5; }

/* ===== DIVIDER ===== */
.section-divider { display: flex; align-items: center; gap: 12px; margin-bottom: 16px; }
.section-divider h3 { font-size: 13px; font-weight: 600; color: #1a1a2e; margin: 0; white-space: nowrap; }
.section-divider hr { flex: 1; border: none; border-top: 1px solid #e2e5ef; }

/* ===== LOGIN ===== */
.login-wrap {
  max-width: 380px; margin: 80px auto;
  background: #fff; border: 1px solid #e2e5ef; border-radius: 18px; padding: 32px;
  box-shadow: 0 4px 24px rgba(0,0,0,0.08);
}
.login-wrap h1 { font-size: 20px; margin: 0 0 4px; font-weight: 700; }
.login-wrap p { font-size: 13px; color: #8b8fa8; margin: 0 0 24px; }
.error-msg { background: #fee2e2; color: #b91c1c; font-size: 13px; padding: 11px 14px; border-radius: 9px; margin-bottom: 16px; }

/* ===== OVERVIEW (Ringkasan) ===== */
.overview-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.ov-section { background: #fff; border: 1px solid #e2e5ef; border-radius: 14px; padding: 16px 18px; display: flex; flex-direction: column; gap: 10px; }
.ov-header { display: flex; align-items: flex-start; gap: 10px; padding-bottom: 10px; border-bottom: 1px solid #f0f2f5; }
.ov-icon { font-size: 20px; flex-shrink: 0; margin-top: 1px; }
.ov-title { font-size: 13px; font-weight: 600; color: #1a1a2e; }
.ov-sub { font-size: 11px; color: #8b8fa8; margin-top: 2px; }
.ov-link { margin-left: auto; font-size: 11px; color: #667eea; text-decoration: none; white-space: nowrap; padding-top: 2px; flex-shrink: 0; }
.ov-link:hover { text-decoration: underline; }
.ov-item { padding: 8px 0; border-bottom: 1px solid #f7f8fa; }
.ov-item:last-of-type { border-bottom: none; }
.ov-item-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; }
.ov-item-title { font-size: 12px; font-weight: 500; color: #1a1a2e; line-height: 1.4; }
.ov-more { font-size: 11px; color: #8b8fa8; text-decoration: none; display: block; text-align: center; padding-top: 4px; }
.ov-more:hover { color: #667eea; }
@media (max-width: 760px) { .overview-grid { grid-template-columns: 1fr; } }

/* ===== PROFILE DROPDOWN ===== */
.profile-wrap { position: relative; }
.user-pill {
  display: flex; align-items: center; gap: 8px;
  background: #fff; border: 1px solid #e2e5ef; border-radius: 999px;
  padding: 6px 14px 6px 8px; cursor: pointer;
  transition: border-color 0.15s, box-shadow 0.15s;
  user-select: none;
}
.user-pill:hover { border-color: #c5c9dc; box-shadow: 0 2px 8px rgba(0,0,0,0.06); }
.user-pill.open { border-color: #667eea; box-shadow: 0 0 0 3px rgba(102,126,234,0.1); }

.profile-dropdown {
  display: none; position: absolute; top: calc(100% + 8px); right: 0;
  width: 240px; background: #fff; border: 1px solid #e2e5ef;
  border-radius: 14px; box-shadow: 0 8px 30px rgba(0,0,0,0.12);
  z-index: 100; overflow: hidden;
}
.profile-dropdown.open { display: block; }

.profile-header {
  padding: 18px 18px 14px;
  background: linear-gradient(135deg, #1a1a2e 0%, #2d2d4e 100%);
  display: flex; align-items: center; gap: 12px;
}
.profile-avatar-lg {
  width: 44px; height: 44px; border-radius: 50%;
  background: rgba(255,255,255,0.15);
  display: flex; align-items: center; justify-content: center;
  font-size: 18px; font-weight: 700; color: #fff; flex-shrink: 0;
}
.profile-info .profile-name { font-size: 14px; font-weight: 600; color: #fff; }
.profile-info .profile-username { font-size: 12px; color: rgba(255,255,255,0.5); margin-top: 2px; }

.profile-body { padding: 8px; }
.profile-item {
  display: flex; align-items: center; gap: 10px; padding: 9px 10px;
  border-radius: 8px; font-size: 13px; color: #4a4d60; text-decoration: none;
  cursor: pointer; transition: background 0.12s;
}
.profile-item:hover { background: #f0f2f5; color: #1a1a2e; }
.profile-item-icon { font-size: 15px; width: 20px; text-align: center; flex-shrink: 0; }
.profile-divider { height: 1px; background: #f0f2f5; margin: 4px 8px; }
.profile-item.danger { color: #dc2626; }
.profile-item.danger:hover { background: #fff5f5; }

.profile-meta {
  padding: 8px 18px 10px; font-size: 11px; color: #b0b4c8;
  border-top: 1px solid #f0f2f5;
}

/* ===== TASK DETAIL PAGE ===== */
.page-header { margin-bottom: 24px; }
.back-link { font-size: 13px; color: #8b8fa8; text-decoration: none; display: inline-flex; align-items: center; gap: 6px; margin-bottom: 14px; }
.back-link:hover { color: #1a1a2e; }
.update-list { display: flex; flex-direction: column; gap: 10px; margin-bottom: 20px; }
.update-item {
  background: #fff; border: 1px solid #e2e5ef; border-radius: 12px;
  padding: 14px 16px; position: relative;
}
.update-item.deleted { opacity: 0.55; background: #fafafa; }
.update-meta { font-size: 11px; color: #8b8fa8; margin-bottom: 6px; }
.update-content { font-size: 13px; color: #1a1a2e; line-height: 1.6; }
.update-actions { display: flex; gap: 6px; margin-top: 10px; }
