* { box-sizing: border-box; }
body {
  margin: 0; background: #f5f6f8; color: #1f2430;
  font: 14.5px/1.5 -apple-system, "Segoe UI", Roboto, sans-serif;
}
nav {
  display: flex; align-items: center; gap: 14px;
  background: #1a237e; color: #fff; padding: 0 18px; height: 52px;
}
nav .brand { font-weight: 700; font-size: 16px; margin-right: 8px; }
nav a { color: #c5cae9; text-decoration: none; padding: 4px 8px; border-radius: 6px; }
nav a.active, nav a:hover { color: #fff; background: rgba(255,255,255,.12); }
nav .spacer { flex: 1; }
nav .who { opacity: .8; font-size: 13px; }
.inline-form { display: inline; margin: 0; }
main { max-width: 1280px; margin: 0 auto; padding: 20px 18px 60px; }
h1 { font-size: 20px; margin: 8px 0 16px; }
h2 { font-size: 16px; margin: 26px 0 10px; }

.btn {
  border: 1px solid #c3c8d4; background: #fff; color: #1f2430;
  padding: 6px 12px; border-radius: 7px; cursor: pointer; font-size: 13.5px;
}
.btn:hover:not(:disabled) { background: #eef0f5; }
.btn.primary { background: #1a237e; border-color: #1a237e; color: #fff; }
.btn.primary:hover:not(:disabled) { background: #283593; }
.btn.danger { color: #c62828; border-color: #e4b4b4; }
.btn.danger:hover:not(:disabled) { background: #fdecea; }
.btn.ghost { background: transparent; color: #c5cae9; border-color: rgba(255,255,255,.35); }
.btn.ghost:hover { color: #fff; }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn.wide { width: 100%; }

.toolbar {
  display: flex; flex-wrap: wrap; gap: 16px; justify-content: space-between;
  align-items: center; background: #fff; border: 1px solid #e3e6ee;
  border-radius: 10px; padding: 12px 16px; margin-bottom: 16px;
}
.model-picker { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.model-picker select { max-width: 420px; }
.pricing { font-size: 12.5px; color: #555e73; }
.upload-box { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }

select, input {
  font: inherit; padding: 6px 8px; border: 1px solid #c3c8d4; border-radius: 7px;
  background: #fff;
}

table.grid {
  width: 100%; border-collapse: collapse; background: #fff;
  border: 1px solid #e3e6ee; border-radius: 10px; overflow: hidden;
}
table.grid.narrow { max-width: 640px; }
.grid th, .grid td {
  text-align: left; padding: 9px 12px; border-bottom: 1px solid #edf0f5;
  vertical-align: top; font-size: 13.5px;
}
.grid th { background: #eef0f5; font-size: 12.5px; text-transform: uppercase;
  letter-spacing: .3px; color: #555e73; }
.grid tr:last-child td { border-bottom: none; }
.actions-col { width: 300px; }
.empty { color: #8a92a6; text-align: center; padding: 24px !important; }

a.filelink { color: #1a48c4; text-decoration: none; word-break: break-all; }
a.filelink:hover { text-decoration: underline; }
.result-line { display: flex; gap: 6px; align-items: baseline; }
.open-mini { font-size: 12px; text-decoration: none; }

.status-ok { color: #2e7d32; }
.status-err { color: #c62828; cursor: pointer; }
.status-progress { color: #e65100; font-style: italic; }
details.errbox pre {
  white-space: pre-wrap; word-break: break-word; background: #fdecea;
  padding: 8px; border-radius: 6px; font-size: 12px; max-width: 380px; margin: 6px 0 0;
}
.muted { color: #8a92a6; font-size: 12.5px; }

.pager { display: flex; gap: 8px; align-items: center; margin-top: 14px; }
.flash {
  margin: 0 0 14px; padding: 10px 14px; border-radius: 8px; font-size: 13.5px;
  background: #e8f5e9; border: 1px solid #b7dfb9; color: #1b5e20;
}
.flash.error { background: #fdecea; border-color: #f1b8b4; color: #b71c1c; }

.settings-form { max-width: 720px; display: flex; flex-direction: column; gap: 14px; }
.settings-form.narrow { max-width: 420px; }
.settings-form label { display: flex; flex-direction: column; gap: 4px; font-weight: 600;
  font-size: 13px; color: #444d63; }
.settings-form input { font-weight: 400; }

.login-body { display: flex; min-height: 100vh; align-items: center; justify-content: center; }
.login-card {
  background: #fff; border: 1px solid #e3e6ee; border-radius: 12px;
  padding: 32px; width: 340px; box-shadow: 0 8px 30px rgba(20,30,80,.08);
}
.login-card h1 { font-size: 18px; margin: 0 0 18px; text-align: center; }
.login-card form { display: flex; flex-direction: column; gap: 14px; }
.login-card label { display: flex; flex-direction: column; gap: 4px; font-size: 13px;
  font-weight: 600; color: #444d63; }
.alert { background: #fdecea; border: 1px solid #f1b8b4; color: #b71c1c;
  padding: 8px 12px; border-radius: 8px; margin-bottom: 14px; font-size: 13.5px; }
