/* =========================================
   RQL CORE STYLES (CLEAN + POLISHED)
   ========================================= */

:root{
  --bg:#f7f9fb;
  --card:#ffffff;
  --text:#1f2933;
  --muted:#52606d;
  --border:#d9e2ec;
  --brand:#0b2a4a;
  --brand-2:#123a66;
  --soft:#f1f5f9;

  --ok-bg:#e8f7ee;
  --ok-text:#166534;

  --warn-bg:#fff7e6;
  --warn-text:#9a6700;

  --bad-bg:#fdecec;
  --bad-text:#b42318;
}

*{box-sizing:border-box}

body{
  font-family:system-ui,-apple-system,Segoe UI,Roboto,Arial,sans-serif;
  background:var(--bg);
  margin:0;
  color:var(--text);
  line-height:1.5;
}

/* =========================================
   HEADER (LOGO LEFT, MENU CENTER)
   ========================================= */

.topbar{
  background:#fff;
  border-bottom:1px solid var(--border);
  padding:6px 12px;
  position:static;
  z-index:10;
}

.topbar-inner{
  max-width:1180px;
  margin:0 auto;
  display:flex;
  flex-direction:column;
  gap:5px;
}

.topbar-brand-row{
  display:flex;
  align-items:center;
  justify-content:center;
}

.brand-link{
  display:flex;
  align-items:center;
  gap:8px;
  color:var(--brand);
  text-decoration:none;
}

.brand-logo{
  width:50px;
  height:50px;
  max-width:50px;
  max-height:50px;
  object-fit:contain;
  display:block;
}

.brand-text{
  display:flex;
  flex-direction:column;
  line-height:1.05;
}

.brand-text strong{
  font-size:16px;
}

.brand-text small{
  font-size:11px;
  color:var(--muted);
}

.topbar-menu-row{
  display:flex;
  align-items:center;
  justify-content:center;
  gap:8px 12px;
  flex-wrap:wrap;
  font-size:13px;
}

.topbar-menu-row a{
  color:var(--brand);
  text-decoration:none;
  font-weight:600;
}

.topbar-tools{
  display:flex;
  justify-content:center;
  align-items:center;
  gap:8px;
  flex-wrap:wrap;
}

/* =========================================
   LAYOUT
   ========================================= */

.wrap{
  max-width:1100px;
  margin:0 auto;
  padding:18px;
}

.card{
  background:var(--card);
  border:1px solid var(--border);
  border-radius:14px;
  padding:16px;
  margin:14px 0;
}

h1{font-size:28px}
h2{font-size:22px}
h3{font-size:18px}

.note{
  color:var(--muted);
  margin:8px 0;
}

.badge {
  display: inline-block;
  padding: 4px 8px;
  border-radius: 999px;
  border: 1px solid #ddd;
  font-size: 12px;
  font-weight: 700;
}

.pre {
  white-space: pre-wrap;
  background: #f8f8f8;
  padding: 12px;
  border-radius: 10px;
  border: 1px solid #eee;
}

/* =========================================
   BUTTONS
   ========================================= */

.btn{
  display:inline-block;
  background:var(--brand);
  color:#fff;
  padding:10px 14px;
  border-radius:10px;
  text-decoration:none;
  font-weight:700;
  border:none;
  cursor:pointer;
}

.btn:hover{ background:var(--brand-2); }

.btn.ghost{
  background:#fff;
  color:var(--brand);
  border:1px solid var(--border);
}

/* =========================================
   FORMS (FIXED + CLEAN)
   ========================================= */

form label{
  display:block;
  margin-top:12px;
  margin-bottom:6px;
  font-weight:600;
}

textarea,
input,
select{
  width:100%;
  border:1px solid var(--border);
  border-radius:10px;
  padding:10px;
  margin-bottom:10px;
  background:#fff;
  color:var(--text);
}

/* ✅ IMPORTANT FIX (your question) */
select{
  appearance:auto;
  cursor:pointer;
}

