*, *::before, *::after { box-sizing: border-box; }
body { margin: 0; font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif; font-size: 15px; background: #f8f9fa; color: #212529; line-height: 1.5; }

/* Navbar */
.navbar { background: #1e3a8a; color: #fff; padding: 0 24px; display: flex; align-items: center; gap: 32px; height: 56px; }
.navbar .brand { color: #fff; text-decoration: none; font-weight: 700; font-size: 18px; }
.navbar .nav-links { display: flex; gap: 20px; align-items: center; margin-left: auto; }
.navbar .nav-links a { color: rgba(255,255,255,.85); text-decoration: none; font-size: 14px; }
.navbar .nav-links a:hover { color: #fff; }

/* Container */
.container { max-width: 900px; margin: 0 auto; padding: 32px 24px; }

/* Auth card */
.auth-card { max-width: 400px; margin: 80px auto; background: #fff; border-radius: 12px; padding: 40px; box-shadow: 0 4px 24px rgba(0,0,0,.08); }
.auth-card h1 { margin: 0 0 24px; font-size: 24px; }
.auth-footer { margin-top: 20px; font-size: 14px; text-align: center; color: #666; }
.auth-footer a { color: #1e3a8a; }

/* Cards */
.card { background: #fff; border-radius: 12px; padding: 24px; margin-bottom: 20px; box-shadow: 0 1px 4px rgba(0,0,0,.06); }
.card h2 { margin: 0 0 16px; font-size: 17px; color: #333; }

/* Forms */
label { display: block; margin-bottom: 14px; font-size: 14px; color: #555; font-weight: 500; }
label small { font-weight: 400; color: #888; }
input[type=text], input[type=email], input[type=password], input[type=number], input[type=url],
input[type=color], select, textarea {
  display: block; width: 100%; margin-top: 4px; padding: 9px 12px;
  border: 1.5px solid #dee2e6; border-radius: 8px; font-size: 14px; font-family: inherit;
  outline: none; background: #fff; transition: border-color .15s;
}
input:focus, select:focus, textarea:focus { border-color: #1e3a8a; }
input[type=color] { padding: 2px 4px; height: 38px; cursor: pointer; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.checkbox-label { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; font-weight: 400; cursor: pointer; }
.checkbox-label input { width: auto; margin: 0; }
.radio-label { display: inline-flex; align-items: center; gap: 6px; margin-right: 16px; cursor: pointer; font-weight: 400; }
.radio-label input { width: auto; }
fieldset { border: 1px solid #dee2e6; border-radius: 8px; padding: 12px 16px; margin: 0 0 14px; }
legend { font-size: 13px; color: #666; padding: 0 4px; }

/* Buttons */
.btn-primary { background: #1e3a8a; color: #fff; border: none; border-radius: 8px; padding: 10px 20px; font-size: 15px; font-family: inherit; cursor: pointer; transition: background .15s; }
.btn-primary:hover { background: #1e40af; }
.btn-sm { background: #e9ecef; color: #333; border: none; border-radius: 6px; padding: 6px 12px; font-size: 13px; font-family: inherit; cursor: pointer; transition: background .15s; text-decoration: none; display: inline-block; }
.btn-sm:hover { background: #dee2e6; }
.btn-danger { background: #fee2e2; color: #c00; }
.btn-danger:hover { background: #fca5a5; }

/* Alerts */
.alert { padding: 12px 16px; border-radius: 8px; margin-bottom: 16px; font-size: 14px; }
.alert-success { background: #d1fae5; color: #065f46; border: 1px solid #a7f3d0; }
.alert-error { background: #fee2e2; color: #991b1b; border: 1px solid #fca5a5; }

/* Tables */
.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th { text-align: left; padding: 10px 12px; border-bottom: 2px solid #e9ecef; color: #555; font-size: 13px; }
.table td { padding: 10px 12px; border-bottom: 1px solid #f1f3f5; vertical-align: top; }
.table tr:last-child td { border-bottom: none; }

/* Badges */
.badge { display: inline-block; padding: 2px 8px; border-radius: 99px; font-size: 12px; font-weight: 600; background: #e9ecef; color: #555; }
.badge-ready    { background: #d1fae5; color: #065f46; }
.badge-error    { background: #fee2e2; color: #991b1b; }
.badge-processing { background: #fef3c7; color: #92400e; }
.badge-pending  { background: #e0e7ff; color: #3730a3; }

/* Stats */
.stats-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin-bottom: 20px; }
.stat-card { background: #fff; border-radius: 12px; padding: 20px; text-align: center; box-shadow: 0 1px 4px rgba(0,0,0,.06); }
.stat-num { font-size: 32px; font-weight: 700; color: #1e3a8a; }
.stat-label { font-size: 13px; color: #888; margin-top: 4px; }

/* Code block */
.code-block { background: #f1f3f5; border-radius: 8px; padding: 14px 16px; display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 8px 0; }
.code-block code { font-family: 'Courier New', monospace; font-size: 13px; word-break: break-all; flex: 1; }
.hint { font-size: 13px; color: #888; margin: 4px 0 0; }

/* Knowledge base */
.starter-row { display: flex; gap: 8px; margin-bottom: 8px; }
.starter-row textarea { flex: 1; }

/* Test results */
.test-result { padding: 6px 10px; border-radius: 6px; font-size: 13px; margin-bottom: 4px; }
.test-result.ok   { background: #d1fae5; color: #065f46; }
.test-result.fail { background: #fee2e2; color: #991b1b; }

/* Pagination */
.pagination { display: flex; align-items: center; gap: 12px; margin-top: 16px; font-size: 14px; }

/* Upload area */
#upload-area { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }

h1 { font-size: 22px; margin: 0 0 20px; color: #1a1a2e; }
