*{
  box-sizing:border-box;
  margin:0;
  padding:0;
  font-family:Arial,Helvetica,sans-serif;
}

body{
  background:#080b12;
  color:#fff;
  min-height:100vh;
}

button,input,select{
  font:inherit;
}

button{
  cursor:pointer;
}

/* ================= LOGIN ================= */

#loginScreen{
  min-height:100vh;
  display:flex;
  align-items:center;
  justify-content:center;
  padding:20px;
  background:
    radial-gradient(circle at top,#17233d 0,#080b12 45%,#05070b 100%);
}

.loginBox{
  width:100%;
  max-width:430px;
  background:rgba(16,21,32,.95);
  border:1px solid #27334a;
  border-radius:24px;
  padding:35px 25px;
  box-shadow:0 20px 70px rgba(0,0,0,.5);
  text-align:center;
}

.logo{
  font-size:32px;
  font-weight:900;
  letter-spacing:2px;
  margin-bottom:8px;
}

.logo span{
  color:#35d0ff;
}

.loginSubtitle{
  color:#8f9bb2;
  margin-bottom:30px;
}

.inviteInput{
  width:100%;
  padding:16px;
  border-radius:14px;
  border:1px solid #33415d;
  background:#090d15;
  color:#fff;
  outline:none;
  text-align:center;
  letter-spacing:4px;
  font-weight:bold;
}

.inviteInput:focus{
  border-color:#35d0ff;
}

.accessBtn{
  width:100%;
  margin-top:15px;
  padding:16px;
  border:0;
  border-radius:14px;
  background:#35d0ff;
  color:#001018;
  font-weight:900;
}

.loginError{
  min-height:25px;
  margin-top:14px;
  color:#ff6878;
  font-size:14px;
}

/* ================= APP ================= */

.hidden{
  display:none!important;
}

#app{
  min-height:100vh;
  display:flex;
}

/* SIDEBAR */

.sidebar{
  width:245px;
  min-height:100vh;
  background:#0b1019;
  border-right:1px solid #202b3e;
  padding:20px 14px;
  position:fixed;
  left:0;
  top:0;
  bottom:0;
  overflow-y:auto;
}

.brand{
  padding:10px 12px 25px;
  font-size:23px;
  font-weight:900;
}

.brand span{
  color:#35d0ff;
}

.navButton{
  width:100%;
  background:transparent;
  border:0;
  color:#aeb9cc;
  text-align:left;
  padding:13px 14px;
  margin:3px 0;
  border-radius:12px;
  transition:.2s;
}

.navButton:hover,
.navButton.active{
  background:#172236;
  color:#fff;
}

.stopNav{
  color:#ff6978;
}

/* MAIN */

.main{
  margin-left:245px;
  width:calc(100% - 245px);
  min-height:100vh;
  padding:25px;
}

.topbar{
  display:flex;
  justify-content:space-between;
  align-items:center;
  gap:15px;
  margin-bottom:25px;
}

.pageTitle{
  font-size:28px;
  font-weight:900;
}

.statusPill{
  padding:9px 13px;
  border-radius:999px;
  background:#111b29;
  border:1px solid #273650;
  color:#7fe8a4;
  font-size:13px;
}

/* CARDS */

.grid{
  display:grid;
  grid-template-columns:repeat(auto-fit,minmax(210px,1fr));
  gap:15px;
}

.card{
  background:#0d141f;
  border:1px solid #202d43;
  border-radius:18px;
  padding:20px;
}

.card h3{
  margin-bottom:10px;
}

.muted{
  color:#8996aa;
  font-size:14px;
}

.big{
  font-size:25px;
  font-weight:900;
}

.section{
  margin-bottom:25px;
}

.sectionTitle{
  margin-bottom:13px;
  font-size:19px;
}

/* BUTTONS */

.primary{
  background:#35d0ff;
  color:#001018;
  border:0;
  padding:12px 16px;
  border-radius:11px;
  font-weight:800;
}

.secondary{
  background:#172236;
  color:#fff;
  border:1px solid #30405b;
  padding:12px 16px;
  border-radius:11px;
}

.danger{
  background:#8e1729;
  color:#fff;
  border:1px solid #c52d42;
  padding:12px 16px;
  border-radius:11px;
  font-weight:800;
}

.success{
  background:#123c29;
  color:#7ff0a5;
  border:1px solid #24784e;
  padding:12px 16px;
  border-radius:11px;
  font-weight:800;
}

/* FORMS */

.formGroup{
  margin-bottom:15px;
}

.formGroup label{
  display:block;
  color:#aab6ca;
  font-size:13px;
  margin-bottom:7px;
}

.formGroup input,
.formGroup select,
textarea{
  width:100%;
  padding:13px;
  border-radius:10px;
  background:#080d15;
  border:1px solid #29374e;
  color:#fff;
  outline:none;
}

textarea{
  resize:vertical;
  min-height:110px;
}

/* CHAT */

.chatBox{
  height:420px;
  display:flex;
  flex-direction:column;
}

.chatMessages{
  flex:1;
  overflow-y:auto;
  padding:15px;
  background:#080d15;
  border-radius:13px;
  margin-bottom:12px;
}

.message{
  padding:12px;
  border-radius:12px;
  margin-bottom:10px;
  max-width:85%;
}

.userMsg{
  background:#173348;
  margin-left:auto;
}

.aiMsg{
  background:#151e2d;
}

.chatInput{
  display:flex;
  gap:8px;
}

.chatInput input{
  flex:1;
  padding:13px;
  background:#080d15;
  color:#fff;
  border:1px solid #29374e;
  border-radius:11px;
}