/* Focus */
textarea:focus,
input:focus,
select:focus{
  outline:none;
  border-color:#b7c6d8;
  box-shadow:0 0 0 3px rgba(11,42,74,0.08);
}

/* =========================================
   GRID
   ========================================= */

.grid{
  display:grid;
  grid-template-columns:repeat(auto-fit,minmax(220px,1fr));
  gap:12px;
}

/* =========================================
   CHECKBOX FIX (MAJOR FIX)
   ========================================= */

.checkbox-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.checkline{
  display:flex;
  align-items:center;
  gap:8px;
  margin:0;
}

/* FIXED checkbox size + alignment */
.checkline input[type="checkbox"] {
  width: 16px;
  height: 16px;
}

/* =========================================
   BADGES (CONSISTENT)
   ========================================= */

.badge{
  display:inline-block;
  padding:4px 10px;
  border-radius:999px;
  font-size:0.85rem;
  font-weight:600;
}

.badge.ok{
  background:var(--ok-bg);
  color:var(--ok-text);
}

.badge.warn{
  background:var(--warn-bg);
  color:var(--warn-text);
}

.badge.bad{
  background:var(--bad-bg);
  color:var(--bad-text);
}

.badge.soft{
  background:var(--soft);
  color:#334155;
  border:1px solid var(--border);
}

/* =========================================
   META ROWS
   ========================================= */

.meta-row{
  display:flex;
  flex-wrap:wrap;
  gap:8px 12px;
  margin-top:8px;
  color:var(--muted);
}

/* =========================================
   PRE TEXT
   ========================================= */

.pre{
  white-space:pre-wrap;
  background:var(--soft);
  border-radius:10px;
  padding:12px;
  border:1px solid #e6edf5;
}

/* =========================================
   FOOTER
   ========================================= */

.footer{
  margin-top:30px;
  padding:18px;
  border-top:1px solid var(--border);
  background:#fff;
  text-align:center;
}

.footer a{
  margin:0 8px;
  text-decoration:none;
  color:var(--brand);
}

.footer a:hover{
  text-decoration:underline;
}

/* =========================================
   MOBILE
   ========================================= */

@media (max-width:720px){

  .topbar{
    flex-direction:column;
    gap:10px;
  }

  .topbar .menu{
    flex-wrap:wrap;
  }

  .grid{
    grid-template-columns:1fr;
  }
}

.search-form {
    display: flex;
    gap: 6px;
}

.search-form input {
    padding: 6px 8px;
    border-radius: 6px;
    border: 1px solid #ccc;
}

.search-form button {
    padding: 6px 10px;
    border-radius: 6px;
    border: none;
    background: #0b5ed7;
    color: white;
}

.search-form select {
    padding: 6px;
    border-radius: 6px;
    border: 1px solid #ccc;
}

.quality-box {
    border: 1px solid #eee;
    padding: 10px;
    margin-top: 8px;
    border-radius: 6px;
    background: #fafafa;
}

.tabs a.active-tab {
  font-weight: 800;
}


/* ============================================================
   GLOBAL CHECKBOX / RADIO ALIGNMENT FIX
   Prevent checkboxes from inheriting full-width input styling.
   ============================================================ */

input[type="checkbox"],
input[type="radio"] {
  width: auto !important;
  min-width: 0 !important;
  max-width: none !important;
  display: inline-block !important;
  margin: 0 8px 0 0 !important;
  padding: 0 !important;
  vertical-align: middle !important;
}

label input[type="checkbox"],
label input[type="radio"] {
  margin-right: 8px !important;
}

.check-row,
.checkbox-row,
.radio-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 8px 0;
  line-height: 1.4;
}

.check-row input[type="checkbox"],
.checkbox-row input[type="checkbox"],
.radio-row input[type="radio"] {
  flex: 0 0 auto;
  margin: 0 !important;
}

.check-row label,
.checkbox-row label,
.radio-row label {
  margin: 0;
  display: inline;
}
