/* =====================================================
   ROOT / VARIABLES
===================================================== */

:root{
  --bg:#0f1115;
  --card:#171a21;
  --muted:#9aa3b2;
  --text:#f4f6fb;
  --line:#262b36;
  --accent:#b11226;
}

* { box-sizing: border-box; }

html, body { height:100%; }

body{
  margin:0;
  font-family: system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
  background: radial-gradient(1200px 800px at 10% 10%, #1a2030, var(--bg));
  color:var(--text);
}

/* =====================================================
   LINKS
===================================================== */

a {
  color:#6EC1E4;
  text-decoration:none;
}

a:hover,
a:focus {
  color:#4FAAD3;
  text-decoration:underline;
}

/* =====================================================
   FORM ELEMENTS
===================================================== */

input,
select,
textarea{
  border:1px solid var(--line);
  background:#0e1016;
  color:var(--text);
  padding:8px 10px;
  border-radius:10px;
  outline:none;
}

input:hover,
select:hover,
textarea:hover{
  filter:brightness(1.05);
}

input:focus,
select:focus,
textarea:focus{
  border-color:rgba(177,18,38,.8);
  box-shadow:0 0 0 2px rgba(177,18,38,.25);
}

/* Remove number spinners */
input[type="number"]::-webkit-outer-spin-button,
input[type="number"]::-webkit-inner-spin-button{
  -webkit-appearance:none;
  margin:0;
}
input[type="number"]{
  -moz-appearance:textfield;
}

/* =====================================================
   LAYOUT
===================================================== */
.row.header-row{
  display:flex !important;
  align-items:center !important;
  width:100%;
}

.row.header-row h2{
  margin:0 !important;
  width:auto !important;
  flex:1 1 auto;          /* lets h2 take space but not force a new line */
}

.row.header-row #refreshBtn{
  margin-left:auto !important;
  flex:0 0 auto;
}


.wrap{
  padding:1px;
  margin:0 auto;
  display:grid;
  gap:16px;
}

.card{
  background:rgba(23,26,33,.92);
  border:1px solid var(--line);
  border-radius:16px;
  padding:12px;
  box-shadow:0 12px 30px rgba(0,0,0,.25);
}

.top{
  padding:16px;
  border-bottom:1px solid var(--line);
}

.brand .badge{
  display:inline-block;
  font-size:12px;
  letter-spacing:.12em;
  color:var(--muted);
  border:1px solid var(--line);
  padding:6px 10px;
  border-radius:999px;
}

.brand h1{ margin:10px 0 4px; font-size:22px; }
.brand .sub{ color:var(--muted); font-size:13px; }

h2{ margin:0 0 12px; font-size:18px; }

.muted{ color:var(--muted); }

.event {
  background: #141823;
  border-radius: 14px;
  padding: 14px 16px;
  position: relative;
  border: 1px solid rgba(255,255,255,0.04);
  margin-bottom:8px;
}

.event::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 4px;
  background: #b11226;
  border-radius: 14px 0 0 14px;
}
.event {
  position: relative;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
}

.event-main {
  flex: 1;
}

.event-actions {
  display: flex;
  gap: 8px;
}


/* =====================================================
   BUTTONS
===================================================== */

.btn{
  border:1px solid var(--line);
  background:#0e1016;
  color:var(--text);
  padding:8px 12px;
  border-radius:6px;
  cursor:pointer;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  padding:6px;
}

.btn:hover{ filter:brightness(1.08); }

.btn.primary{
  border-color:rgba(177,18,38,.6);
  background:rgba(177,18,38,.15);
  padding:4px;
}

.btn.danger{
  border-color:#7a141a;
  background:#7a141a;
}

/* =====================================================
   DIVISIONS HEADER
===================================================== */

.divisions-head{
  display:flex;
  align-items:center;
  gap:12px;
  flex-wrap:nowrap;
}

.divisions-head h2{
  margin:0;
  white-space:nowrap;
}

.inline-add{
  display:flex;
  gap:8px;
  align-items:center;
  margin-left:auto;
}

.inline-add input{
  width:180px;
}

/* =====================================================
   DIVISION HEAD
===================================================== */

.division-head{
  display:flex;
  align-items:center;
  gap:8px;
}

.division-count{
  font-size:12px;
  color:var(--muted);
  border:1px solid var(--line);
  background:#0e1016;
  padding:2px 8px;
  border-radius:999px;
  white-space:nowrap;
}

.collapse-btn{
  margin-left:auto;
  border:1px solid var(--line);
  background:#0e1016;
  color:var(--text);
  border-radius:8px;
  padding:2px 6px;
  cursor:pointer;
}

.card.division-collapsed .weights{
  display:none;
}

.card.division-collapsed .collapse-btn{
  transform:rotate(-90deg);
}

/* =====================================================
   WEIGHT ROW (ADMIN)
===================================================== */

.weight-row{
  display:flex;
  align-items:center;
  gap:8px;
}

.weight-row .weight-input{
  width:64px;
  flex:0 0 64px;
}

.weight-row .name-input{
  flex:1;
  min-width:0;
 
}

.weight-row .status-input{
  width:120px;
  flex:0 0 120px;
}

.weight-row [data-clear-assignment],
.weight-row [data-del-weight]{
  flex:0 0 auto;
}

.weight-row .btn{
  height:32px;
}

/* =====================================================
   INLINE EDITABLE
===================================================== */

.is-editable{
  cursor:text;
  border-radius:6px;
  padding:2px 6px;
  transition:background .15s ease, outline .15s ease;
}

.is-editable:hover{
  outline:1px dashed rgba(177,18,38,.45);
}

.is-editable.is-editing,
.is-editable:focus{
  outline:2px solid rgba(177,18,38,.9);
  background:rgba(177,18,38,.10);
  box-shadow:none;
}

/* =====================================================
   ASSIGN MODAL
===================================================== */

#assignModal{
  position:fixed;
  inset:0;
  z-index:9999;
}

#assignModal .modal-backdrop{
  position:absolute;
  inset:0;
  background:rgba(0,0,0,.6);
}

#assignModal .modal{
  position:absolute;
  top:50%;
  left:50%;
  transform:translate(-50%, -50%);
  background:var(--card);
  padding:20px;
  border-radius:12px;
  width:400px;
  max-width:90%;
  box-shadow:0 20px 60px rgba(0,0,0,.5);
}

/* Search results */
.results{
  margin-top:8px;
  max-height:180px;
  overflow-y:auto;
}

.result{
  padding:8px 10px;
  border-radius:8px;
  cursor:pointer;
  transition:background .15s ease, transform .05s ease;
}

.result:hover{
  background:rgba(255,255,255,.08);
}

.result:active{
  transform:scale(.98);
}

/* =====================================================
   RESPONSIVE
===================================================== */

@media (max-width:640px){

  .inline-add{
    flex-direction:column;
    width:100%;
  }

  .inline-add input,
  .inline-add button{
    width:100%;
  }

  .weight-row{
    flex-wrap:wrap;
  }

  .weight-row .name-input{
    max-width:100%;
  }

}
.divisions-head{
    display:flex;
    align-items:center;
}

.divisions-head h2{
    margin:0;              /* important — h2 default margins cause wrapping */
}

.inline-add2{
    margin-left:auto;      /* THIS pushes it to the right */
    display:flex;
    align-items:center;
    gap:8px;               /* spacing between input and button */
}
#addDivisionBtn{
    padding:6px 12px;
    line-height:1;
}