:root{
  --bg:#0b0f14;
  --panel:#111824;
  --panel2:#0e1520;
  --text:#e6edf3;
  --muted:#9db0c3;
  --accent:#4ea1ff;
  --border:#243244;
  --danger:#ff5a67;
  --ok:#4ade80;
  --shadow: 0 8px 30px rgba(0,0,0,.35);
  font-family: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, "Apple Color Emoji","Segoe UI Emoji";
}
body{
  margin:0;
  background:linear-gradient(180deg, var(--bg), #06080c 70%);
  color:var(--text);
}
a{ color:var(--accent); text-decoration:none; }
a:hover{ text-decoration:underline; }

.container{
  max-width: 1400px;
  margin: 0 auto;
  padding: 16px;
}
.topbar{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  margin-bottom: 12px;
}
.brand{
  display:flex;
  align-items:center;
  gap:10px;
  font-weight:700;
  letter-spacing:.3px;
}
.brand .dot{ width:10px; height:10px; border-radius:999px; background:var(--accent); box-shadow:0 0 0 4px rgba(78,161,255,.15); }

.layout{
  display:grid;
  grid-template-columns: 320px 1fr;
  gap: 12px;
}
@media (max-width: 1000px){
  .layout{ grid-template-columns: 1fr; }
}
.card{
  background:linear-gradient(180deg, var(--panel), var(--panel2));
  border:1px solid var(--border);
  border-radius: 16px;
  box-shadow: var(--shadow);
  padding: 14px;
}

h2{ margin:0 0 10px 0; font-size:14px; text-transform:uppercase; letter-spacing:.12em; color:var(--muted); }
label{ font-size:12px; color:var(--muted); display:block; margin: 10px 0 6px; }
input[type=text], textarea, select{
  width:100%;
  box-sizing:border-box;
  background: rgba(255,255,255,.03);
  border:1px solid var(--border);
  color:var(--text);
  border-radius: 12px;
  padding: 10px 12px;
  outline: none;
}
textarea{ min-height: 140px; resize: vertical; }
select{ padding: 10px 12px; }

.row{
  display:flex;
  gap:10px;
  align-items:center;
}
.row.spread{ justify-content: space-between; }
.btn{
  background: rgba(78,161,255,.16);
  border:1px solid rgba(78,161,255,.35);
  color: var(--text);
  padding: 9px 12px;
  border-radius: 12px;
  cursor:pointer;
}
.btn:hover{ background: rgba(78,161,255,.24); }
.btn.secondary{ background: rgba(255,255,255,.06); border-color: var(--border); }
.btn.secondary:hover{ background: rgba(255,255,255,.1); }
.btn.danger{ background: rgba(255,90,103,.14); border-color: rgba(255,90,103,.4); }
.btn.danger:hover{ background: rgba(255,90,103,.22); }

.small{ font-size:12px; color: var(--muted); }
.status{ font-size:12px; }
.status.ok{ color: var(--ok); }
.status.bad{ color: var(--danger); }

.list{
  margin: 10px 0 0;
  padding: 0;
  list-style: none;
  max-height: 280px;
  overflow:auto;
  border:1px solid var(--border);
  border-radius: 12px;
}
.list li{
  padding: 10px 12px;
  border-bottom:1px solid var(--border);
  cursor:pointer;
}
.list li:last-child{ border-bottom:none; }
.list li:hover{ background: rgba(255,255,255,.04); }
.list li.active{ background: rgba(78,161,255,.12); }

.attachments{
  display:flex;
  flex-direction:column;
  gap:8px;
  margin-top: 10px;
}
.attachments .item{
  display:flex;
  justify-content:space-between;
  gap:10px;
  align-items:center;
  padding: 8px 10px;
  border:1px solid var(--border);
  border-radius: 12px;
  background: rgba(255,255,255,.02);
}
.attachments .item .name{ overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.attachments .item .actions{ display:flex; gap:8px; }

.searchResults{ max-height: 240px; }

/* Quill editor */
.note-toolbar { margin-top: 4px; }
.note-editor { height: 520px; background: #fff; color: #111; }
.note-editor .ql-editor { min-height: 480px; color: #111; }
.note-editor .ql-editor a { color: #0b66d1; }

.ql-container { font-size: 14px; }
.ql-toolbar.ql-snow { border-radius: 12px 12px 0 0; }
.ql-container.ql-snow { border-radius: 0 0 12px 12px; }
