/* Minimal clean UI */
:root{
  --bg:#0b1020;
  --card:#121a33;
  --muted:#94a3b8;
  --text:#e5e7eb;
  --border:rgba(148,163,184,.18);
  --primary:#10b981;
  --danger:#ef4444;
  --ghost:rgba(148,163,184,.12);
  --shadow:0 10px 30px rgba(0,0,0,.35);
}

*{box-sizing:border-box}
html, body{
  min-height: 100%;
  margin: 0;
}
body{
  margin:0;
  font-family: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Arial, "Noto Sans", "Apple Color Emoji","Segoe UI Emoji";
  background: radial-gradient(1200px 700px at 20% 0%, rgba(16,185,129,.18), transparent 55%),
              radial-gradient(900px 700px at 80% 10%, rgba(99,102,241,.16), transparent 55%),
              var(--bg);
  background-repeat: no-repeat;
  background-attachment: scroll;
  background-size: 100% 100%;
  color:var(--text);
}

a{color:inherit}
.container{max-width:1100px; margin:22px auto; padding:0 16px}
.app-header{
  display:flex; align-items:center; justify-content:space-between;
  padding:14px 16px; position:sticky; top:0; z-index:5;
  background:rgba(11,16,32,.75); backdrop-filter: blur(10px);
  border-bottom:1px solid var(--border);
}
.brand{display:flex; gap:12px; align-items:center}
.brand-icon{width:42px; height:42px; border-radius:12px; box-shadow:var(--shadow)}
.brand-title{font-weight:800; letter-spacing:.2px}
.brand-sub{font-size:12px; color:var(--muted)}

.card{
  background: linear-gradient(180deg, rgba(255,255,255,.03), rgba(255,255,255,.01));
  border:1px solid var(--border);
  border-radius:18px;
  padding:16px;
  box-shadow: var(--shadow);
}

h1,h2{margin:0 0 10px 0}
.muted{color:var(--muted)}
.small{font-size:12px}

.row{display:flex; align-items:center; justify-content:flex-start}
.gap{gap:10px}
.header-actions{display:flex; gap:10px}

button, input, select{
  font:inherit;
  border-radius:14px;
  border:1px solid var(--border);
  background: rgba(255,255,255,.02);
  color:var(--text);
  padding:10px 12px;
  outline:none;
}
input::placeholder{color:rgba(148,163,184,.65)}
button{cursor:pointer}
button.primary{
  background: linear-gradient(180deg, rgba(16,185,129,.95), rgba(16,185,129,.65));
  border-color:rgba(16,185,129,.5);
  color:#052014;
  font-weight:800;
}
button.danger{
  background: linear-gradient(180deg, rgba(239,68,68,.95), rgba(239,68,68,.65));
  border-color:rgba(239,68,68,.5);
  color:#2b0707;
  font-weight:800;
}
button.ghost, a.ghost, .filelike{
  background: var(--ghost);
  border-color: rgba(148,163,184,.22);
}
a.ghost{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  padding:10px 12px;
  border-radius:14px;
  border:1px solid var(--border);
  text-decoration:none;
  cursor:pointer;
}
.filelike{
  font:inherit;
  color:var(--text);
  border-radius:14px;
  border:1px solid var(--border);
  cursor:pointer;
}
button:disabled{opacity:.6; cursor:not-allowed}

.form-grid{
  display:grid;
  grid-template-columns: 1fr;
  gap:12px;
}
.form-grid.two-col{
  grid-template-columns: 1fr 1fr;
}
label span{display:block; margin:0 0 6px 2px; font-size:12px; color:var(--muted)}
label input, label select{width:100%}

.toolbar{
  display:flex; gap:12px; align-items:center; justify-content:space-between;
  margin-bottom:14px;
}
.toolbar-left, .toolbar-right{display:flex; gap:10px; flex-wrap:wrap; align-items:center}
.toolbar-right input{min-width:170px}

.grid{
  display:grid;
  grid-template-columns: 380px 1fr;
  gap:14px;
}
@media (max-width: 980px){
  .grid{grid-template-columns:1fr}
  .toolbar{flex-direction:column; align-items:stretch}
  .toolbar-right input{min-width:unset; flex:1}
}

.section-title{display:flex; align-items:center; justify-content:space-between; gap:10px; margin-bottom:10px}
.pill{
  padding:6px 10px;
  border-radius:999px;
  background:rgba(16,185,129,.15);
  border:1px solid rgba(16,185,129,.28);
  color:#bff6df;
  font-weight:700;
  font-size:12px;
}

