:root {
  --bg: #F7F6F2;
  --surface: #FFFFFF;
  --tint: #FBF9F3;
  --border: #E4E2D9;
  --text: #2C2C2A;
  --text-muted: #6F6E68;
  --accent: #FEBA00;
  --accent-text: #4A3800;
  --shadow: 0 1px 3px rgba(20,18,12,0.05);
  --shadow-md: 0 6px 20px rgba(20,18,12,0.07);
  --low: #E1F5EE; --low-text: #085041;
  --medium: #E6F1FB; --medium-text: #0C447C;
  --urgent: #FAEEDA; --urgent-text: #633806;
  --critical: #FCEBEB; --critical-text: #791F1F;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
}

.app-shell {
  display: flex;
  min-height: 100vh;
}

.sidebar {
  width: 232px;
  flex-shrink: 0;
  background: var(--surface);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  padding: 20px 0;
  position: sticky;
  top: 0;
  height: 100vh;
}
.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 20px 18px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 14px;
}
.sidebar-brand-icon {
  width: 34px;
  height: 34px;
  flex-shrink: 0;
  border-radius: 9px;
  background: var(--accent);
  color: var(--accent-text);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 13px;
}
.sidebar-brand-text { font-weight: 600; font-size: 14px; line-height: 1.3; }
.sidebar-brand-text span { display: block; font-size: 11px; font-weight: 400; color: var(--text-muted); }
.sidebar nav { display: flex; flex-direction: column; flex: 1; }
.sidebar nav a {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 1px 10px;
  padding: 9px 12px;
  border-radius: 10px;
  color: var(--text);
  text-decoration: none;
  font-size: 14px;
}
.sidebar nav a .icon { font-size: 15px; width: 18px; text-align: center; flex-shrink: 0; }
.sidebar nav a:hover { background: var(--bg); }
.sidebar nav a.active { background: var(--text); color: #fff; font-weight: 500; }
.sidebar-section {
  padding: 16px 22px 6px;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .04em;
  color: var(--text-muted);
}
.sidebar-user {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 16px 20px 0;
  border-top: 1px solid var(--border);
  margin-top: 12px;
  font-size: 13px;
}
.sidebar-user-avatar {
  width: 32px;
  height: 32px;
  flex-shrink: 0;
  border-radius: 999px;
  background: var(--accent);
  color: var(--accent-text);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 12px;
}
.sidebar-user-info { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sidebar-user-info span { display: block; font-size: 11px; color: var(--text-muted); }

.app-content { flex: 1; padding: 24px; min-width: 0; }

.pagination {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-top: 12px;
  font-size: 13px;
}
.pagination a { color: var(--accent-text); text-decoration: none; font-weight: 500; }
.pagination-disabled { color: var(--text-muted); }
.pagination-info { color: var(--text-muted); }

.filter-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin-bottom: 20px;
}
.filter-pill {
  padding: 7px 14px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  text-decoration: none;
  font-size: 13px;
  white-space: nowrap;
}
.filter-pill:hover { background: var(--bg); }
.filter-pill.active { background: var(--accent); color: var(--accent-text); border-color: var(--accent); font-weight: 500; }
.filter-pills input[type="date"] { width: 145px; margin: 0; }
.filter-pills span.sep { color: var(--text-muted); font-size: 13px; }

.chart-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
  margin-bottom: 16px;
}
.chart-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 16px;
  box-shadow: var(--shadow);
}
.chart-card h3 { font-size: 14px; margin: 0 0 2px; }
.chart-card .chart-subtitle { font-size: 12px; color: var(--text-muted); margin: 0 0 12px; }
.chart-card.full { grid-column: 1 / -1; }

.detail-grid {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 20px;
  align-items: start;
}
@media (max-width: 800px) {
  .detail-grid { grid-template-columns: 1fr; }
}
.detail-section {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 18px;
  margin-bottom: 16px;
  box-shadow: var(--shadow);
}
.detail-section h3 { font-size: 14px; margin: 0 0 12px; }
.info-row { display: flex; justify-content: space-between; padding: 7px 0; border-bottom: 1px dashed var(--border); font-size: 13px; }
.info-row:last-child { border-bottom: none; }
.info-row .label { color: var(--text-muted); }
.comment-item { padding: 10px 0; border-bottom: 1px solid var(--border); font-size: 13px; }
.comment-item:last-child { border-bottom: none; }
.attachment-item { display: flex; justify-content: space-between; align-items: center; padding: 8px 0; border-bottom: 1px solid var(--border); font-size: 13px; }
.attachment-item:last-child { border-bottom: none; }

