* { box-sizing: border-box; margin: 0; padding: 0; }
body { font-family: -apple-system, Segoe UI, Roboto, Arial, sans-serif; background: #f4f6f8; color: #1f2937; }
.app { display: flex; min-height: 100vh; }

.sidebar { width: 220px; background: #1f2937; color: #fff; display: flex; flex-direction: column; padding: 20px 0; flex-shrink: 0; }
.sidebar .brand { font-size: 20px; font-weight: 700; padding: 0 20px 20px; border-bottom: 1px solid #374151; margin-bottom: 10px; }
.sidebar a { color: #d1d5db; text-decoration: none; padding: 10px 20px; font-size: 14px; }
.sidebar a:hover { background: #374151; color: #fff; }
.sidebar .logout { margin-top: auto; border-top: 1px solid #374151; color: #f87171; }

.content { flex: 1; padding: 30px; max-width: 1100px; }

h1 { font-size: 22px; margin-bottom: 20px; }
h2 { font-size: 18px; margin-bottom: 12px; }

.card { background: #fff; border-radius: 8px; padding: 20px; margin-bottom: 20px; box-shadow: 0 1px 3px rgba(0,0,0,0.08); }

table { width: 100%; border-collapse: collapse; background: #fff; border-radius: 8px; overflow: hidden; }
th, td { text-align: left; padding: 10px 12px; border-bottom: 1px solid #e5e7eb; font-size: 14px; }
th { background: #f9fafb; font-weight: 600; }
tr:hover { background: #f9fafb; }

.btn { display: inline-block; padding: 8px 16px; background: #2563eb; color: #fff; border: none; border-radius: 6px; text-decoration: none; font-size: 14px; cursor: pointer; }
.btn:hover { background: #1d4ed8; }
.btn.small { padding: 4px 10px; font-size: 12px; }
.btn.danger { background: #dc2626; }
.btn.secondary { background: #6b7280; }

form.form { max-width: 480px; }
.form label { display: block; margin-bottom: 6px; font-size: 13px; font-weight: 600; color: #374151; }
.form input, .form select, .form textarea {
  width: 100%; padding: 9px 12px; margin-bottom: 16px; border: 1px solid #d1d5db; border-radius: 6px; font-size: 14px;
}

.badge { padding: 3px 10px; border-radius: 999px; font-size: 12px; font-weight: 600; }
.badge.green { background: #dcfce7; color: #166534; }
.badge.yellow { background: #fef9c3; color: #854d0e; }
.badge.red { background: #fee2e2; color: #991b1b; }
.badge.gray { background: #f3f4f6; color: #374151; }

.alert { padding: 12px 16px; border-radius: 6px; margin-bottom: 16px; font-size: 14px; }
.alert.error { background: #fee2e2; color: #991b1b; }
.alert.success { background: #dcfce7; color: #166534; }

.login-box { max-width: 360px; margin: 80px auto; }

/* ============ LOGIN PAGE ============ */
body.login-page {
  margin: 0;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background:
    repeating-linear-gradient(135deg, rgba(255,255,255,0.03) 0px, rgba(255,255,255,0.03) 2px, transparent 2px, transparent 40px),
    linear-gradient(135deg, #5a6b98 0%, #3d4d7a 45%, #2b3660 100%);
  background-attachment: fixed;
}

.login-wrap { width: 100%; padding: 20px; display: flex; justify-content: center; }

.login-card {
  background: #ffffff;
  border-radius: 16px;
  padding: 40px 44px 32px;
  width: 100%;
  max-width: 460px;
  box-shadow: 0 20px 50px rgba(20, 25, 50, 0.35);
}

.login-logo {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 28px;
}

.login-logo-text {
  font-size: 20px;
  font-weight: 700;
  color: #1f2937;
  letter-spacing: -0.3px;
}
.login-logo-text .accent { color: #3b5998; }

.login-card h1 {
  font-size: 30px;
  font-weight: 700;
  color: #111827;
  margin-bottom: 26px;
}

.login-card label {
  display: block;
  font-size: 14px;
  font-weight: 500;
  color: #374151;
  margin-bottom: 6px;
}

.login-card input[type="text"],
.login-card input[type="password"] {
  width: 100%;
  padding: 12px 14px;
  margin-bottom: 20px;
  border: 1px solid #d1d5db;
  border-radius: 8px;
  font-size: 15px;
  color: #111827;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.login-card input[type="text"]:focus,
.login-card input[type="password"]:focus {
  outline: none;
  border-color: #3b5998;
  box-shadow: 0 0 0 3px rgba(59, 89, 152, 0.15);
}
.login-card input::placeholder { color: #9ca3af; }

.login-forgot { text-align: right; margin-bottom: 22px; margin-top: -10px; }
.login-forgot a { color: #3b5998; font-size: 13.5px; text-decoration: none; }
.login-forgot a:hover { text-decoration: underline; }

.login-card button[type="submit"] {
  width: 100%;
  padding: 13px;
  background: #3b5998;
  color: #fff;
  border: none;
  border-radius: 8px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s;
}
.login-card button[type="submit"]:hover { background: #324c82; }

.login-hint { margin-top: 18px; font-size: 12px; color: #9ca3af; text-align: center; }

.stats { display: flex; gap: 16px; margin-bottom: 24px; flex-wrap: wrap; }
.stat { background: #fff; border-radius: 8px; padding: 18px 24px; box-shadow: 0 1px 3px rgba(0,0,0,0.08); min-width: 140px; }
.stat .num { font-size: 28px; font-weight: 700; }
.stat .label { font-size: 13px; color: #6b7280; }

.toolbar { display: flex; justify-content: space-between; align-items: center; margin-bottom: 16px; }
