* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: #0f172a;
  color: #e5e7eb;
}
a { color: inherit; text-decoration: none; }
.app-shell {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
.top-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.75rem 1.5rem;
  background: #020617;
  border-bottom: 1px solid #1f2937;
}
.logo {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.logo-img {
  width: 32px;
  height: 32px;
  border-radius: 999px;
  object-fit: cover;
}
.logo-mark {
  width: 32px;
  height: 32px;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--primary, #22c55e), var(--accent, #14b8a6));
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.85rem;
  color: #020617;
}
.logo-text {
  font-weight: 600;
  letter-spacing: 0.03em;
}
.top-nav a {
  margin-left: 1rem;
  font-size: 0.9rem;
  opacity: 0.8;
}
.top-nav a:hover { opacity: 1; }
.page-body {
  flex: 1;
  padding: 2rem 1rem 3rem;
  display: flex;
  justify-content: center;
}
.card {
  background: #020617;
  border-radius: 1rem;
  padding: 1.75rem 1.5rem;
  box-shadow: 0 24px 60px rgba(0,0,0,0.55);
  border: 1px solid #1f2937;
  max-width: 1000px;
  width: 100%;
}
.card-centered {
  max-width: 520px;
  text-align: center;
}
.card-centered.narrow {
  max-width: 420px;
}
h1, h2 {
  margin-top: 0;
  margin-bottom: 0.5rem;
}
h3 { margin-top: 1rem; margin-bottom: 0.5rem; }
.subtitle {
  margin: 0.25rem 0 1.25rem;
  font-size: 0.95rem;
  color: #9ca3af;
}
.button-row {
  display: flex;
  gap: 0.75rem;
  justify-content: center;
  margin-top: 1rem;
  flex-wrap: wrap;
}
.button-row.left {
  justify-content: flex-start;
}
.btn {
  border-radius: 999px;
  padding: 0.55rem 1.4rem;
  font-size: 0.9rem;
  border: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  text-decoration: none;
  transition: transform 0.08s ease, box-shadow 0.08s ease, background 0.12s ease;
}
.btn.big {
  padding: 0.75rem 1.75rem;
  font-size: 1rem;
}
.btn.primary {
  background: linear-gradient(135deg, var(--primary, #22c55e), var(--accent, #14b8a6));
  color: #020617;
  font-weight: 600;
}
.btn.secondary {
  background: #111827;
  border: 1px solid #1f2937;
  color: #e5e7eb;
}
.btn.full { width: 100%; }
.btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 14px 35px rgba(0,0,0,0.35);
}
.btn.secondary:hover {
  background: #020617;
}
.form-vertical label {
  display: block;
  text-align: left;
  margin-bottom: 0.15rem;
  font-size: 0.85rem;
  color: #9ca3af;
}
.form-vertical input, .form-grid input, .form-grid select, .toolbar input, .toolbar select {
  width: 100%;
  padding: 0.45rem 0.6rem;
  border-radius: 0.55rem;
  border: 1px solid #374151;
  background: #020617;
  color: #e5e7eb;
  font-size: 0.9rem;
}
.form-vertical input:focus, .form-grid input:focus, .form-grid select:focus, .toolbar input:focus, .toolbar select:focus {
  outline: 2px solid var(--primary, #22c55e);
  outline-offset: 1px;
  border-color: transparent;
}
.form-vertical label + input { margin-bottom: 0.6rem; }
.form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 0.9rem 1rem;
}
.form-grid .full-row {
  grid-column: 1 / -1;
}
.flash {
  padding: 0.5rem 0.75rem;
  border-radius: 0.6rem;
  font-size: 0.85rem;
  margin-bottom: 0.75rem;
}
.flash-danger { background: rgba(248, 113, 113, 0.15); color: #fecaca; border: 1px solid #b91c1c; }
.flash-success { background: rgba(52, 211, 153, 0.12); color: #bbf7d0; border: 1px solid #16a34a; }
.status {
  margin-top: 1rem;
  font-size: 0.9rem;
}
.status.success { color: #4ade80; }
.status.error { color: #fca5a5; }
.toolbar {
  display: flex;
  gap: 0.75rem;
  align-items: center;
  flex-wrap: wrap;
  margin-bottom: 1rem;
}
.toolbar input[type="text"], .toolbar input[type="date"], .toolbar input[type="datetime-local"], .toolbar select {
  min-width: 160px;
}
.table-wrapper {
  margin-top: 0.5rem;
  overflow-x: auto;
}
table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}
thead {
  background: #020617;
}
th, td {
  padding: 0.5rem 0.6rem;
  border-bottom: 1px solid #1f2937;
  text-align: left;
}
tbody tr:hover {
  background: rgba(15,23,42,0.75);
}
.text-right { text-align: right; }
.link {
  font-size: 0.85rem;
  color: var(--primary, #22c55e);
}
.stats-row {
  display: flex;
  gap: 1rem;
  margin: 1rem 0 1.25rem;
  flex-wrap: wrap;
}
.stat {
  background: #020617;
  border-radius: 0.75rem;
  padding: 0.75rem 1rem;
  border: 1px solid #1f2937;
  min-width: 120px;
}
.stat .label {
  display: block;
  font-size: 0.75rem;
  color: #9ca3af;
}
.stat .value {
  display: block;
  font-size: 1.3rem;
  font-weight: 600;
  margin-top: 0.2rem;
}
.row-alert {
  background: rgba(248, 113, 113, 0.08);
}
.clock-wrapper {
  width: 100%;
  display: flex;
  justify-content: center;
}
@media (max-width: 640px) {
  .page-body { padding: 1.5rem 0.75rem 2.5rem; }
  .top-bar { padding-inline: 1rem; }
}
