:root {
  --bg: #eef7fc;
  --panel: #ffffff;
  --line: #cfe3ef;
  --primary: #2b7fb6;
  --primary-dark: #195d87;
  --text: #163042;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: "Segoe UI", sans-serif;
  color: var(--text);
  background: linear-gradient(180deg, #f8fcff 0%, var(--bg) 100%);
}
.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 1.5rem;
  background: rgba(255,255,255,0.9);
  border-bottom: 1px solid var(--line);
}
.topbar a { color: var(--primary-dark); margin-left: 1rem; text-decoration: none; }
.home-link { color: inherit; text-decoration: none; }
.home-link:hover { text-decoration: underline; }
.section-head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-bottom: 0.75rem; }
.section-head .secondary-btn { margin-left: auto; }
.file-sort-controls { display: flex; align-items: center; gap: 0.6rem; flex-wrap: wrap; }
.sort-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.2rem;
  padding: 0.28rem 0.55rem;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: #eef6fb;
  color: var(--primary-dark);
  font-size: 0.78rem;
  white-space: nowrap;
  line-height: 1.1;
  font-weight: 600;
}
.sort-chip .sort-arrow {
  display: inline-block;
  min-width: 0.9em;
  text-align: center;
}
.sort-chip:hover { background: #e3f0f8; }
.sort-chip-active { background: #d4e9f6; border-color: #9fc8df; }
.dashboard {
  display: grid;
  grid-template-columns: 1fr 2fr 2fr;
  gap: 1rem;
  padding: 1rem;
}
.panel, .single-panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 1rem;
  box-shadow: 0 8px 24px rgba(28, 93, 128, 0.08);
}
.single-panel { margin: 1rem; }
.stack { display: grid; gap: 0.75rem; }
.group-box {
  padding: 0.85rem;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #f7fbfe;
}
.inline-fields {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.75rem;
}
.sync-actions {
  display: flex;
  flex-wrap: nowrap;
  gap: 0.75rem;
  align-items: center;
  overflow-x: auto;
}
.sync-actions form {
  margin: 0;
  flex: 0 0 auto;
}
.sync-storage-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1.25rem;
  padding: 0.7rem 0.85rem;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fbfdff;
  font-size: 0.92rem;
  color: #4a6780;
}
.sync-storage-summary-alert {
  background: #fff6f3;
  border-color: #e8b6a7;
  color: #9f4024;
}
.hint {
  margin: 0;
  color: #547089;
  font-size: 0.9rem;
}
label { display: grid; gap: 0.3rem; font-size: 0.95rem; }
input, select, button {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 0.7rem 0.8rem;
}
button {
  background: var(--primary);
  color: white;
  border: 0;
  cursor: pointer;
}
.secondary-btn { background: #eef6fb; color: var(--primary-dark); border: 1px solid var(--line); }
.compact-btn { padding: 0.35rem 0.7rem; font-size: 0.9rem; }
.list { list-style: none; padding: 0; margin: 0; display: grid; gap: 0.5rem; }
.checkbox-list { display: grid; gap: 0.35rem; max-height: 220px; overflow: auto; padding: 0.75rem; border: 1px solid var(--line); border-radius: 12px; background: #fbfdff; }
.checkbox-list .checkbox-item { display: flex; align-items: center; justify-content: flex-start; gap: 0.5rem; font-size: 0.95rem; width: 100%; }
.checkbox-list .checkbox-item input[type="checkbox"] { margin: 0; padding: 0; width: 18px; height: 18px; flex: 0 0 18px; }
.checkbox-list .checkbox-item span { display: inline-block; line-height: 1.4; }
.progress-row { display: flex; gap: 0.75rem; align-items: center; margin-top: 0.35rem; }
.progress-bar { flex: 1; height: 10px; background: #e4eef5; border-radius: 999px; overflow: hidden; }
.progress-bar span { display: block; height: 100%; background: linear-gradient(90deg, var(--primary), #5eb6d8); }
.job-line { display: flex; align-items: center; justify-content: space-between; gap: 0.75rem; }
.job-main { font-size: 1rem; min-width: 0; }
.job-meta { display: flex; align-items: center; gap: 0.75rem; margin-left: auto; white-space: nowrap; }
.file-row { display: flex; align-items: center; justify-content: space-between; gap: 0.75rem; }
.file-main { display: flex; align-items: baseline; gap: 0.5rem; min-width: 0; flex: 1 1 auto; }
.file-main a { overflow-wrap: anywhere; }
.file-delete-btn { flex: 0 0 auto; }
table { width: 100%; border-collapse: collapse; }
th, td { padding: 0.5rem; border-bottom: 1px solid var(--line); text-align: left; }
@media (max-width: 960px) {
  .dashboard { grid-template-columns: 1fr; }
  .topbar { flex-direction: column; align-items: flex-start; }
  .inline-fields { grid-template-columns: 1fr; }
  .job-line { align-items: center; }
  .job-main { flex: 1 1 auto; }
  .job-meta { margin-left: auto; white-space: nowrap; flex-wrap: wrap; justify-content: flex-end; }
  .file-row { align-items: flex-start; }
  .file-main { flex: 1 1 auto; flex-wrap: wrap; }
  .file-sort-controls { width: 100%; }
  .sort-chip { flex: 1 1 7rem; justify-content: center; }
}
