:root {
  --bg: #f4f6f9;
  --card: #ffffff;
  --text: #1f2430;
  --muted: #6b7280;
  --primary: #2563eb;
  --primary-dark: #1d4ed8;
  --red: #dc2626;
  --red-bg: #fee2e2;
  --orange: #d97706;
  --orange-bg: #fef3c7;
  --green: #16a34a;
  --green-bg: #dcfce7;
  --border: #e5e7eb;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
}

.topbar {
  background: #111827;
  color: #fff;
  padding: 14px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.topbar a { color: #d1d5db; text-decoration: none; margin-left: 18px; font-size: 14px; }
.topbar a.active, .topbar a:hover { color: #fff; font-weight: 600; }
.topbar .brand { font-weight: 700; font-size: 16px; }

.container { max-width: 1200px; margin: 24px auto; padding: 0 20px; }

.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 20px;
  margin-bottom: 20px;
}

h1 { font-size: 22px; margin: 0 0 16px; }
h2 { font-size: 17px; margin: 0 0 12px; }

table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { padding: 8px 10px; border-bottom: 1px solid var(--border); text-align: left; }
th { background: #f9fafb; font-weight: 600; color: var(--muted); font-size: 13px; }
tr:hover { background: #fafafa; }

.badge { display: inline-block; padding: 2px 8px; border-radius: 999px; font-size: 12px; font-weight: 600; }
.badge-late { background: var(--red-bg); color: var(--red); }
.badge-over { background: var(--orange-bg); color: var(--orange); }
.badge-ok { background: var(--green-bg); color: var(--green); }

.btn {
  display: inline-block;
  background: var(--primary);
  color: #fff;
  padding: 9px 16px;
  border-radius: 7px;
  border: none;
  cursor: pointer;
  font-size: 14px;
  text-decoration: none;
}
.btn:hover { background: var(--primary-dark); }
.btn-secondary { background: #6b7280; }
.btn-secondary:hover { background: #4b5563; }
.btn-danger { background: var(--red); }

input[type=text], input[type=password], input[type=number], input[type=date], select {
  width: 100%;
  padding: 9px 10px;
  border: 1px solid var(--border);
  border-radius: 7px;
  font-size: 14px;
  margin-bottom: 10px;
}

label { font-size: 13px; color: var(--muted); font-weight: 600; display: block; margin-bottom: 4px; }

.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 20px; }

.login-wrap { display: flex; align-items: center; justify-content: center; min-height: 100vh; }
.login-card { width: 340px; }

.flash-error { background: var(--red-bg); color: var(--red); padding: 10px 14px; border-radius: 7px; margin-bottom: 14px; font-size: 14px; }
.flash-ok { background: var(--green-bg); color: var(--green); padding: 10px 14px; border-radius: 7px; margin-bottom: 14px; font-size: 14px; }

.small { font-size: 12px; color: var(--muted); }
.right { text-align: right; }
form.inline { display: inline; }
