* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: "Segoe UI", Roboto, Arial, sans-serif;
  background: #f4f6f8;
  color: #1f2937;
  font-size: 14px;
}
a { color: #1d4ed8; text-decoration: none; }
a:hover { text-decoration: underline; }

.topbar {
  display: flex;
  align-items: center;
  gap: 24px;
  background: #111827;
  color: #e5e7eb;
  padding: 0 20px;
  height: 52px;
  flex-wrap: wrap;
}
.topbar .brand a { color: #fff; font-weight: 700; font-size: 17px; }
.topbar nav { display: flex; gap: 14px; flex-wrap: wrap; }
.topbar nav a { color: #cbd5e1; }
.topbar nav a:hover { color: #fff; text-decoration: none; }
.userbox { margin-left: auto; display: flex; gap: 12px; align-items: center; }
.userbox .logout { color: #fca5a5; }

main { padding: 20px 24px; max-width: 1280px; margin: 0 auto; }
h1 { font-size: 22px; margin: 6px 0 16px; }
h2 { font-size: 17px; margin: 24px 0 10px; }
.section-danger { color: #b91c1c; }

.page-head { display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; }
.actions { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.search input { padding: 7px 10px; border: 1px solid #d1d5db; border-radius: 6px; }

table {
  width: 100%;
  border-collapse: collapse;
  background: #fff;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 1px 2px rgba(0,0,0,.06);
}
th, td { padding: 9px 12px; text-align: left; border-bottom: 1px solid #e5e7eb; vertical-align: top; }
th { background: #f9fafb; font-weight: 600; color: #374151; white-space: nowrap; }
tr:hover td { background: #f8fafc; }
.col-actions { white-space: nowrap; text-align: right; }
.muted { color: #6b7280; font-size: 12px; }
.empty { color: #6b7280; text-align: center; padding: 24px; }
.date { white-space: nowrap; font-variant-numeric: tabular-nums; }
.overdue { color: #b91c1c; font-weight: 700; }

.btn, button[type=submit] {
  display: inline-block;
  background: #1d4ed8;
  color: #fff;
  border: none;
  padding: 8px 16px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 14px;
}
.btn:hover, button[type=submit]:hover { background: #1e40af; text-decoration: none; }
.btn-small {
  display: inline-block;
  background: #e5e7eb;
  color: #111827;
  padding: 4px 10px;
  border-radius: 5px;
  border: none;
  cursor: pointer;
  font-size: 12px;
}
.btn-del { background: #fee2e2; color: #b91c1c; }
.btn-ghost { color: #6b7280; padding: 8px 12px; }
.inline { display: inline; }

.cards { display: flex; gap: 14px; flex-wrap: wrap; margin: 8px 0 20px; }
.card {
  background: #fff;
  border-radius: 10px;
  padding: 16px 22px;
  min-width: 130px;
  box-shadow: 0 1px 2px rgba(0,0,0,.06);
  border-top: 3px solid #d1d5db;
}
.card-num { font-size: 28px; font-weight: 700; }
.card-label { color: #6b7280; margin-top: 2px; }
.card-warn { border-top-color: #f59e0b; }
.card-warn .card-num { color: #b45309; }
.card-danger { border-top-color: #dc2626; }
.card-danger .card-num { color: #b91c1c; }

.badge {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 999px;
  font-size: 12px;
  white-space: nowrap;
}
.badge-new { background: #dbeafe; color: #1e40af; }
.badge-in_progress { background: #fef3c7; color: #92400e; }
.badge-done { background: #dcfce7; color: #166534; }
.badge-cancelled { background: #e5e7eb; color: #4b5563; }

.edit-form {
  background: #fff;
  border-radius: 10px;
  padding: 20px 24px;
  max-width: 720px;
  box-shadow: 0 1px 2px rgba(0,0,0,.06);
}
.frow { margin-bottom: 14px; display: flex; flex-direction: column; gap: 5px; }
.frow label { font-weight: 600; color: #374151; }
.frow input, .frow select, .frow textarea {
  padding: 8px 10px;
  border: 1px solid #d1d5db;
  border-radius: 6px;
  font-size: 14px;
  font-family: inherit;
}
.frow-actions { flex-direction: row; align-items: center; gap: 12px; margin-top: 20px; }

.alert {
  background: #fee2e2;
  color: #b91c1c;
  border: 1px solid #fecaca;
  padding: 10px 14px;
  border-radius: 8px;
  margin-bottom: 14px;
  max-width: 720px;
}

.login-box {
  max-width: 360px;
  margin: 8vh auto;
  background: #fff;
  padding: 28px 32px;
  border-radius: 12px;
  box-shadow: 0 4px 16px rgba(0,0,0,.08);
}
.login-box h1 { margin-top: 0; font-size: 20px; }
.login-box form { display: flex; flex-direction: column; gap: 10px; }
.login-box label { font-weight: 600; }
.login-box input { padding: 9px 11px; border: 1px solid #d1d5db; border-radius: 6px; }
