* { box-sizing: border-box; }
body {
  margin: 0;
  background: #f4f6f8;
  color: #1d2733;
  font-family: "Microsoft JhengHei", "Segoe UI", Arial, sans-serif;
}
a { color: #1769aa; text-decoration: none; }
.shell { max-width: 1360px; margin: 0 auto; padding: 24px; }
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}
.top-actions,
.bulk-actions,
.table-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
}
.top-actions form,
.table-actions form { margin: 0; }
h1, h2, p { margin: 0; }
h1 { font-size: 28px; }
h2 { font-size: 18px; margin-bottom: 14px; }
.topbar p,
.hint { color: #647282; margin-top: 6px; }
.panel,
.metrics {
  background: #fff;
  border: 1px solid #dce2e8;
  border-radius: 8px;
  margin-bottom: 16px;
  padding: 16px;
}
.public-panel,
.login-panel {
  width: min(100%, 480px);
  margin: 18vh auto 0;
}
.metrics {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}
.metrics.metrics-five { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.metrics div {
  border-left: 4px solid #2f80ed;
  padding-left: 12px;
}
.metrics span {
  display: block;
  font-size: 28px;
  font-weight: 700;
}
.metrics .metric-text {
  font-size: 18px;
  line-height: 1.35;
  min-height: 38px;
}
.metrics small { color: #647282; }
.upload,
.single-create,
.toolbar,
.toolbar form,
.bulk,
.utm-form,
.admin-user-form,
.analytics-filter {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: space-between;
  margin-bottom: 10px;
}
.login-form,
.inline-form {
  display: grid;
  gap: 12px;
  margin-top: 18px;
}
.inline-form {
  display: inline-flex;
  align-items: center;
  flex-wrap: wrap;
  margin-top: 0;
  gap: 8px;
}
.login-form label,
.analytics-filter label {
  display: grid;
  gap: 6px;
  color: #4d5d6c;
}
.analytics-filter {
  align-items: flex-end;
  justify-content: flex-start;
}
.analytics-filter select[multiple] {
  min-width: 260px;
  min-height: 118px;
}
input,
select {
  min-height: 36px;
  border: 1px solid #c8d1da;
  border-radius: 6px;
  padding: 7px 10px;
  background: #fff;
}
input[type="search"] { min-width: 280px; }
.single-create input[name="title"] {
  min-width: 260px;
  flex: 1 1 260px;
}
.single-create input[name="url"] {
  min-width: 360px;
  flex: 2 1 360px;
}
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 36px;
  border: 1px solid #c8d1da;
  border-radius: 6px;
  padding: 7px 12px;
  background: #fff;
  color: #1d2733;
  cursor: pointer;
  font-size: 14px;
}
.button.primary {
  border-color: #1769aa;
  background: #1769aa;
  color: #fff;
}
.button.small {
  min-height: 30px;
  padding: 5px 10px;
}
.button.danger {
  border-color: #d64545;
  color: #9d2828;
}
.button.disabled {
  color: #8a96a3;
  background: #f2f4f7;
  cursor: default;
}
.alerts { margin-bottom: 16px; }
.alert {
  border: 1px solid #b7d7bd;
  background: #eef8f0;
  color: #275d33;
  border-radius: 8px;
  padding: 10px 12px;
  margin-bottom: 8px;
}
.table-wrap {
  width: 100%;
  overflow-x: auto;
}
table {
  width: 100%;
  border-collapse: collapse;
}
th,
td {
  padding: 10px;
  border-bottom: 1px solid #e5e9ef;
  vertical-align: top;
  text-align: left;
}
th {
  color: #52616f;
  font-size: 13px;
}
td.title {
  min-width: 220px;
  font-weight: 600;
}
.status {
  display: inline-flex;
  border-radius: 999px;
  padding: 3px 9px;
  background: #e8f4ff;
  color: #1769aa;
  font-size: 12px;
}
.status.archived {
  background: #fff6dc;
  color: #825d00;
}
.status.deleted {
  background: #ffe9e9;
  color: #9d2828;
}
.empty {
  color: #7a8794;
  text-align: center;
  padding: 18px;
}
.muted { color: #7a8794; }
.batch-list {
  display: grid;
  gap: 8px;
}
.pagination {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 14px;
}
.page-jump {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.page-jump input[type="number"] { width: 76px; }
@media (max-width: 760px) {
  .shell { padding: 14px; }
  .topbar,
  .metrics,
  .metrics.metrics-five {
    display: grid;
    grid-template-columns: 1fr;
  }
  input[type="search"],
  .single-create input[name="title"],
  .single-create input[name="url"],
  .analytics-filter label,
  .analytics-filter input,
  .analytics-filter select,
  .analytics-filter select[multiple] {
    min-width: 100%;
    width: 100%;
  }
}