/* COMPANION */

.companionHero{
  border:1px solid #21425b;
  background:
    radial-gradient(circle at top right,#15364b,#0d141f 50%);
  border-radius:20px;
  padding:25px;
  margin-bottom:18px;
}

.connection{
  display:flex;
  align-items:center;
  gap:10px;
  margin:12px 0;
}

.dot{
  width:12px;
  height:12px;
  border-radius:50%;
  background:#697386;
}

.dot.online{
  background:#35e88a;
  box-shadow:0 0 12px #35e88a;
}

.permission{
  display:flex;
  justify-content:space-between;
  align-items:center;
  padding:13px;
  border-bottom:1px solid #202d43;
}

.permission:last-child{
  border-bottom:0;
}

.commandBox{
  margin-top:18px;
  padding:18px;
  border-radius:15px;
  background:#080d15;
  border:1px solid #26354d;
}

.commandStatus{
  margin-top:12px;
  color:#8e9bb0;
  font-size:14px;
}

.flow{
  display:flex;
  flex-wrap:wrap;
  gap:8px;
  align-items:center;
  margin-top:15px;
}

.flowItem{
  background:#111b2a;
  border:1px solid #293b55;
  padding:9px 11px;
  border-radius:9px;
  font-size:12px;
}

.arrow{
  color:#35d0ff;
}

/* TABLE */

.tableWrap{
  overflow-x:auto;
}

table{
  width:100%;
  border-collapse:collapse;
}

th,td{
  padding:12px;
  border-bottom:1px solid #202d43;
  text-align:left;
  white-space:nowrap;
}

th{
  color:#8f9db2;
  font-size:13px;
}

/* MOBILE */

@media(max-width:800px){

  .sidebar{
    width:72px;
    padding:12px 8px;
  }

  .brand{
    font-size:12px;
    text-align:center;
    padding:10px 2px 20px;
  }

  .navButton{
    text-align:center;
    padding:12px 4px;
    font-size:0;
  }

  .navButton::first-letter{
    font-size:18px;
  }

  .main{
    margin-left:72px;
    width:calc(100% - 72px);
    padding:15px;
  }

  .pageTitle{
    font-size:22px;
  }

  .topbar{
    align-items:flex-start;
  }
}

/* ANDROID COMPANION DASHBOARD */
.companionDashboard{
  display:grid;
  grid-template-columns:repeat(3,minmax(0,1fr));
  gap:15px;
  margin-bottom:15px;
}

.companionMetric{
  min-height:150px;
}

.metricValue{
  font-size:22px;
  font-weight:900;
  color:#35d0ff;
  margin:10px 0 6px;
  letter-spacing:1px;
}

.compactButton{
  padding:9px 11px;
  font-size:12px;
}

.companionLowerGrid{
  margin-bottom:15px;
}

.permissionActions{
  display:flex;
  flex-wrap:wrap;
  gap:8px;
  margin-top:15px;
}

.queueList,.eventStream{
  display:flex;
  flex-direction:column;
  gap:8px;
  max-height:210px;
  overflow:auto;
  margin:14px 0;
}

.queueItem,.eventItem{
  display:grid;
  grid-template-columns:1fr auto;
  gap:3px 10px;
  padding:10px;
  border:1px solid #22334b;
  border-radius:10px;
  background:#0a111c;
}

.queueItem span,.eventItem strong{
  color:#35d0ff;
  font-size:12px;
}

.queueItem small,.eventItem small{
  grid-column:1/-1;
  color:#718096;
  font-size:11px;
}

.cardHeaderRow{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
}

.companionEventsCard{
  margin-bottom:18px;
}

@media(max-width:900px){
  .companionDashboard{
    grid-template-columns:1fr;
  }
}

/* AI STRATEGY COMPOSER */
.strategyConsole{margin-top:18px;border-color:#28506a;background:linear-gradient(145deg,#0d1725,#0a111c)}
.strategyTargetGrid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:12px;margin-top:18px}
.aiBadge{border:1px solid #2a7593;color:#66e1ff;background:#102f40;border-radius:999px;padding:7px 10px;font-size:11px;font-weight:800;white-space:nowrap}
.strategyMessages{display:flex;flex-direction:column;gap:8px;max-height:190px;overflow:auto;margin:8px 0 12px}
.strategyMessage{max-width:88%;padding:11px 13px;border-radius:13px;line-height:1.45;font-size:13px}
.assistantMessage{background:#151f2e;border:1px solid #24364d}
.userMessage{background:#173b52;border:1px solid #2d7395;margin-left:auto}
.strategyComposer{display:flex;align-items:flex-end;gap:10px;padding:10px 12px;border:1px solid #35516e;border-radius:17px;background:#080e17;box-shadow:0 8px 22px rgba(0,0,0,.18)}
.composerIcon{color:#35d0ff;font-size:20px;padding-bottom:8px}
.strategyComposer textarea{min-height:52px;max-height:150px;resize:vertical;border:0;padding:8px 0;background:transparent}
.strategyComposer textarea:focus{border:0}
.composerSend{width:34px;height:34px;border:0;border-radius:11px;background:#35d0ff;color:#001018;font-size:22px;font-weight:900}
.composerFooter{display:flex;align-items:center;justify-content:space-between;gap:12px;margin-top:9px}
.composerActions{display:flex;gap:8px}
@media(max-width:800px){.strategyTargetGrid{grid-template-columns:1fr}.composerFooter{align-items:flex-start;flex-direction:column}}
