:root{
  --bg:#f6f8fb;
  --panel:#ffffff;
  --ink:#0f172a;
  --muted:#475569;
  --line:rgba(15,23,42,.12);
  --brand:#2563eb;
  --brand2:#f97316;
  --shadow:0 16px 44px rgba(2,6,23,.10);
  --radius:18px;
  --radius2:14px;
  --max:1220px;
  --danger:#ef4444;
  --ok:#16a34a;
}

@media (min-width: 1280px){
  :root{
    --max:1360px;
  }
}

@media (min-width: 1600px){
  :root{
    --max:1480px;
  }
}

@media (min-width: 1900px){
  :root{
    --max:1600px;
  }
}

*{box-sizing:border-box}
html,body{height:100%}
body{
  margin:0;
  font-family:system-ui,-apple-system,Segoe UI,Roboto,Arial,sans-serif;
  background:var(--bg);
  color:var(--ink);
}
a{color:inherit}

.wrap{
  width:min(100%, var(--max));
  margin:0 auto;
  padding:0 20px;
}

.topbar{
  position:sticky;
  top:0;
  z-index:1000;
  width:100%;
  background:rgba(246,248,251,.78);
  backdrop-filter:blur(14px) saturate(160%);
  -webkit-backdrop-filter:blur(14px) saturate(160%);
  border-bottom:1px solid rgba(15,23,42,.12);
  box-shadow:0 10px 26px rgba(2,6,23,.08);
}

.topbar .wrap{
  display:flex;
  align-items:center;
  justify-content:space-between;
  min-height:64px;
}

.brand{font-weight:800; letter-spacing:.2px; text-decoration:none}
.nav{display:flex; gap:12px; align-items:center}
.nav a{color:var(--muted); text-decoration:none; font-weight:600}
.nav a:hover{color:var(--ink)}
.nav-user{color:var(--muted); font-size:14px}

.main{
  padding:28px 20px 44px;
}

.card{
  background:var(--panel);
  border:1px solid var(--line);
  border-radius:var(--radius);
  box-shadow:var(--shadow);
  padding:20px;
}

.grid{display:grid; gap:18px}
.grid-2{grid-template-columns:minmax(0,1fr) minmax(0,1fr)}

.h1{
  font-size:34px;
  line-height:1.08;
  letter-spacing:-.02em;
  margin:0 0 10px;
}

.h2{
  font-size:20px;
  line-height:1.2;
  margin:0 0 10px;
}

.p{
  color:var(--muted);
  line-height:1.6;
}

.btn{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  padding:10px 14px;
  border-radius:12px;
  border:1px solid transparent;
  background:var(--brand);
  color:white;
  font-weight:800;
  text-decoration:none;
  cursor:pointer;
  transition:transform .18s ease, filter .18s ease, box-shadow .18s ease, background .18s ease;
}
.btn:hover{
  filter:brightness(.98);
  transform:translateY(-1px);
}
.btn-ghost{
  background:transparent;
  border-color:var(--line);
  color:var(--ink);
}
.btn-orange{background:var(--brand2)}

.table{
  width:100%;
  border-collapse:collapse;
}
.table th,
.table td{
  padding:10px 10px;
  border-bottom:1px solid var(--line);
  text-align:left;
  vertical-align:top;
}

.badge{
  display:inline-block;
  padding:4px 10px;
  border-radius:999px;
  font-size:12px;
  font-weight:800;
}
.badge-ok{background:rgba(22,163,74,.12); color:var(--ok)}
.badge-warn{background:rgba(249,115,22,.14); color:var(--brand2)}
.badge-danger{background:rgba(239,68,68,.12); color:var(--danger)}

.input,
select,
textarea{
  width:100%;
  padding:10px 12px;
  border:1px solid var(--line);
  border-radius:12px;
  background:white;
  outline:none;
}

label{
  display:block;
  font-size:12px;
  color:var(--muted);
  margin:10px 0 6px;
  font-weight:800;
  letter-spacing:.2px;
}

.row{
  display:grid;
  grid-template-columns:minmax(0,1fr) minmax(0,1fr);
  gap:12px;
}

.flash{
  margin:0 0 14px;
  padding:12px 14px;
  border-radius:14px;
  border:1px solid var(--line);
  background:white;
}
.flash.ok{border-color:rgba(22,163,74,.3)}
.flash.err{border-color:rgba(239,68,68,.3)}

.footer{
  padding:18px 0 26px;
  color:var(--muted);
}

.sidebar{
  background:var(--panel);
  border:1px solid var(--line);
  border-radius:var(--radius);
  box-shadow:var(--shadow);
  padding:14px;
}

.side-links a{
  display:block;
  padding:10px 12px;
  border-radius:12px;
  text-decoration:none;
  color:var(--muted);
  font-weight:800;
}
.side-links a.active,
.side-links a:hover{
  background:rgba(37,99,235,.10);
  color:var(--ink);
}

/* ============================
   AMX PATCH: TOPBAR GLASS FIX
   (for markup: topbar-inner/topbar-mid/nav-center/topbar-right)
   SAFE: header-only
   ============================ */

/* keep inner aligned; DO NOT break page wrap */
.topbar .topbar-inner{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:14px;
  min-height:72px;
  max-width:var(--max);
  margin:0 auto;
  padding:0 20px;
}

/* brand */
.topbar .brand{
  display:inline-flex;
  align-items:center;
  gap:10px;
  text-decoration:none;
  font-weight:900;
  white-space:nowrap;
}
.topbar .brand-icon{
  width:32px;
  height:32px;
  display:block;
  flex:0 0 auto;
}
.topbar .brand-text{
  font-weight:900;
  letter-spacing:.2px;
}

