*{box-sizing:border-box}
html,body{margin:0;min-height:100%;font-family:Arial,"Microsoft YaHei",sans-serif;color:#172033;background:#f4f7fb}
a{text-decoration:none;color:inherit}

.bg{min-height:100vh;background:#f3f6fb;display:grid;place-items:center;padding:24px}
.card{background:#fff;border-radius:16px;box-shadow:0 10px 35px rgba(20,35,70,.08);padding:24px}
h1{margin:0 0 22px}
h2{margin:24px 0 12px}
label{display:block;margin:14px 0 6px;font-weight:600}
input,textarea,select{
  display:block;
  width:100%;
  max-width:100%;
  padding:12px 13px;
  border:1px solid #d8deea;
  border-radius:10px;
  font:inherit;
  background:#fff;
}
button,.button-link{
  display:inline-block;
  border:0;
  border-radius:10px;
  padding:12px 18px;
  background:#2563eb;
  color:#fff;
  font-weight:700;
  cursor:pointer;
}
button.secondary{background:#475569}
button:disabled{opacity:.55}
.alert{padding:12px 14px;border-radius:10px;margin:12px 0;background:#eef2ff}
.success{background:#eaf8ef;color:#176a36}
.error{background:#fff0f0;color:#a12828}

/* Front page */
.landing{min-height:100vh;background:linear-gradient(135deg,#0f172a,#1d4ed8)}
.hero{
  min-height:100vh;
  display:grid;
  grid-template-columns:minmax(0,1.05fr) minmax(380px,.95fr);
  gap:50px;
  align-items:center;
  max-width:1180px;
  margin:auto;
  padding:48px 24px;
}
.hero-copy{color:#fff}
.hero-copy h1{font-size:clamp(40px,6vw,72px);line-height:1.03;margin:15px 0}
.hero-copy p{font-size:20px;opacity:.86}
.eyebrow{display:inline-block;padding:7px 12px;border:1px solid rgba(255,255,255,.3);border-radius:999px}
.form-card{max-width:520px;width:100%}
.form-msg{min-height:22px;margin-bottom:0}

/* Admin */
.admin{min-height:100vh;background:#f4f7fb}
.sidebar{
  position:fixed;
  inset:0 auto 0 0;
  width:230px;
  background:#111827;
  color:#fff;
  padding:24px 16px;
  overflow-y:auto;
  z-index:20;
}
.brand{font-size:24px;font-weight:800;margin-bottom:24px}
.sidebar a{
  display:block;
  padding:11px 12px;
  border-radius:9px;
  margin:5px 0;
  color:#dbe4f0;
}
.sidebar a:hover{background:#263247;color:#fff}

.admin-main{
  margin-left:230px;
  width:calc(100% - 230px);
  min-height:100vh;
  padding:32px;
  overflow-x:hidden;
}
.stats{
  display:grid;
  grid-template-columns:repeat(3,minmax(0,1fr));
  gap:18px;
  margin:24px 0;
}
.stat{
  min-width:0;
  background:#fff;
  border-radius:15px;
  padding:22px;
  box-shadow:0 8px 28px rgba(20,35,70,.06);
}
.stat span{display:block;color:#6b7280;margin-bottom:8px}
.stat strong{font-size:30px;word-break:break-word}

.settings-card{
  width:min(100%,900px);
  max-width:none;
}
.settings-card form{width:100%}
.settings-card .check{
  display:flex;
  align-items:center;
  gap:8px;
  font-weight:500;
}
.settings-card .check input{width:auto;display:inline-block;margin:0}
.button-row{display:flex;flex-wrap:wrap;gap:10px;margin-top:20px}

.table-card{padding:0;overflow:hidden}
.table-wrap{overflow:auto;width:100%}
table{width:100%;border-collapse:collapse}
th,td{padding:12px 14px;border-bottom:1px solid #edf0f5;text-align:left;white-space:nowrap}
.toolbar{display:flex;justify-content:space-between;gap:12px;margin-bottom:18px}
.toolbar form{display:flex;gap:8px;flex:1}
.toolbar input{max-width:380px}

/* Avoid old global/mobile styles squeezing desktop content */
@media (min-width:801px){
  .admin-main > *{max-width:100%}
  .settings-card{margin:0}
}

@media(max-width:800px){
  .hero{
    grid-template-columns:1fr;
    gap:24px;
    padding-top:70px;
  }
  .sidebar{
    position:static;
    width:100%;
    height:auto;
  }
  .admin-main{
    margin-left:0;
    width:100%;
    padding:18px;
  }
  .stats{grid-template-columns:1fr}
  .toolbar{flex-direction:column}
  .toolbar form{flex-direction:column}
  .toolbar input{max-width:none}
}
