:root {
  --bg: #f5f7fa;
  --surface: #fff;
  --border: #e2e8f0;
  --primary: #1a73e8;
  --primary-dark: #1557b0;
  --primary-light: #e8f0fe;
  --success: #188038;
  --success-bg: #e6f4ea;
  --warning: #b45309;
  --warning-bg: #fef3c7;
  --danger: #b91c1c;
  --danger-bg: #fff5f5;
  --text: #1e293b;
  --text2: #475569;
  --text3: #94a3b8;
  --radius: 8px;
  --radius-lg: 12px;
  --shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  line-height: 1.6;
}
.container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 24px 16px;
}
.header {
  background: var(--primary);
  color: white;
  padding: 18px 24px;
  border-radius: var(--radius-lg);
  margin-bottom: 20px;
}
.header h1 {
  font-size: 20px;
  font-weight: 600;
}
.header p {
  font-size: 13px;
  opacity: 0.8;
  margin-top: 2px;
}
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px;
  margin-bottom: 16px;
  box-shadow: var(--shadow);
}
.card-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--text2);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.card-title .dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--primary);
}
.grid2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin-bottom: 14px;
}
.grid4 {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr 1fr;
  gap: 14px;
  margin-bottom: 14px;
}
.field {
  display: flex;
  flex-direction: column;
  gap: 5px;
}
.field label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text2);
}
.field input,
.field select,
.field textarea {
  font-family: inherit;
  font-size: 13px;
  color: var(--text);
  background: #f8fafc;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 8px 10px;
  width: 100%;
  transition: border 0.15s;
}
.field input:focus,
.field select:focus,
.field textarea:focus {
  outline: none;
  border-color: var(--primary);
  background: white;
}
.field textarea {
  resize: vertical;
  min-height: 60px;
}
.checkbox-group {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 14px;
}
.checkbox-group label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  cursor: pointer;
  background: #f8fafc;
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 5px 10px;
  transition: all 0.15s;
}
.checkbox-group label:hover {
  border-color: var(--primary);
  background: var(--primary-light);
}
.rencana-item {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px;
  margin-bottom: 10px;
  background: #fafbfc;
  transition: all 0.2s;
}
.rencana-item.done {
  opacity: 0.55;
  background: #fef9ec;
}
.rencana-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
}
.rencana-num {
  font-size: 13px;
  font-weight: 600;
  color: var(--primary);
}
.badge {
  display: inline-block;
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 20px;
  font-weight: 500;
}
.badge-l {
  background: var(--primary-light);
  color: var(--primary);
}
.badge-b {
  background: var(--success-bg);
  color: var(--success);
}
.selesai-toggle {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  background: var(--warning-bg);
  border: 1px solid #fcd34d;
  border-radius: var(--radius);
  margin-top: 8px;
  font-size: 12px;
  color: var(--warning);
  cursor: pointer;
}
.btn {
  font-family: inherit;
  font-size: 14px;
  font-weight: 500;
  padding: 9px 20px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: white;
  color: var(--text);
  cursor: pointer;
  transition: all 0.15s;
}
.btn:hover {
  background: #f1f5f9;
}
.btn-primary {
  background: var(--primary);
  color: white;
  border-color: var(--primary);
}
.btn-primary:hover {
  background: var(--primary-dark);
}
.btn-success {
  background: var(--success);
  color: white;
  border-color: var(--success);
}
.btn-danger {
  background: #ef4444;
  color: white;
  border-color: #ef4444;
}
.btn-danger:hover {
  background: #dc2626;
}
.btn-sm {
  font-size: 12px;
  padding: 6px 12px;
}
.btn-group {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.actions {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  padding-top: 12px;
  border-top: 1px solid var(--border);
  margin-top: 16px;
}
.info-box {
  background: var(--primary-light);
  border: 1px solid #c2d8f8;
  border-radius: var(--radius);
  padding: 10px 14px;
  font-size: 13px;
  color: #0c447c;
  margin-bottom: 14px;
}
.warn-box {
  background: var(--warning-bg);
  border: 1px solid #fcd34d;
  border-radius: var(--radius);
  padding: 10px 14px;
  font-size: 13px;
  color: var(--warning);
  margin-bottom: 14px;
}
.stat-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  margin-bottom: 16px;
}
.stat {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px 14px;
}
.stat-lbl {
  font-size: 11px;
  color: var(--text3);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 4px;
}
.stat-val {
  font-size: 22px;
  font-weight: 600;
  color: var(--text);
}
.tab-bar {
  display: flex;
  gap: 4px;
  background: #f1f5f9;
  border-radius: var(--radius);
  padding: 4px;
  margin-bottom: 16px;
}
.tab {
  flex: 1;
  text-align: center;
  padding: 8px;
  font-size: 13px;
  font-weight: 500;
  border-radius: 6px;
  cursor: pointer;
  color: var(--text2);
  transition: all 0.15s;
}
.tab.active {
  background: white;
  color: var(--primary);
  box-shadow: var(--shadow);
}
.tbl-wrap {
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}
th {
  background: #f8fafc;
  color: var(--text2);
  font-weight: 600;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 9px 10px;
  text-align: left;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
td {
  padding: 8px 10px;
  border-bottom: 1px solid #f1f5f9;
  color: var(--text);
  vertical-align: top;
}
tr:last-child td {
  border-bottom: none;
}
tr:hover td {
  background: #f8fafc;
}
.code-box {
  background: #1e293b;
  color: #e2e8f0;
  border-radius: var(--radius);
  padding: 16px;
  font-family: "Courier New", monospace;
  font-size: 12px;
  white-space: pre-wrap;
  word-break: break-all;
  max-height: 400px;
  overflow-y: auto;
  line-height: 1.5;
}
.feedback {
  font-size: 13px;
  color: var(--success);
  padding: 8px 0;
  min-height: 24px;
  font-weight: 500;
}
.spinner {
  display: inline-block;
  width: 16px;
  height: 16px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-top-color: white;
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
  vertical-align: middle;
  margin-right: 6px;
}
@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}
.hidden {
  display: none !important;
}
.jam-preview {
  font-size: 13px;
  color: var(--text2);
  background: #f0f4ff;
  padding: 8px 12px;
  border-radius: 8px;
  margin-bottom: 14px;
}
.panduan-item {
  background: #f8fafc;
  border-left: 3px solid var(--primary);
  border-radius: 0 var(--radius) var(--radius) 0;
  padding: 8px 12px;
  margin-bottom: 6px;
  font-size: 12px;
}
.panduan-item strong {
  color: var(--primary);
}

