/* Umami-PHP — minimal admin UI styles */
*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, 'PingFang SC', 'Microsoft YaHei', sans-serif;
  background: #f5f6f8;
  color: #1f2937;
  font-size: 14px;
  line-height: 1.5;
}

a { color: #2563eb; text-decoration: none; }
a:hover { text-decoration: underline; }

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 24px;
}

/* Top nav */
.top-nav {
  background: #ffffff;
  border-bottom: 1px solid #e5e7eb;
  position: sticky;
  top: 0;
  z-index: 10;
}
.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 24px;
}
.top-nav .brand {
  font-weight: 700;
  font-size: 18px;
  color: #111827;
}
.top-nav nav a {
  margin: 0 8px;
  color: #374151;
}
.top-nav .user {
  display: flex;
  align-items: center;
  gap: 12px;
}

/* Buttons */
.btn {
  display: inline-block;
  padding: 8px 16px;
  background: #2563eb;
  color: #ffffff;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  text-decoration: none;
  font-size: 14px;
}
.btn:hover { background: #1d4ed8; text-decoration: none; }
.btn.small { padding: 4px 10px; font-size: 12px; }
.btn.danger { background: #dc2626; }
.btn.danger:hover { background: #b91c1c; }

/* Forms */
form label {
  display: block;
  margin-bottom: 12px;
  font-weight: 500;
}
form input, form select {
  display: block;
  width: 100%;
  margin-top: 4px;
  padding: 8px 10px;
  border: 1px solid #d1d5db;
  border-radius: 6px;
  font-size: 14px;
  background: #fff;
}
form input:focus, form select:focus {
  outline: none;
  border-color: #2563eb;
  box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.2);
}

.inline-form {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
  align-items: end;
}
.inline-form button { grid-column: auto; }

fieldset {
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  padding: 16px;
  margin-bottom: 16px;
}
fieldset legend {
  padding: 0 8px;
  font-weight: 600;
  color: #374151;
}

/* Tables */
.data-table {
  width: 100%;
  border-collapse: collapse;
  background: #fff;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 1px 2px rgba(0,0,0,0.05);
}
.data-table th, .data-table td {
  padding: 12px 16px;
  border-bottom: 1px solid #f0f1f3;
  text-align: left;
}
.data-table th {
  background: #f9fafb;
  font-weight: 600;
  color: #374151;
}
.data-table tr:last-child td { border-bottom: none; }
.actions { white-space: nowrap; display: flex; gap: 6px; align-items: center; }

/* Cards / metrics */
.metrics {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 16px;
  margin: 16px 0;
}
.metric-summary {
  background: #fff;
  padding: 16px;
  border-radius: 8px;
  box-shadow: 0 1px 2px rgba(0,0,0,0.05);
}
.metric-summary .label {
  color: #6b7280;
  font-size: 12px;
  text-transform: uppercase;
}
.metric-summary .value {
  font-size: 28px;
  font-weight: 700;
  color: #111827;
  margin-top: 4px;
}

.chart-box {
  background: #fff;
  padding: 16px;
  border-radius: 8px;
  box-shadow: 0 1px 2px rgba(0,0,0,0.05);
  margin: 16px 0;
}

.metric-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 16px;
  margin-top: 16px;
}
.metric-card {
  background: #fff;
  border-radius: 8px;
  padding: 16px;
  box-shadow: 0 1px 2px rgba(0,0,0,0.05);
}
.metric-card h3 {
  margin: 0 0 12px;
  font-size: 14px;
  color: #374151;
}
.metric-list .row {
  display: flex;
  justify-content: space-between;
  padding: 6px 0;
  border-bottom: 1px solid #f0f1f3;
  font-size: 13px;
}
.metric-list .row:last-child { border-bottom: none; }
.metric-list .name {
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-right: 12px;
}
.metric-list .count {
  color: #6b7280;
  font-variant-numeric: tabular-nums;
}
.metric-list .empty {
  color: #9ca3af;
  text-align: center;
  padding: 12px;
}

/* Headings */
h1 { font-size: 22px; margin: 0 0 16px; }
h1 small { font-size: 14px; font-weight: 400; color: #6b7280; margin-left: 8px; }
h2 { font-size: 18px; margin: 16px 0 12px; }

.page-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}
.page-header > div { display: flex; gap: 8px; align-items: center; }

.add-website {
  background: #fff;
  border-radius: 8px;
  padding: 12px 16px;
  margin-bottom: 16px;
  box-shadow: 0 1px 2px rgba(0,0,0,0.05);
}
.add-website summary {
  cursor: pointer;
  font-weight: 600;
}
.add-website[open] { padding-bottom: 16px; }
.add-website .inline-form { margin-top: 12px; }

/* Login & install pages */
.login-body, .install-body {
  background: linear-gradient(135deg, #eef2ff, #f5f6f8);
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}
.login-wrap, .install-wrap {
  background: #fff;
  border-radius: 12px;
  padding: 32px;
  width: 100%;
  max-width: 480px;
  box-shadow: 0 10px 30px rgba(0,0,0,0.08);
}
.install-wrap { max-width: 640px; }
.login-wrap h1, .install-wrap h1 {
  margin-top: 0;
  text-align: center;
}

/* Messages */
.error {
  background: #fef2f2;
  border: 1px solid #fecaca;
  color: #991b1b;
  padding: 10px 12px;
  border-radius: 6px;
  margin-bottom: 16px;
}
.success {
  background: #f0fdf4;
  border: 1px solid #bbf7d0;
  color: #166534;
  padding: 10px 12px;
  border-radius: 6px;
  margin-bottom: 16px;
}
.empty {
  color: #9ca3af;
  text-align: center;
  padding: 32px;
}

code, pre {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, 'Liberation Mono', monospace;
}
code {
  background: #f3f4f6;
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 12px;
}
pre.code-block {
  background: #111827;
  color: #f3f4f6;
  padding: 16px;
  border-radius: 8px;
  overflow-x: auto;
  font-size: 12px;
  line-height: 1.6;
}

select {
  padding: 6px 10px;
  border: 1px solid #d1d5db;
  border-radius: 6px;
  background: #fff;
  font-size: 13px;
}