.list{display:flex; flex-direction:column; gap:8px; max-height: 62vh; overflow:auto; padding-right:6px}
.item{
  padding:10px 12px;
  border-radius:14px;
  border:1px solid var(--border);
  background: rgba(255,255,255,.02);
  cursor:pointer;
}
.item:hover{border-color: rgba(16,185,129,.35)}
.item .top{display:flex; align-items:center; justify-content:space-between; gap:10px}
.item .name{font-weight:800}
.item .meta{font-size:12px; color:var(--muted)}
.item .tag{font-size:12px; padding:3px 8px; border-radius:999px; background:rgba(99,102,241,.14); border:1px solid rgba(99,102,241,.25); color:#d7dcff}

.photo-row{display:flex; gap:14px; align-items:center; margin:10px 0 14px 0}
.photo{
  width:112px; height:112px;
  border-radius:18px;
  border:1px solid var(--border);
  background: rgba(255,255,255,.02);
  display:flex; align-items:center; justify-content:center;
  overflow:hidden;
  position:relative;
}
.photo img{width:100%; height:100%; object-fit:cover; display:none}
.photo-empty{position:absolute; color:rgba(148,163,184,.75); font-size:12px}
.photo-actions{display:flex; flex-direction:column; gap:10px}
.filelike{display:inline-flex; align-items:center; justify-content:center; padding:10px 12px}
.footer{padding:14px 16px; text-align:center; border-top:1px solid var(--border); background:rgba(11,16,32,.55)}

details.hint{margin-top:12px}
details.hint summary{cursor:pointer; color:#bff6df}

code{background:rgba(148,163,184,.12); padding:2px 6px; border-radius:8px; border:1px solid rgba(148,163,184,.18)}


textarea{
  width:100%;
  resize:vertical;
  min-height:72px;
  font:inherit;
  border-radius:14px;
  border:1px solid var(--border);
  background: rgba(255,255,255,.02);
  color:var(--text);
  padding:10px 12px;
  outline:none;
}
.card-inner{
  margin-top:14px;
  padding:12px;
  border-radius:16px;
  border:1px solid var(--border);
  background: rgba(255,255,255,.015);
}
.notes-list{
  margin-top:12px;
  display:flex;
  flex-direction:column;
  gap:10px;
  max-height: 220px;
  overflow:auto;
  padding-right:6px;
}
.note-item{
  border:1px solid var(--border);
  background: rgba(255,255,255,.02);
  border-radius:14px;
  padding:10px 12px;
}
.note-item .meta{
  font-size:12px;
  color:var(--muted);
  margin-bottom:6px;
}
.note-item .text{
  white-space:pre-wrap;
  line-height:1.35;
}

/* Status colors */
.item.seg{border-color: rgba(16,185,129,.55); background: rgba(16,185,129,.08);}
.item.seg .tag{background:rgba(16,185,129,.18); border-color:rgba(16,185,129,.28); color:#bff6df;}
.item.akquise{border-color: rgba(148,163,184,.22); background: rgba(255,255,255,.02);}

.status-pill{
  padding:6px 10px;
  border-radius:999px;
  border:1px solid var(--border);
  font-weight:800;
  font-size:12px;
}
.status-pill.seg{background:rgba(16,185,129,.15); border-color:rgba(16,185,129,.28); color:#bff6df;}
.status-pill.akquise{background:rgba(148,163,184,.10); border-color:rgba(148,163,184,.22); color:rgba(229,231,235,.92);}

/* Notes delete button */
.note-actions{display:flex; gap:8px; align-items:center; justify-content:flex-end;}
.note-del{
  font-size:12px;
  padding:6px 10px;
  border-radius:999px;
}

/* Mobile slide behavior */
@media (max-width: 980px){
  .grid{position:relative; overflow:hidden}
  .grid.slide-mode{grid-template-columns:1fr}
  .grid.slide-mode > section{min-width:100%}
  .grid.slide-mode{display:flex; transition:transform .28s ease}
  .grid.slide-to-editor{transform: translateX(-100%);}
  .grid.slide-to-list{transform: translateX(0%);}
}

.custom-fields{
  display:grid;
  grid-template-columns: 1fr 1fr;
  gap:12px;
}
@media (max-width: 980px){
  .custom-fields{grid-template-columns:1fr;}
}
