/* assets/css/app.css */
/* No :root used (as you prefer to avoid global conflicts) */

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  font-family: system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
  background: #f4f6fb;
  color: #111827;
  line-height: 1.55;
  word-break: break-word;
  overflow-x: hidden;
}

.sx-wrap { max-width: 1100px; margin: 0 auto; padding: 18px 14px 60px; }
.sx-topbar {
  display:flex; gap: 12px; align-items:center; justify-content:space-between;
  padding: 12px 14px; border: 1px solid #e5e7eb; background:#fff;
  border-radius: 14px;
}
.sx-brand { display:flex; gap: 10px; align-items:center; min-width: 0; }
.sx-logo {
  width: 38px; height: 38px; border-radius: 12px;
  background: #111827; display:flex; align-items:center; justify-content:center;
  color: #fff; font-weight: 800; letter-spacing: .5px;
  flex: 0 0 auto;
}
.sx-brand h1 { margin:0; font-size: 16px; line-height: 1.2; }
.sx-brand p { margin: 2px 0 0; font-size: 12px; color:#6b7280; }

.sx-nav { display:flex; gap: 8px; flex-wrap: wrap; justify-content:flex-end; }
.sx-nav a{
  text-decoration:none; color:#111827; font-weight: 650;
  border: 1px solid #e5e7eb; padding: 8px 10px;
  border-radius: 12px; background:#fff;
}
.sx-nav a:hover { border-color:#cbd5e1; }

.sx-hero { margin-top: 14px; display:grid; gap: 12px; grid-template-columns: 1.2fr .8fr; }
@media (max-width: 860px) { .sx-hero { grid-template-columns: 1fr; } }

.sx-card {
  background:#fff; border: 1px solid #e5e7eb; border-radius: 16px;
  padding: 14px;
}
.sx-card h2 { margin:0 0 6px; font-size: 16px; }
.sx-muted { color:#6b7280; font-size: 13px; margin: 0; }

.sx-grid { display:grid; gap: 12px; grid-template-columns: 1fr 1fr; }
@media (max-width: 860px){ .sx-grid { grid-template-columns: 1fr; } }

.sx-btn {
  display:inline-flex; align-items:center; justify-content:center;
  gap: 8px; padding: 11px 12px;
  border-radius: 14px; border: 1px solid #e5e7eb;
  background:#111827; color:#fff; font-weight: 750;
  text-decoration:none; cursor:pointer;
}
.sx-btn.secondary { background:#fff; color:#111827; }
.sx-btn:disabled { opacity: .6; cursor:not-allowed; }

.sx-rulelist { margin: 10px 0 0; padding-left: 18px; }
.sx-rulelist li { margin: 6px 0; }

.sx-timer {
  font-size: 20px; font-weight: 900;
  padding: 10px 12px; border: 1px dashed #d1d5db;
  border-radius: 14px; background: #f9fafb;
  margin-top: 10px;
}
.sx-timer.closed { border-style: solid; background: #fff1f2; border-color:#fecdd3; }

.sx-form { display:grid; gap: 10px; margin-top: 10px; }
.sx-row { display:grid; gap: 10px; grid-template-columns: 1fr 1fr; }
@media (max-width: 700px){ .sx-row { grid-template-columns: 1fr; } }

.sx-field label { display:block; font-size: 12px; color:#374151; margin-bottom: 6px; font-weight: 700; }
.sx-field input, .sx-field select, .sx-field textarea{
  width:100%; border: 1px solid #e5e7eb; border-radius: 14px;
  padding: 11px 12px; font-size: 14px; outline: none; background: #fff;
}
.sx-field textarea { min-height: 110px; resize: vertical; }
.sx-field input:focus, .sx-field select:focus, .sx-field textarea:focus {
  border-color:#94a3b8;
}

.sx-badge {
  display:inline-flex; align-items:center; gap: 8px;
  padding: 8px 10px; border-radius: 999px; border:1px solid #e5e7eb;
  background:#fff; font-size: 12px; color:#111827; font-weight: 700;
}

.sx-foot {
  margin-top: 14px; text-align:center; color:#6b7280; font-size: 12px;
}

.sx-toast{
  position: fixed; left: 50%; bottom: 18px; transform: translateX(-50%);
  background: #111827; color:#fff; padding: 10px 12px; border-radius: 999px;
  opacity: 0; pointer-events:none; transition: .25s ease;
  max-width: 92vw; text-align:center;
}
.sx-toast.show{ opacity: 1; }
.sx-toast[data-type="error"]{ background:#b91c1c; }
.sx-toast[data-type="success"]{ background:#166534; }

.sx-skel{ border: 1px solid #e5e7eb; border-radius: 14px; padding: 12px; background:#fff; }
.sx-skel-line{
  height: 12px; border-radius: 999px; background: linear-gradient(90deg, #eee, #f6f6f6, #eee);
  background-size: 200% 100%; animation: sxShimmer 1.2s infinite linear;
  margin: 10px 0;
}
.sx-skel-line.w-70{ width: 70%; }
@keyframes sxShimmer { 0%{ background-position: 0% 0; } 100%{ background-position: 200% 0; } }

.sx-table { width:100%; border-collapse: collapse; margin-top: 10px; }
.sx-table th, .sx-table td { border-bottom:1px solid #e5e7eb; padding: 10px 8px; text-align:left; font-size: 13px; vertical-align: top; }
.sx-table th { font-size: 12px; color:#6b7280; }

.sx-kv { display:grid; gap: 8px; margin-top: 10px; }
.sx-kv .row { display:grid; gap: 8px; grid-template-columns: 140px 1fr; }
@media (max-width: 520px){ .sx-kv .row { grid-template-columns: 1fr; } }
.sx-kv .k{ color:#6b7280; font-weight: 700; font-size: 12px; }
.sx-kv .v{ font-weight: 700; font-size: 13px; }