:root {
  --blue: #6EC1E4;
  --teal: #00BFA6;
  --bg: #f7f9fa;
  --ink: #1c2b33;
  --border: #dfe6ea;
}
* { box-sizing: border-box; }
body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  font-family: -apple-system, Segoe UI, Roboto, sans-serif;
  background: var(--bg);
  color: var(--ink);
}
header {
  background: var(--ink);
  padding: 10px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
}
header .brand {
  display: flex;
  align-items: center;
  gap: 12px;
  color: #fff;
  text-decoration: none;
  font-weight: 600;
  font-size: 1.1rem;
}
header .brand-logo {
  height: 36px;
  width: auto;
  border-radius: 3px;
}
header .brand-name {
  border-left: 1px solid rgba(255,255,255,0.25);
  padding-left: 12px;
}
header .header-nav {
  display: flex;
  align-items: center;
  gap: 14px;
  font-size: 0.85rem;
}
header .header-nav a {
  color: rgba(255,255,255,0.85);
  text-decoration: none;
}
header .header-nav a:hover {
  color: #fff;
  text-decoration: underline;
}
header .header-user {
  color: rgba(255,255,255,0.6);
}
header .header-logout {
  color: rgba(255,255,255,0.85);
  font-size: 0.85rem;
  text-decoration: underline;
}
header .header-logout:hover {
  color: #fff;
}
main {
  max-width: 1100px;
  margin: 24px auto;
  padding: 0 20px;
  flex: 1;
  width: 100%;
}
footer {
  background: var(--ink);
  color: rgba(255,255,255,0.65);
  font-size: 0.78rem;
  padding: 12px 24px;
  text-align: center;
}
footer .footer-legal {
  color: rgba(255,255,255,0.8);
}
footer .footer-meta {
  margin-top: 4px;
  opacity: 0.7;
}
footer .footer-sep {
  margin: 0 8px;
  opacity: 0.5;
}
.page-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}
h1 { font-size: 1.4rem; margin: 0; }
.table {
  width: 100%;
  border-collapse: collapse;
  background: #fff;
  border: 1px solid var(--border);
}
.table th, .table td {
  padding: 8px 10px;
  border-bottom: 1px solid var(--border);
  text-align: left;
  font-size: 0.92rem;
}
.table thead th {
  background: #eef3f5;
}
.row-link { cursor: pointer; }
.row-link:hover { background: #eef8fb; }
.badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 10px;
  font-size: 0.78rem;
  background: #e2e8ec;
  color: var(--ink);
}
.badge-success { background: var(--teal); color: #fff; }
.badge-running { background: var(--blue); color: #fff; }
.badge-failed, .badge-error { background: #e0554f; color: #fff; }
.badge-partial { background: #e0a84f; color: #fff; }
.badge-completed, .badge-dry_run_complete, .badge-dry_run_done { background: var(--teal); color: #fff; }
.error-text { color: #c0392b; font-weight: 500; }
.ok-text { color: #00694f; font-weight: 500; }
.progress-cell { min-width: 180px; }
.progress-bar {
  height: 8px;
  border-radius: 4px;
  background: #e2e8ec;
  overflow: hidden;
  margin-bottom: 4px;
}
.progress-fill {
  height: 100%;
  background: var(--teal);
  transition: width 0.4s ease;
}
.progress-fill.has-failed { background: #e0a84f; }
.progress-text {
  font-size: 0.76rem;
  color: #667;
  white-space: nowrap;
}
.form fieldset {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 6px;
  margin-bottom: 16px;
  padding: 14px 18px;
}
.form label {
  display: block;
  margin-bottom: 10px;
  font-size: 0.9rem;
}
.form label.checkbox { display: flex; align-items: center; gap: 6px; }
.form input[type=text], .form input[type=number], .form input[type=file],
.form input[type=email], .form input[type=password] {
  display: block;
  width: 100%;
  max-width: 420px;
  margin-top: 4px;
  padding: 6px 8px;
  border: 1px solid var(--border);
  border-radius: 4px;
}
.btn {
  display: inline-block;
  padding: 8px 14px;
  border: 1px solid var(--border);
  border-radius: 5px;
  background: #fff;
  cursor: pointer;
  font-size: 0.9rem;
  text-decoration: none;
  color: var(--ink);
}
.btn-primary { background: var(--teal); color: #fff; border-color: var(--teal); }
.btn-link { background: none; border: none; color: var(--blue); cursor: pointer; text-decoration: underline; padding: 0; font-size: 0.85rem; }
.actions { margin-bottom: 16px; display: flex; gap: 10px; align-items: center; }
.meta-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-bottom: 18px;
}
.meta-grid > div {
  background: #fff;
  border: 1px solid var(--border);
  padding: 10px 12px;
  border-radius: 6px;
  font-size: 0.88rem;
}
.flash-stack { margin-bottom: 14px; }
.flash { padding: 8px 12px; border-radius: 5px; margin-bottom: 6px; font-size: 0.9rem; }
.flash-success { background: #d6f5ee; color: #00694f; }
.flash-error { background: #fbdcda; color: #8a241c; }
.empty { color: #667; }
.hint { font-size: 0.82rem; color: #667; margin: 6px 0 10px; }

.checkbox-col { width: 32px; text-align: center; }
.menu-col { width: 40px; text-align: center; position: relative; }
.bulk-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}
.bulk-count { font-size: 0.85rem; color: #667; }

.dropdown { position: relative; display: inline-block; }
.btn-icon {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 1.2rem;
  line-height: 1;
  padding: 4px 8px;
  border-radius: 4px;
  color: var(--ink);
}
.btn-icon:hover { background: #eef3f5; }
.dropdown-menu {
  display: none;
  position: absolute;
  right: 0;
  top: 100%;
  z-index: 10;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 6px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.12);
  min-width: 120px;
  overflow: hidden;
}
.dropdown-menu.open { display: block; }
.dropdown-menu a,
.dropdown-item-btn {
  display: block;
  width: 100%;
  text-align: left;
  padding: 8px 14px;
  font-size: 0.88rem;
  color: var(--ink);
  text-decoration: none;
  background: none;
  border: none;
  cursor: pointer;
}
.dropdown-menu a:hover,
.dropdown-item-btn:hover { background: #eef8fb; }
.dropdown-item-danger { color: #c0392b; }
.dropdown-item-danger:hover { background: #fbdcda; }
.login-wrap {
  max-width: 360px;
  margin: 60px auto 0;
}
.login-wrap h1 {
  text-align: center;
  margin-bottom: 20px;
}
.login-wrap .btn-primary {
  width: 100%;
}
.table.compact th, .table.compact td { padding: 6px 10px; font-size: 0.85rem; }
