*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: #f0f2f5;
  color: #1a1a2e;
  min-height: 100vh;
}

/* ── Header ─────────────────────────────────────────────── */
header {
  background: #1a1a2e;
  color: #fff;
  padding: 14px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 2px 8px rgba(0,0,0,.3);
}

h1 { font-size: 1.1rem; font-weight: 600; letter-spacing: .3px; }

nav { display: flex; gap: 6px; }

.tab {
  background: rgba(255,255,255,.12);
  color: #ccd;
  border: none;
  padding: 6px 18px;
  border-radius: 6px;
  cursor: pointer;
  font-size: .85rem;
  font-weight: 500;
  transition: background .15s, color .15s;
}
.tab:hover { background: rgba(255,255,255,.2); color: #fff; }
.tab.active { background: #4f8ef7; color: #fff; }

/* ── Storage bar ─────────────────────────────────────────── */
.storage-bar-section {
  background: #fff;
  padding: 12px 24px 10px;
  border-bottom: 1px solid #e2e4ea;
}

.storage-labels {
  display: flex;
  justify-content: space-between;
  font-size: .8rem;
  color: #666;
  margin-bottom: 6px;
}

.storage-track {
  height: 7px;
  background: #e8eaf0;
  border-radius: 4px;
  overflow: hidden;
}

.storage-fill {
  height: 100%;
  background: #4f8ef7;
  border-radius: 4px;
  transition: width .6s ease, background .4s;
}
.storage-fill.warn  { background: #ff9800; }
.storage-fill.crit  { background: #f44336; }

.script-status {
  display: flex;
  gap: 16px;
  margin-top: 7px;
  font-size: .75rem;
  color: #888;
}

.script-status .ok   { color: #2e7d32; }
.script-status .err  { color: #c62828; }

/* ── Active transfers ────────────────────────────────────── */
.transfers-section {
  background: #fffbeb;
  border-bottom: 1px solid #fde68a;
  padding: 10px 24px;
}

.transfers-title {
  font-size: .8rem;
  font-weight: 600;
  color: #92400e;
  margin-bottom: 8px;
  text-transform: uppercase;
  letter-spacing: .4px;
}

.transfer-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 6px;
  font-size: .85rem;
}
.transfer-row:last-child { margin-bottom: 0; }

.transfer-name { flex: 0 0 220px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.transfer-track { flex: 1; height: 5px; background: #e8eaf0; border-radius: 3px; overflow: hidden; }
.transfer-fill { height: 100%; background: #4caf50; transition: width .5s; }
.transfer-meta { flex: 0 0 160px; color: #777; font-size: .78rem; text-align: right; }

/* ── Main ───────────────────────────────────────────────── */
main { max-width: 900px; margin: 20px auto; padding: 0 16px 40px; }

.error-banner {
  background: #ffebee;
  color: #b71c1c;
  padding: 10px 14px;
  border-radius: 6px;
  font-size: .875rem;
  margin-bottom: 12px;
  border-left: 3px solid #f44336;
}

.loading {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  color: #888;
  padding: 60px 0;
  font-size: .9rem;
}

.spinner {
  width: 18px;
  height: 18px;
  border: 2px solid #d0d4e0;
  border-top-color: #4f8ef7;
  border-radius: 50%;
  animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.panel {}

/* ── Content items ───────────────────────────────────────── */
.empty-state {
  text-align: center;
  color: #aaa;
  padding: 50px 0;
  font-size: .9rem;
}

.content-item {
  background: #fff;
  border: 1px solid #e2e4ea;
  border-radius: 8px;
  padding: 13px 16px;
  margin-bottom: 7px;
  display: flex;
  align-items: center;
  gap: 10px;
  transition: box-shadow .15s;
}
.content-item:hover { box-shadow: 0 2px 8px rgba(0,0,0,.07); }

.badge {
  font-size: .7rem;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 10px;
  white-space: nowrap;
  letter-spacing: .3px;
  flex-shrink: 0;
}
.badge-local  { background: #e8f5e9; color: #2e7d32; }
.badge-remote { background: #e3f2fd; color: #1565c0; }

.item-name {
  flex: 1;
  font-size: .9rem;
  font-weight: 500;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.item-size {
  font-size: .8rem;
  color: #999;
  flex-shrink: 0;
  min-width: 70px;
  text-align: right;
}

.btn {
  border: none;
  border-radius: 5px;
  padding: 6px 13px;
  cursor: pointer;
  font-size: .8rem;
  font-weight: 600;
  white-space: nowrap;
  flex-shrink: 0;
  transition: background .15s, opacity .15s;
}
.btn:disabled { opacity: .45; cursor: not-allowed; }

.btn-download { background: #dbeafe; color: #1d4ed8; }
.btn-download:hover:not(:disabled) { background: #bfdbfe; }

.btn-delete { background: #fee2e2; color: #991b1b; }
.btn-delete:hover:not(:disabled) { background: #fecaca; }