/* Error Card */
.error-card {
  background: var(--danger-bg);
  border: 1px solid #fca5a5;
  border-radius: var(--radius-lg);
  margin-bottom: 16px;
  overflow: hidden;
  display: none;
}
.error-card.show {
  display: block;
}
.error-card-head {
  background: #fef2f2;
  border-bottom: 1px solid #fca5a5;
  padding: 12px 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}
.error-card-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--danger);
  display: flex;
  align-items: center;
  gap: 10px;
}
.error-icon {
  width: 22px;
  height: 22px;
  background: #ef4444;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  color: white;
  font-size: 14px;
  font-weight: 700;
  line-height: 1;
}
.error-body {
  padding: 14px 16px;
}
.error-code {
  font-size: 12px;
  color: #7f1d1d;
  background: #fee2e2;
  border-radius: 6px;
  padding: 10px 12px;
  font-family: monospace;
  word-break: break-all;
  line-height: 1.7;
  margin-bottom: 10px;
  white-space: pre-wrap;
  border: 1px solid #fca5a5;
  max-height: 180px;
  overflow-y: auto;
}
.error-hints {
  font-size: 12px;
  color: #991b1b;
  margin-bottom: 12px;
}
.error-hints b {
  display: block;
  margin-bottom: 4px;
}
.error-hints ul {
  padding-left: 18px;
}
.error-hints li {
  margin-bottom: 3px;
}
.error-footer {
  display: flex;
  gap: 8px;
  align-items: center;
}

@media (max-width: 640px) {
  .grid2,
  .grid4 {
    grid-template-columns: 1fr;
  }
  .stat-grid {
    grid-template-columns: 1fr 1fr;
  }
}