.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 6px;
}
.calendar-head {
  text-align: center;
  font-size: 12px;
  font-weight: 500;
  color: var(--text-muted);
  padding: 6px 0;
}
.calendar-cell {
  min-height: 90px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 8px;
  box-shadow: var(--shadow);
}
.calendar-cell.empty { background: transparent; border: none; }
.calendar-cell.today { border: 2px solid var(--accent); }
.calendar-day { font-size: 12px; font-weight: 600; margin-bottom: 4px; }
.calendar-task {
  display: block;
  font-size: 10px;
  padding: 2px 5px;
  margin-bottom: 3px;
  border-radius: 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.flash {
  padding: 10px 16px;
  border-radius: 8px;
  margin-bottom: 16px;
  font-size: 14px;
}
.flash.success { background: var(--low); color: var(--low-text); }
.flash.error { background: var(--critical); color: var(--critical-text); }

.summary-bar {
  display: flex;
  gap: 12px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}
.summary-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 14px 18px;
  font-size: 14px;
  box-shadow: var(--shadow);
}
.summary-card b { font-size: 20px; display: block; }

.board {
  display: grid;
  grid-template-columns: repeat(5, minmax(200px, 1fr));
  gap: 14px;
  overflow-x: auto;
}
.column {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px;
  min-height: 200px;
  max-height: 72vh;
  overflow-y: auto;
  box-shadow: var(--shadow);
}
.column h3 {
  font-size: 13px; text-transform: uppercase; letter-spacing: .04em; color: var(--text-muted); margin: 0 0 10px;
  position: sticky; top: -12px; background: var(--surface); padding: 12px 0 8px; z-index: 1;
}

.card {
  background: var(--tint);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px;
  margin-bottom: 10px;
  font-size: 14px;
  transition: box-shadow .12s ease;
}
.card:hover { box-shadow: var(--shadow); }
.card .title { font-weight: 500; margin-bottom: 4px; }
.card .meta { font-size: 12px; color: var(--text-muted); margin-bottom: 6px; }
.card .kendala { font-size: 12px; background: var(--critical); color: var(--critical-text); padding: 4px 8px; border-radius: 6px; margin-bottom: 6px; }

.badge { display: inline-block; padding: 2px 8px; border-radius: 999px; font-size: 11px; font-weight: 500; }
.badge.low { background: var(--low); color: var(--low-text); }
.badge.medium { background: var(--medium); color: var(--medium-text); }
.badge.urgent { background: var(--urgent); color: var(--urgent-text); }
.badge.critical { background: var(--critical); color: var(--critical-text); }
.badge.overdue { background: var(--critical); color: var(--critical-text); }

select, input, textarea, button {
  font-family: inherit;
  font-size: 13px;
  padding: 8px 10px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--tint);
  width: 100%;
  margin-bottom: 6px;
  transition: border-color .12s ease;
}
select:focus, input:focus, textarea:focus {
  outline: none;
  border-color: var(--accent);
}

button, .btn {
  background: var(--accent);
  color: var(--accent-text);
  border: none;
  font-weight: 500;
  cursor: pointer;
  width: auto;
  padding: 9px 16px;
}
button:hover, .btn:hover { filter: brightness(0.96); }

.btn-outline {
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--border);
  font-weight: 500;
}
.btn-outline:hover { background: var(--tint); filter: none; }

.btn-danger-outline {
  background: transparent;
  color: var(--critical-text);
  border: 1px solid var(--critical-text);
  font-weight: 500;
  width: auto;
  padding: 7px 14px;
  font-size: 12px;
}
.btn-danger-outline:hover { background: var(--critical); }

.empty-state {
  text-align: center;
  padding: 36px 20px;
  color: var(--text-muted);
  font-size: 13px;
  background: var(--surface);
  border: 1px dashed var(--border);
  border-radius: 12px;
}

details.add-task { margin-bottom: 16px; }
details.add-task summary {
  cursor: pointer;
  background: var(--accent);
  color: var(--accent-text);
  display: inline-block;
  padding: 8px 14px;
  border-radius: 8px;
  font-weight: 500;
  font-size: 14px;
}
details.add-task .form-panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 18px;
  margin-top: 10px;
  max-width: 420px;
  box-shadow: var(--shadow-md);
}

