/* =====================================================
   CRM Navacenter - UI Kommo-like (Dark clean)
   FILE: assets/crm/crm.css
   ===================================================== */

/* --------- Reset / Base --------- */
:root{
  --bg: #0b0f16;
  --panel: #0f1623;
  --panel-2:#111b2b;
  --card:#0e1522;
  --card-2:#101a2a;
  --text:#e6e9ef;
  --muted:#97a3b6;
  --line: rgba(255,255,255,.08);
  --shadow: 0 10px 25px rgba(0,0,0,.35);
  --shadow2: 0 6px 18px rgba(0,0,0,.28);
  --radius: 14px;
  --radius2: 12px;

  /* Acentos (Claro/Navacenter) */
  --accent: #7c5cff;      /* morado botones (como tu screenshot) */
  --accent-2:#ff2d2d;     /* rojo Claro */
  --ok:#22c55e;
  --warn:#f59e0b;
  --bad:#ef4444;
}

*{ box-sizing:border-box; }
html,body{ height:100%; }
body{
  margin:0;
  font-family: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Arial, "Noto Sans", "Helvetica Neue", sans-serif;
  color:var(--text);
  background:
    radial-gradient(1100px 700px at 20% -20%, rgba(124,92,255,.18), transparent 60%),
    radial-gradient(900px 600px at 100% 0%, rgba(255,45,45,.12), transparent 55%),
    linear-gradient(180deg, #070b12 0%, #0b0f16 55%, #070b12 100%);
}

/* --------- Layout main --------- */
.crm-shell{
  height:100vh;
  display:flex;
  flex-direction:column;
}

/* Topbar (Kommo-like) */
.crm-topbar{
  position:sticky;
  top:0;
  z-index:20;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  padding:14px 18px;
  border-bottom:1px solid var(--line);
  background: rgba(10,14,22,.82);
  backdrop-filter: blur(10px);
}

.crm-brand{
  display:flex;
  align-items:center;
  gap:10px;
  min-width: 220px;
}
.crm-brand .logoMark{
  width:34px;height:34px;
  border-radius:10px;
  display:grid;
  place-items:center;
  background: linear-gradient(135deg, rgba(124,92,255,.95), rgba(255,45,45,.75));
  box-shadow: var(--shadow2);
}
.crm-brand .title{
  font-weight:700;
  letter-spacing:.2px;
  display:flex;
  flex-direction:column;
  line-height:1.1;
}
.crm-brand .title small{
  color:var(--muted);
  font-weight:600;
  font-size:12px;
}

/* Controls center */
.crm-controls{
  flex:1;
  display:flex;
  align-items:center;
  justify-content:center;
  gap:10px;
  min-width: 420px;
}

.crm-pill{
  display:flex;
  align-items:center;
  gap:10px;
  background: rgba(255,255,255,.04);
  border:1px solid var(--line);
  border-radius: 999px;
  padding:10px 12px;
  box-shadow: 0 0 0 1px rgba(255,255,255,.02) inset;
}

.crm-select, .crm-input{
  background: transparent;
  border:0;
  color:var(--text);
  outline:none;
  font-size:14px;
}
.crm-select option{ color:#111; }

.crm-input{
  width: 280px;
}
.crm-input::placeholder{ color: rgba(151,163,182,.7); }

/* Right actions */
.crm-actions{
  display:flex;
  align-items:center;
  gap:10px;
  min-width: 320px;
  justify-content:flex-end;
}

.btn{
  border:1px solid var(--line);
  background: rgba(255,255,255,.04);
  color:var(--text);
  padding:10px 12px;
  border-radius: 12px;
  font-weight:700;
  font-size:14px;
  cursor:pointer;
  transition: transform .08s ease, background .2s ease, border-color .2s ease;
}
.btn:hover{ background: rgba(255,255,255,.06); border-color: rgba(255,255,255,.12); }
.btn:active{ transform: translateY(1px); }

.btn-primary{
  background: linear-gradient(135deg, rgba(124,92,255,1), rgba(124,92,255,.75));
  border-color: rgba(124,92,255,.65);
  box-shadow: 0 10px 24px rgba(124,92,255,.22);
}
.btn-primary:hover{ background: linear-gradient(135deg, rgba(124,92,255,1), rgba(124,92,255,.85)); }

.btn-danger{
  background: rgba(239,68,68,.12);
  border-color: rgba(239,68,68,.35);
  color: #ffd7d7;
}

.iconBtn{
  display:inline-flex;
  align-items:center;
  gap:8px;
}
.iconBtn i, .iconBtn svg{ width:18px; height:18px; }

/* --------- Content area --------- */
.crm-content{
  flex:1;
  display:flex;
  min-height:0; /* important for flex scroll */
}

/* Left sidebar (stats) */
.crm-sidebar{
  width: 270px;
  border-right: 1px solid var(--line);
  background: rgba(14,20,32,.55);
  padding:14px 14px 18px;
  overflow:auto;
}
.crm-sidebar .side-title{
  font-weight:800;
  margin: 6px 0 10px;
  font-size: 13px;
  color: rgba(230,233,239,.92);
}
.stat{
  display:flex;
  align-items:center;
  justify-content:space-between;
  padding:10px 10px;
  border-radius: 12px;
  background: rgba(255,255,255,.03);
  border:1px solid var(--line);
  margin-bottom:8px;
}
.stat span{ color: var(--muted); font-weight:700; font-size:12px; }
.stat b{ font-size:14px; }
.stat .money{ color: #dbeafe; }

/* --------- Kanban board --------- */
.board-wrap{
  flex:1;
  padding: 14px 16px 18px;
  overflow:auto;
}
.board{
  display:flex;
  gap:12px;
  align-items:flex-start;
  min-height: 100%;
}

/* Column */
.col{
  width: 320px;
  min-width: 320px;
  border-radius: var(--radius);
  background: rgba(255,255,255,.03);
  border: 1px solid var(--line);
  box-shadow: 0 1px 0 rgba(255,255,255,.03) inset;
}
.col-head{
  padding: 12px 12px 10px;
  border-bottom: 1px solid var(--line);
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:10px;
}
.col-title{
  display:flex;
  align-items:center;
  gap:10px;
  font-weight:900;
  font-size: 14px;
}
.col-title .dot{
  width:10px;height:10px;border-radius:999px;
  background: var(--accent);
  box-shadow: 0 0 0 4px rgba(124,92,255,.12);
}
.col-meta{
  display:flex;
  align-items:center;
  gap:8px;
}
.badge{
  padding: 5px 9px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 900;
  background: rgba(255,255,255,.05);
  border: 1px solid rgba(255,255,255,.10);
  color: rgba(230,233,239,.92);
}
.badge-money{
  background: rgba(34,197,94,.08);
  border-color: rgba(34,197,94,.22);
  color: #baf7cf;
}

.col-body{
  padding: 10px;
  min-height: 72px;
}

/* Cards (Leads) */
.card{
  border-radius: 14px;
  background: linear-gradient(180deg, rgba(16,26,42,.75), rgba(12,19,32,.75));
  border: 1px solid rgba(255,255,255,.10);
  box-shadow: 0 12px 22px rgba(0,0,0,.25);
  padding: 12px 12px 10px;
  margin-bottom: 10px;
  cursor: grab;
  transition: transform .12s ease, border-color .2s ease, background .2s ease;
}
.card:hover{
  transform: translateY(-1px);
  border-color: rgba(124,92,255,.22);
  background: linear-gradient(180deg, rgba(18,30,48,.88), rgba(12,19,32,.8));
}
.card:active{ cursor: grabbing; }

.card .name{
  font-weight: 900;
  font-size: 14px;
  margin: 0 0 6px;
}
.card .line{
  display:flex;
  align-items:center;
  gap:10px;
  color: rgba(230,233,239,.88);
  font-weight: 700;
  font-size: 13px;
  margin-bottom: 6px;
}
.card .line small{
  color: var(--muted);
  font-weight: 800;
  font-size: 12px;
}

.card .footer{
  display:flex;
  align-items:center;
  justify-content:space-between;
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px dashed rgba(255,255,255,.10);
}

.card .actions{
  display:flex;
  gap:8px;
}
.action{
  width:34px;height:34px;
  display:grid;
  place-items:center;
  border-radius: 12px;
  background: rgba(255,255,255,.05);
  border: 1px solid rgba(255,255,255,.10);
  cursor:pointer;
  transition: background .2s ease, border-color .2s ease;
}
.action:hover{
  background: rgba(124,92,255,.10);
  border-color: rgba(124,92,255,.22);
}

/* Drag placeholder */
.sortable-ghost{
  opacity: .55;
  border: 1px dashed rgba(124,92,255,.45) !important;
}

/* Modals / overlays (si ya tienes) */
.modal-backdrop{
  position:fixed;
  inset:0;
  background: rgba(0,0,0,.55);
  backdrop-filter: blur(4px);
  z-index:50;
}
.modal{
  position:fixed;
  inset:0;
  display:flex;
  align-items:center;
  justify-content:center;
  z-index:60;
  padding: 18px;
}
.modal .panel{
  width: min(740px, 96vw);
  border-radius: 18px;
  background: rgba(15,22,35,.95);
  border: 1px solid rgba(255,255,255,.10);
  box-shadow: var(--shadow);
  overflow:hidden;
}
.modal .panel .head{
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
  display:flex;
  align-items:center;
  justify-content:space-between;
}
.modal .panel .body{ padding: 16px; }
.modal .panel .foot{
  padding: 14px 16px;
  border-top: 1px solid var(--line);
  display:flex;
  justify-content:flex-end;
  gap:10px;
}

/* Toast */
.toast-container{
  position: fixed;
  right: 16px;
  bottom: 16px;
  z-index: 90;
  display:flex;
  flex-direction:column;
  gap:10px;
}
.toast{
  background: rgba(15,22,35,.95);
  border: 1px solid rgba(255,255,255,.12);
  border-radius: 14px;
  padding: 10px 12px;
  box-shadow: var(--shadow2);
  min-width: 260px;
}
.toast.success{ border-color: rgba(34,197,94,.25); }
.toast.error{ border-color: rgba(239,68,68,.25); }

/* Responsive */
@media (max-width: 1100px){
  .crm-sidebar{ display:none; }
  .crm-controls{ min-width: unset; justify-content:flex-start; }
}
