/* assets/styles.css */
:root{
  --bg:#0b0d10;
  --panel:#121621;
  --panel2:#0f131c;
  --text:#e8eaf0;
  --muted:#a8b0c2;
  --line:#22293a;
  --accent:#7aa2ff;
  --danger:#ff6b6b;
}

*{box-sizing:border-box}
body{
  margin:0;
  font-family: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
  background:var(--bg);
  color:var(--text);
}

a{color:inherit; text-decoration:none}
code{background:#0a0c12; padding:2px 6px; border:1px solid var(--line); border-radius:6px}

.topbar{
  display:flex;
  align-items:center;
  justify-content:space-between;
  padding:12px 10px;
  border-bottom:1px solid var(--line);
  background:linear-gradient(180deg, rgba(18,22,33,0.92), rgba(18,22,33,0.75));
  position:sticky;
  top:0;
  z-index:10;
  backdrop-filter: blur(8px);
}

.brand-title{font-weight:700; letter-spacing:.2px}
.brand-sub{font-size:12px}

.topbar-actions{display:flex; gap:10px; align-items:center}

.wrap{
  width:100%;
  max-width:none;
  margin:12px 0;
  padding:0 10px;
  display:flex;
  flex-direction:column;
  gap:12px
}

.panel{
  border:1px solid var(--line);
  border-radius:14px;
  background:var(--panel);
  overflow:hidden;
}

.panel-head{
  padding:12px 14px;
  border-bottom:1px solid var(--line);
  display:flex;
  align-items:baseline;
  justify-content:space-between;
  gap:10px;
}
.panel-head h2{margin:0; font-size:14px; letter-spacing:.2px}

.panel-body{padding:12px 14px}

/* Global fields */
textarea, input, select{
  width:100%;
  background:var(--panel2);
  border:1px solid var(--line);
  color:var(--text);
  border-radius:10px;
  padding:10px 10px;
  outline:none;
}
textarea{resize:vertical}

.row{display:flex; gap:10px; align-items:center; margin-top:10px}
.spacer{flex:1}

button, .ghost{
  background:var(--accent);
  border:1px solid rgba(255,255,255,0.08);
  color:#0b0d10;
  padding:10px 12px;
  border-radius:12px;
  cursor:pointer;
  font-weight:700;
}
button:hover{filter:brightness(1.05)}
.ghost{
  background:transparent;
  color:var(--text);
  border:1px solid var(--line);
  display:inline-block;
}
.ghost:hover{border-color:#3a4460}

.muted{color:var(--muted)}
.tiny{font-size:12px}
.alert{
  background:rgba(255,107,107,0.12);
  border:1px solid rgba(255,107,107,0.35);
  padding:10px 12px;
  border-radius:12px;
  margin:10px 0;
}

.filters{
  display:grid;
  grid-template-columns: 2fr 1fr 1fr 1fr 1fr auto;
  gap:10px;
  align-items:center;
}
@media (max-width: 980px){
  .filters{grid-template-columns: 1fr 1fr; }
}

.table-wrap{
  overflow:auto;
  border-radius:12px;
  border:1px solid var(--line);
  background:var(--panel2)
}

table{
  width:100%;
  border-collapse:separate;
  border-spacing:0;
  font-size:13px;
}

thead th{
  position:sticky;
  top:0;
  background:rgba(15,19,28,0.98);
  border-bottom:1px solid var(--line);
  padding:10px 8px;
  text-align:left;
  white-space:nowrap;
  z-index:2;
}

tbody td{
  border-bottom:1px solid var(--line);
  padding:8px 8px;
  vertical-align:top;
}
tbody tr:hover{background:rgba(122,162,255,0.08)}
tbody tr.selected{
  outline:2px solid rgba(122,162,255,0.55);
  outline-offset:-2px;
  background:rgba(122,162,255,0.12)
}

/* --- table cell controls --- */
td .cell-input,
td .cell-notes{
  width:100%;
  padding:8px 8px;
  border-radius:10px;
  background:#0a0c12;
  border:1px solid #1f2636;
  color:var(--text);
}

/* ✅ key change: selects must NOT be forced to 100% width */
td .cell-select{
  width:auto;                 /* allow it to grow to show full selected text */
  min-width: 170px;           /* baseline so it doesn't get tiny */
  max-width: none;            /* don't cap it */
  padding:8px 28px 8px 10px;  /* space for arrow + tag dot */
  border-radius:10px;
  background:#0a0c12;
  border:1px solid #1f2636;
  color:var(--text);
  white-space:nowrap;
}

/* Notes height */
td .cell-notes{min-height:38px}

/* Disposition color tags (colors are applied via JS using CSS variables) */
td .cell-select.tagged{
  background: var(--tag-bg, #0a0c12);
  border-color: var(--tag-border, #1f2636);
  padding-left: 28px;
  background-image:
    radial-gradient(circle at 14px 50%, var(--tag-dot, rgba(122,162,255,0.85)) 0 5px, transparent 6px);
  background-repeat: no-repeat;
  background-position: left 0 top 0;
}

/* Optional: make dropdown list readable on some browsers */
td .cell-select option{ background: #0a0c12; color: var(--text); }

.badge{
  display:inline-block;
  padding:2px 8px;
  border:1px solid var(--line);
  border-radius:999px;
  font-size:12px;
  color:var(--muted);
}

/* Density toggle */
body.compact table{font-size:12px}
body.compact tbody td{padding:6px 6px}
body.compact thead th{padding:8px 6px}

/* Login */
.login-body{
  min-height:100vh;
  display:flex;
  align-items:center;
  justify-content:center;
  padding:24px;
}
.login-card{
  width:min(480px, 100%);
  border:1px solid var(--line);
  border-radius:16px;
  background:var(--panel);
  padding:18px 18px;
}
.login-card h1{margin:0 0 6px 0; font-size:18px}
.login-form{display:flex; flex-direction:column; gap:10px; margin-top:12px}
.login-form label{display:flex; flex-direction:column; gap:6px; font-size:13px}

/* Checkbox styling */
.rowCheck, #selectAll{
  width:16px;
  height:16px;
  accent-color: var(--accent);
}

/* --- FULL BLEED OVERRIDES (force edge-to-edge) --- */
html, body { width: 100%; }
.wrap{
  width: 100vw !important;
  max-width: none !important;
  margin: 0 !important;
  padding: 0 !important; /* true edge-to-edge */
}
@media (min-width: 900px){
  .wrap{ padding: 0 !important; }
}
.panel{ width: 100% !important; }
.topbar{ padding: 10px 12px !important; }

/* --- SLIM ROW OVERRIDES --- */
tbody tr.selected{
  background: rgba(122,162,255,0.10);
}

tbody td{
  padding-top:6px;
  padding-bottom:6px;
}

tbody td .tiny{
  margin-top:4px;
}

tbody td .cell-input,
tbody td textarea{
  min-height:32px;
  padding:6px 8px;
}

/* keep selects slim too */
tbody td .cell-select{
  min-height:32px;
  padding-top:6px;
  padding-bottom:6px;
}

tbody tr{
  border-radius:10px;
}