table { width: 100%; border-collapse: collapse; background: var(--surface); border: 1px solid var(--border); border-radius: 12px; overflow: hidden; box-shadow: var(--shadow); }
th, td { text-align: left; padding: 11px 14px; font-size: 13px; border-bottom: 1px solid var(--border); }
th { background: var(--tint); color: var(--text-muted); font-weight: 600; text-transform: uppercase; font-size: 11px; letter-spacing: .03em; }
tbody tr:last-child td { border-bottom: none; }
tbody tr:hover { background: var(--tint); }

.filter-bar { display: flex; gap: 8px; margin-bottom: 20px; flex-wrap: wrap; }
.filter-bar select { width: 170px; margin-bottom: 0; }

.page-header { margin-bottom: 20px; }
.page-header h1 { font-size: 20px; margin: 0 0 4px; }
.page-header p { font-size: 13px; color: var(--text-muted); margin: 0; }

.stat-grid { display: flex; flex-wrap: wrap; gap: 12px; margin-bottom: 20px; }
.stat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 16px 18px;
  min-width: 140px;
  flex: 1;
  box-shadow: var(--shadow);
}
.stat-card-icon {
  width: 34px;
  height: 34px;
  border-radius: 9px;
  background: var(--tint);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  margin-bottom: 12px;
}
.stat-card .stat-label { font-size: 12px; color: var(--text-muted); margin-bottom: 2px; }
.stat-card .stat-value { font-size: 24px; font-weight: 700; line-height: 1.2; }
.stat-card.hero { background: var(--text); border-color: var(--text); }
.stat-card.hero .stat-card-icon { background: rgba(255,255,255,0.15); }
.stat-card.hero .stat-label { color: rgba(255,255,255,0.65); }
.stat-card.hero .stat-value { color: #fff; }

.login-box {
  max-width: 400px;
  width: 100%;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 44px 40px;
  box-shadow: 0 8px 30px rgba(0,0,0,0.06);
  text-align: center;
}
.auth-body {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0;
}
.auth-wrap { width: 100%; padding: 24px; display: flex; justify-content: center; }
.login-box h1 {
  font-family: Georgia, 'Times New Roman', serif;
  font-size: 26px;
  margin: 0 0 6px;
  text-align: center;
  color: var(--text);
}
.login-sub {
  font-size: 12px;
  color: var(--text-muted);
  margin: 0 0 28px;
  text-transform: uppercase;
  letter-spacing: .08em;
}
.login-box form { text-align: left; }
.login-box label { font-size: 13px; font-weight: 600; margin-bottom: 6px; display: block; }
.login-box input {
  margin-bottom: 18px;
  padding: 11px 14px;
  background: #FBF9F3;
  border-color: var(--border);
}
.login-box button {
  width: 100%;
  padding: 12px;
  font-size: 14px;
  font-weight: 700;
  margin-top: 6px;
  background: #1B2E28;
  color: #ffffff;
  border-radius: 8px;
}
.login-box button:hover { background: #10201b; }

dialog.modal {
  border: none;
  border-radius: 14px;
  padding: 24px;
  max-width: 420px;
  width: 90%;
  box-shadow: 0 12px 40px rgba(0,0,0,0.18);
}
dialog.modal::backdrop { background: rgba(20,18,12,0.45); }
dialog.modal label { font-size: 13px; font-weight: 600; margin-bottom: 4px; display: block; }
dialog.modal input, dialog.modal select { margin-bottom: 14px; }
.modal-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 18px; }
.modal-header h3 { margin: 0; font-size: 16px; }
.modal-close { background: transparent; color: var(--text-muted); border: none; font-size: 22px; line-height: 1; width: auto; padding: 0; cursor: pointer; }
.modal-actions { display: flex; gap: 8px; justify-content: flex-end; margin-top: 10px; }
.modal-actions button { width: auto; padding: 8px 18px; }
.btn-secondary { background: transparent !important; color: var(--text-muted) !important; border: 1px solid var(--border) !important; }

.panel-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}
.panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 16px;
  box-shadow: var(--shadow);
}
.panel h3 { font-size: 14px; margin: 0 0 12px; }
.empty-note { font-size: 13px; color: var(--text-muted); }

.plan-card {
  background: var(--tint);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px;
  margin-bottom: 10px;
  font-size: 13px;
}
.plan-card .title { font-weight: 500; margin: 4px 0; }
.plan-card .meta { font-size: 11px; color: var(--text-muted); }

.progress-bar {
  background: var(--border);
  border-radius: 999px;
  height: 6px;
  margin: 6px 0;
  overflow: hidden;
}
.progress-fill {
  background: var(--accent);
  height: 100%;
}
