:root{
  --bg:#070B16;
  --card:#0B1222;
  --line: rgba(255,255,255,.10);
  --text: rgba(255,255,255,.92);
  --muted: rgba(255,255,255,.64);
  --blue:#4EA1FF;
  --blue2:#2B6DFF;
  --danger:#FF4D5E;
  --warn:#FFB020;
  --ok:#22C55E;
  --shadow: 0 18px 60px rgba(0,0,0,.45);
  --radius: 18px;
  --font: Inter, system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
}

*{ box-sizing:border-box; }
html,body{ height:100%; }
body{
  margin:0;
  font-family: var(--font);
  background: radial-gradient(1200px 800px at 20% 10%, rgba(78,161,255,.16), transparent 60%),
              radial-gradient(900px 700px at 70% 20%, rgba(43,109,255,.12), transparent 55%),
              linear-gradient(180deg, #050816, #070B16 30%, #060A14);
  color:var(--text);
}

a{ color:var(--blue); text-decoration:none; }
a:hover{ text-decoration:underline; }

.container{
  max-width: 1100px;
  margin: 18px auto 40px;
  padding: 0 16px;
}

.topbar{
  position: sticky;
  top: 0;
  z-index: 10;
  display:flex;
  justify-content:space-between;
  align-items:center;
  gap:14px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
  background: rgba(6,10,20,.72);
  backdrop-filter: blur(10px);
}

.topbar-left{
  display:flex;
  align-items:center;
  gap:12px;
  min-width: 260px;
}

.logo{
  height: 44px;
  width: auto;
  border-radius: 10px;
  box-shadow: 0 10px 24px rgba(0,0,0,.45);
}

.brand-name{
  font-weight: 800;
  letter-spacing: .2px;
  line-height: 1.05;
}

.brand-sub{
  font-size: 12px;
  color: var(--muted);
  margin-top: 2px;
}

.topbar-right{
  display:flex;
  align-items:center;
  gap:10px;
  flex-wrap:wrap;
  justify-content:flex-end;
}

.user-pill{
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255,255,255,.04);
  color: var(--muted);
  font-size: 12px;
}

.btn{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  gap:8px;
  height: 36px;
  padding: 0 12px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: rgba(255,255,255,.04);
  color: var(--text);
  font-weight: 650;
  cursor:pointer;
  text-decoration:none;
  box-shadow: 0 10px 28px rgba(0,0,0,.22);
}
.btn:hover{ border-color: rgba(78,161,255,.45); text-decoration:none; }

.btn-primary{
  background: linear-gradient(135deg, rgba(78,161,255,.95), rgba(43,109,255,.95));
  border-color: rgba(78,161,255,.35);
  color: #07101f;
}
.btn-primary:hover{ filter: brightness(1.05); }

.btn-danger{
  background: rgba(255,77,94,.10);
  border-color: rgba(255,77,94,.30);
}
.btn-danger:hover{ border-color: rgba(255,77,94,.55); }

.card{
  background: linear-gradient(180deg, rgba(11,18,34,.92), rgba(9,14,28,.92));
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px;
  box-shadow: var(--shadow);
}

.row{
  display:flex;
  gap:16px;
  align-items:flex-start;
  flex-wrap:wrap;
}

.h1{
  font-size: 22px;
  margin: 0 0 6px;
  font-weight: 850;
  letter-spacing: .2px;
}
.h2{
  font-size: 16px;
  margin: 0 0 8px;
  font-weight: 850;
  letter-spacing: .2px;
}

.muted{ color: var(--muted); font-size: 13px; }

.divider{
  height: 1px;
  background: var(--line);
  margin: 14px 0;
}

.grid{
  display:flex;
  flex-wrap:wrap;
  margin: -10px;
}
[class^="col-"]{ padding:10px; }
.col-12{ width:100%; }
.col-6{ width:50%; }
.col-4{ width:33.333%; }

@media (max-width: 820px){
  .col-6,.col-4{ width:100%; }
}

label{
  display:block;
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 6px;
  font-weight: 650;
}

input, select, textarea{
  width: 100%;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid rgba(255,255,255,.12);
  background: rgba(255,255,255,.04);
  color: var(--text);
  outline: none;
}

input:focus, select:focus, textarea:focus{
  border-color: rgba(78,161,255,.55);
  box-shadow: 0 0 0 4px rgba(78,161,255,.14);
}

table{
  width:100%;
  border-collapse: collapse;
  font-size: 13px;
}
th, td{
  text-align:left;
  padding: 10px 12px;
  border-bottom: 1px solid rgba(255,255,255,.08);
}
th{ color: var(--muted); font-weight: 750; }

.badge{
  display:inline-flex;
  align-items:center;
  gap:6px;
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,.12);
  background: rgba(255,255,255,.04);
  font-size: 12px;
  font-weight: 750;
}

.badge-ok{
  border-color: rgba(34,197,94,.32);
  background: rgba(34,197,94,.10);
}
.badge-warn{
  border-color: rgba(255,176,32,.30);
  background: rgba(255,176,32,.10);
}

