/* app/static/css/app.css */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');

:root{
  --bg:#eef2f6;
  --surface:#ffffff;
  --surface2:#fbfcfd;

  --text:#111827;
  --muted:#6b7280;

  --line:#d1d5db;
  --line2:#e5e7eb;

  --brand:#0b5cab;
  --brand2:#0a4b8a;

  --danger:#b42318;
  --danger-bg:#fef3f2;

  --ok:#067647;
  --ok-bg:#ecfdf3;

  --r:12px;
  --shadow:0 10px 24px rgba(16,24,40,.06);

  --sans:"Inter", system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;

  --container:1120px;
  --gutter:32px;
}

*{box-sizing:border-box}
html,body{
  height:100%;
  margin:0;
  padding:0;
}
body{
  font-family:var(--sans);
  color:var(--text);
  background:
    radial-gradient(circle at top right, rgba(11,92,171,.08), transparent 46%),
    var(--bg);
  line-height:1.45;
}
.has-topbar{
  padding-top:64px;
}
a{color:inherit; text-decoration:none}
img{max-width:100%; display:block}

/* layout containers */
.topbar-inner,.page,.footer-inner{
  width:min(var(--container), calc(100% - var(--gutter)));
  margin:0 auto;
}
.page{
  padding:8px 0 22px;
  min-height:0;
}
.has-topbar .page{
  margin-top:0;
}

/* topbar */
.topbar{
  position:fixed;
  top:0;
  left:0;
  right:0;
  width:100%;
  z-index:50;
  margin:0;
  border-top:0;
  background:rgba(255,255,255,.92);
  backdrop-filter: blur(8px);
  border-bottom:1px solid var(--line2);
}
.topbar-inner{
  height:64px;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:14px;
}
.topbar-left{display:flex; align-items:center; gap:12px}

/* back */
.backbtn{
  appearance:none;
  border:1px solid var(--line);
  background:var(--surface);
  color:var(--text);
  border-radius:6px;
  width:36px; height:36px;
  display:grid; place-items:center;
  cursor:pointer;
}
.backbtn:hover{background:var(--surface2)}
.backbtn:focus-visible{outline:2px solid rgba(11,92,171,.25); outline-offset:2px}
.backbtn-ico{
  font-size:18px;
  font-weight:700;
  line-height:1;
}

/* brand */
.brand{
  display:flex;
  align-items:center;
  gap:0;
  padding:0;
  border-radius:0;
}
.brand-logo{
  width:auto;
  height:52px;
  max-width:180px;
  object-fit:contain;
}
.brand-mark{
  width:10px; height:10px;
  border-radius:2px;
  background:var(--brand);
}
.brand-name{
  font-weight:700;
  letter-spacing:.02em;
  font-size:15px;
}
.brand-tag{
  font-size:12px;
  color:var(--muted);
  padding:2px 8px;
  border:1px solid var(--line2);
  border-radius:999px;
  background:var(--surface2);
}

/* user menu */
.userwrap{position:relative; display:flex; align-items:center}
.userbtn{
  appearance:none;
  border:1px solid var(--line);
  background:var(--surface);
  color:var(--text);
  border-radius:999px;
  height:40px;
  padding:0;
  width:40px;
  display:grid;
  place-items:center;
  cursor:pointer;
  box-shadow:0 1px 2px rgba(16,24,40,.06);
  transition:background .12s ease,border-color .12s ease,box-shadow .12s ease;
}
.userbtn:hover{
  background:var(--surface2);
  border-color:#c6d2e1;
  box-shadow:0 4px 12px rgba(16,24,40,.08);
}
.userbtn:focus-visible{outline:2px solid rgba(11,92,171,.25); outline-offset:2px}
.usericon{
  width:30px;
  height:30px;
  border-radius:999px;
  border:0;
  background:transparent;
  display:grid;
  place-items:center;
  overflow:hidden;
}
.usericon-img{
  width:100%;
  height:100%;
  object-fit:contain;
  display:block;
}

.usermenu{
  position:absolute; right:0; top:calc(100% + 8px);
  width:max-content;
  min-width:300px;
  border-radius:10px;
  border:1px solid var(--line2);
  background:var(--surface);
  box-shadow:0 10px 24px rgba(16,24,40,.10);
  padding:12px;
  opacity:0;
  pointer-events:none;
  transform: translateY(-4px);
  transition: opacity .12s ease, transform .12s ease;
}
.usermenu[aria-hidden="false"]{
  opacity:1;
  pointer-events:auto;
  transform: translateY(0);
}
.usermenu-head{
  margin-bottom:10px;
  font-size:13px;
  font-weight:700;
}
.usermenu-item{
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:10px;
  margin:8px 0;
}
.usermenu-value{
  text-align:right;
  font-size:13px;
  font-weight:500;
  max-width:none;
  white-space:nowrap;
  overflow:visible;
  text-overflow:clip;
}
.usermenu-actions{
  display:flex;
  justify-content:flex-end;
}
.usermenu-actions .btn2{
  min-width:110px;
}

/* footer */
.footer{
  border-top:1px solid var(--line2);
  background:rgba(255,255,255,.96);
}
.footer-inner{
  height:52px;
  display:flex;
  align-items:center;
  justify-content:center;
  gap:12px;
  color:var(--muted);
  font-size:13px;
}
.foot-muted{font-size:12px; color:var(--muted)}

@media (max-width:760px){
  :root{--gutter:24px}
  .has-topbar .page{
    margin-top:0;
  }
  .page{
    padding:8px 0 18px;
    min-height:0;
  }
  .usermenu{
    min-width:260px;
    max-width:calc(100vw - 24px);
  }
}