/* mid section centered */
.topbar .topbar-mid{
  flex:1;
  display:flex;
  align-items:center;
  justify-content:center;
  gap:14px;
  min-width:0;
  padding:0 12px;
}

/* socials pills */
.topbar .socials{
  display:flex;
  gap:8px;
  flex-wrap:nowrap;
}
.topbar .social{
  width:38px;
  height:38px;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  border-radius:999px;
  border:1px solid rgba(15,23,42,.12);
  background:rgba(255,255,255,.55);
  text-decoration:none;
  font-weight:900;
  color:var(--muted);
  transition:background .18s ease, color .18s ease, transform .18s ease, box-shadow .18s ease;
}
.topbar .social:hover{
  background:rgba(15,23,42,.06);
  color:var(--ink);
  transform:translateY(-1px);
}

/* center nav */
.topbar .nav-center{
  display:flex;
  align-items:center;
  justify-content:center;
  gap:8px;
  flex-wrap:nowrap;
  min-width:0;
}
.topbar .nav-link{
  text-decoration:none;
  color:var(--muted);
  font-weight:800;
  padding:10px 14px;
  border-radius:12px;
  white-space:nowrap;
  transition:background .18s ease, color .18s ease, transform .18s ease;
}
.topbar .nav-link:hover{
  background:rgba(15,23,42,.06);
  color:var(--ink);
  transform:translateY(-1px);
}

/* right actions */
.topbar .topbar-right{
  display:flex;
  align-items:center;
  gap:10px;
  flex-wrap:nowrap;
}
.topbar .nav-user{
  color:var(--muted);
  font-size:14px;
  white-space:nowrap;
}

/* hide toggle on desktop */
.topbar .nav-toggle{
  display:none;
  border:1px solid rgba(15,23,42,.12);
  background:rgba(255,255,255,.55);
  border-radius:12px;
  padding:8px 10px;
  cursor:pointer;
}

/* mobile drawer default hidden */
.topbar .mobile-drawer{
  display:none;
  border-top:1px solid rgba(15,23,42,.10);
  background:rgba(246,248,251,.92);
  backdrop-filter:blur(14px) saturate(160%);
  -webkit-backdrop-filter:blur(14px) saturate(160%);
}
.topbar .mobile-links{
  max-width:var(--max);
  margin:0 auto;
  padding:10px 20px 14px;
  display:grid;
  gap:8px;
}
.topbar .mobile-links a{
  text-decoration:none;
  color:var(--ink);
  font-weight:800;
  padding:10px 12px;
  border-radius:12px;
  border:1px solid rgba(15,23,42,.10);
  background:rgba(255,255,255,.70);
}
.topbar .mobile-links a:hover{
  background:rgba(15,23,42,.06);
}

/* ============================
   GLOBAL RESPONSIVE IMPROVEMENTS
   SAFE additive tuning
   ============================ */

img{
  max-width:100%;
  height:auto;
}

.card > *:first-child{margin-top:0}
.card > *:last-child{margin-bottom:0}

@media (min-width: 1100px){
  .main{
    padding-top:34px;
    padding-bottom:56px;
  }

  .card{
    padding:24px;
  }

  .grid{
    gap:22px;
  }

  .h1{
    font-size:42px;
  }

  .h2{
    font-size:22px;
  }

  .p{
    font-size:16px;
  }

  .btn{
    padding:12px 16px;
  }
}

@media (min-width: 1440px){
  .main{
    padding-top:38px;
    padding-bottom:64px;
  }

  .card{
    padding:28px;
  }

  .grid{
    gap:24px;
  }

  .h1{
    font-size:48px;
  }

  .h2{
    font-size:24px;
  }

  .p{
    font-size:17px;
  }

  .topbar .topbar-inner{
    min-height:76px;
  }

  .topbar .nav-link{
    padding:10px 16px;
  }
}

@media (max-width: 1100px){
  .wrap{
    padding:0 16px;
  }

  .main{
    padding:24px 16px 38px;
  }

  .card{
    padding:18px;
  }

  .h1{
    font-size:32px;
  }

  .h2{
    font-size:20px;
  }
}

@media (max-width: 900px){
  .grid-2{
    grid-template-columns:1fr;
  }

  .row{
    grid-template-columns:1fr;
  }

  .topbar .topbar-mid{
    display:none;
  }

  .topbar .topbar-right{
    display:none;
  }

  .topbar .nav-toggle{
    display:inline-flex;
    align-items:center;
    justify-content:center;
  }

  body.nav-open .topbar .mobile-drawer{
    display:block;
  }

  .topbar .topbar-inner{
    min-height:64px;
    padding:0 16px;
  }

  .topbar .brand-text{
    font-size:15px;
  }
}

@media (max-width: 640px){
  .wrap{
    padding:0 14px;
  }

  .main{
    padding:20px 14px 32px;
  }

  .card{
    padding:16px;
    border-radius:16px;
  }

  .grid{
    gap:14px;
  }

  .h1{
    font-size:28px;
    line-height:1.1;
  }

  .h2{
    font-size:18px;
  }

  .p{
    font-size:15px;
    line-height:1.55;
  }

  .btn{
    width:100%;
    min-height:46px;
  }

  .topbar .topbar-inner{
    min-height:60px;
    padding:0 14px;
  }

  .topbar .brand-icon{
    width:28px;
    height:28px;
  }

  .topbar .brand-text{
    font-size:14px;
  }

  .topbar .mobile-links{
    padding:10px 14px 14px;
  }

  .table th,
  .table td{
    padding:9px 8px;
    font-size:14px;
  }
}

@media (max-width: 420px){
  .h1{
    font-size:25px;
  }

  .card{
    padding:14px;
  }

  .btn{
    padding:11px 12px;
    font-size:14px;
  }
}