.error{
  padding: 10px 12px;
  border-radius: 14px;
  border: 1px solid rgba(255,77,94,.30);
  background: rgba(255,77,94,.10);
  font-weight: 650;
}

/* ===============================
   NOTE ABOUT DROPDOWNS
   Native <select> option lists are controlled by the OS in many cases,
   and can ignore CSS, causing white-on-white.
   The reliable fix is a custom dropdown (below).
================================ */

/* ===============================
   CUSTOM SELECT (matches your style)
   This does nothing until we update HTML to use it.
================================ */

.sb-select{
  position: relative;
  width: 100%;
}

.sb-select-btn{
  width: 100%;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:10px;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid rgba(255,255,255,.12);
  background: rgba(255,255,255,.04);
  color: var(--text);
  cursor: pointer;
  user-select: none;
}

.sb-select-btn:focus{
  outline: none;
  border-color: rgba(78,161,255,.55);
  box-shadow: 0 0 0 4px rgba(78,161,255,.14);
}

.sb-select-caret{
  color: var(--muted);
  font-size: 12px;
}

.sb-select-menu{
  position: absolute;
  left: 0;
  right: 0;
  top: calc(100% + 8px);
  z-index: 20;
  border-radius: 14px;
  border: 1px solid rgba(255,255,255,.12);
  background: linear-gradient(180deg, rgba(11,18,34,.98), rgba(9,14,28,.98));
  box-shadow: var(--shadow);
  overflow: hidden;
  display: none;
}

.sb-select.open .sb-select-menu{ display:block; }

.sb-select-item{
  padding: 10px 12px;
  font-size: 13px;
  color: var(--text);
  cursor: pointer;
  border-bottom: 1px solid rgba(255,255,255,.06);
}

.sb-select-item:last-child{ border-bottom: none; }

.sb-select-item:hover{
  background: rgba(78,161,255,.10);
}

.sb-select-item[aria-selected="true"]{
  background: rgba(43,109,255,.18);
}

/* ---------------------------
   Mobile responsiveness
   --------------------------- */

/* Make things easier to tap */
.btn, button, input, select, textarea {
  min-height: 44px;
}

/* Prevent long lines from overflowing */
* {
  max-width: 100%;
  box-sizing: border-box;
}

/* Let the topbar wrap on small screens */
@media (max-width: 900px) {
  .topbar {
    flex-wrap: wrap;
    gap: 10px;
    padding: 10px 12px;
  }

  .topbar-left {
    width: 100%;
    gap: 10px;
  }

  .topbar-right {
    width: 100%;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: flex-start;
  }

  .user-pill {
    width: 100%;
    margin-bottom: 6px;
  }

  .container {
    padding: 12px;
  }
}

/* Phone layout */
@media (max-width: 600px) {
  .logo {
    width: 40px;
    height: 40px;
  }

  .brand-name {
    font-size: 16px;
    line-height: 1.1;
  }
  .brand-sub {
    font-size: 12px;
  }

  .btn {
    padding: 10px 12px;
    font-size: 14px;
  }

  /* Tables: horizontal scroll instead of breaking layout */
  table {
    display: block;
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  /* Forms: stack nicely */
  .row, .form-row, .grid {
    display: block !important;
  }
  input, select, textarea {
    width: 100%;
  }
}

/* Very small phones */
@media (max-width: 420px) {
  .btn {
    width: 100%;
  }
}

/* ---------------------------
   Responsive + mobile nav
   --------------------------- */

* { box-sizing: border-box; }
img { max-width: 100%; height: auto; }

/* Hide mobile controls on desktop */
.sb-mobile-toggle,
.sb-mobile-nav { display: none; }

/* Desktop nav wrapper */
.sb-desktop-nav {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}

/* Small screens */
@media (max-width: 900px) {
  .topbar { flex-wrap: wrap; gap: 10px; }
  .topbar-left { width: 100%; }
  .topbar-right { width: 100%; }

  /* Make buttons easier to tap */
  .btn, button, input, select, textarea { min-height: 44px; }

  /* Hide desktop nav buttons, show hamburger */
  .sb-desktop-nav { display: none; }
  .sb-mobile-toggle { display: inline-flex; align-items: center; gap: 8px; }

  /* Mobile nav drawer */
  .sb-mobile-nav {
    display: grid;
    gap: 10px;
    padding: 12px;
    margin: 0 12px 12px 12px;
    border-radius: 12px;
    background: rgba(0,0,0,0.08);
  }

  /* User pill should not squeeze */
  .user-pill { width: 100%; }

  .container { padding: 12px; }
}

/* Phones */
@media (max-width: 600px) {
  .logo { width: 40px; height: 40px; }
  .brand-name { font-size: 16px; line-height: 1.1; }
  .brand-sub { font-size: 12px; }

  /* Tables: scroll instead of breaking layout */
  table {
    display: block;
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  /* Make buttons full width inside the mobile drawer */
  .sb-mobile-nav .btn { width: 100%; justify-content: center; }
}

/* Very small phones */
@media (max-width: 420px) {
  .btn { width: 100%; }
}


/* Ensure the hidden attribute always hides the mobile menu */
.sb-mobile-nav[hidden] { display: none !important; }

