body.crm { background: #f3eee6; min-height: 100vh; }
.btn.sm { padding: 9px 15px; font-size: 14px; }

.login { min-height: 100vh; display: grid; grid-template-columns: 1.1fr .9fr; }
.login[hidden] { display: none; }
.login-art { position: relative; color: #fff; display: flex; align-items: end; padding: 48px; overflow: hidden; }
.login-art img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.login-art::after { content: ""; position: absolute; inset: 0; background: linear-gradient(to top, rgba(14, 77, 90, .9), rgba(14, 77, 90, .15)); }
.login-art div { position: relative; z-index: 1; }
.login-art h1 { font-size: 44px; }
.login-form { display: flex; flex-direction: column; justify-content: center; gap: 14px; padding: 48px; max-width: 440px; width: 100%; margin: 0 auto; }
.login-form .avatar { width: 76px; height: 76px; border-radius: 50%; object-fit: cover; border: 3px solid var(--lagoon); }
.login-form h2 { color: var(--sea); font-size: 32px; margin: 6px 0 0; }
.login-form p { color: var(--muted); margin: 0 0 6px; }
.login-form input { font: 16px var(--font-body); padding: 14px 16px; border-radius: 12px; border: 1.5px solid var(--line); outline: none; }
.login-form input:focus { border-color: var(--lagoon); }
.login-form .back { color: var(--muted); font-size: 14px; text-decoration: none; text-align: center; }
@media (max-width: 800px) { .login { grid-template-columns: 1fr; } .login-art { min-height: 200px; padding: 24px; } .login-art h1 { font-size: 30px; } .login-form { padding: 28px 20px; } }

.crm-top { display: flex; justify-content: space-between; align-items: center; gap: 14px; padding: 14px 22px; background: #fff; border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 20; flex-wrap: wrap; }
.crm-actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.crm-actions .search { flex: 0 1 260px; }
.crm-actions .search input { padding: 9px 14px 9px 36px; font-size: 14px; }
.crm-actions .search svg { left: 13px; }
.seg { display: inline-flex; background: var(--sand); border-radius: 999px; padding: 3px; }
.seg button { border: 0; background: none; font: 600 13px var(--font-body); padding: 7px 14px; border-radius: 999px; cursor: pointer; color: var(--muted); }
.seg button.on { background: #fff; color: var(--sea); box-shadow: 0 1px 4px rgba(0, 0, 0, .08); }

.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 12px; padding: 18px 22px 0; }
.kpi { background: #fff; border-radius: 16px; padding: 14px 16px; }
.kpi small { color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: .08em; }
.kpi b { display: block; font-family: var(--font-title); font-size: 28px; color: var(--sea); }
.kpi.warn b { color: var(--coral); }

.hoy { margin: 14px 22px 0; background: #fff6ef; border: 1px solid #f6d6c6; border-radius: 16px; padding: 12px 16px; }
.hoy h3 { font-size: 16px; margin: 0 0 8px; color: var(--coral-dark); font-family: var(--font-body); }
.hoy #hoy { display: flex; gap: 8px; flex-wrap: wrap; }
.hoy .pill { background: #fff; border: 1px solid #f0d2c3; border-radius: 999px; padding: 6px 12px; font-size: 13px; cursor: pointer; }

.board { display: grid; grid-template-columns: repeat(6, minmax(240px, 1fr)); gap: 14px; padding: 18px 22px 40px; overflow-x: auto; align-items: start; }
.col { background: rgba(255, 255, 255, .55); border-radius: 18px; padding: 10px; min-height: 200px; }
.col.drop { outline: 2px dashed var(--lagoon); background: var(--lagoon-soft); }
.col h4 { display: flex; justify-content: space-between; align-items: center; margin: 4px 6px 10px; font-size: 14px; text-transform: uppercase; letter-spacing: .06em; }
.col h4 span { background: #fff; border-radius: 999px; padding: 1px 9px; font-size: 12px; color: var(--muted); }
.col h4 i { width: 10px; height: 10px; border-radius: 50%; display: inline-block; margin-right: 6px; }
.lead { background: #fff; border-radius: 14px; padding: 12px 13px; margin-bottom: 9px; cursor: pointer; box-shadow: 0 2px 8px rgba(14, 77, 90, .06); border-left: 4px solid transparent; }
.lead:hover { box-shadow: 0 6px 16px rgba(14, 77, 90, .12); }
.lead.p-alta { border-left-color: var(--coral); }
.lead.p-baja { border-left-color: #c9d3d5; }
.lead b { display: block; font-size: 15px; }
.lead .dest { font-size: 13px; color: var(--sea); margin: 2px 0 6px; }
.lead .row { display: flex; justify-content: space-between; font-size: 12px; color: var(--muted); gap: 6px; flex-wrap: wrap; }
.lead .vencido { color: var(--coral-dark); font-weight: 600; }
.lead[draggable=true] { cursor: grab; }

.lista { padding: 18px 22px 40px; overflow-x: auto; }
.lista table { width: 100%; border-collapse: collapse; background: #fff; border-radius: 16px; overflow: hidden; font-size: 14px; }
.lista th, .lista td { text-align: left; padding: 11px 14px; border-bottom: 1px solid #f0ebe2; white-space: nowrap; }
.lista th { font-size: 12px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); background: #faf7f2; }
.lista tr:hover td { background: #fbf8f3; cursor: pointer; }
.tag { display: inline-block; border-radius: 999px; padding: 3px 10px; font-size: 12px; font-weight: 600; }

.drawer-bg { position: fixed; inset: 0; background: rgba(15, 30, 35, .4); z-index: 50; display: none; }
.drawer-bg.open { display: block; }
.drawer { position: fixed; top: 0; right: 0; bottom: 0; width: min(520px, 100%); background: #fff; z-index: 51; transform: translateX(100%); transition: transform .25s; overflow-y: auto; padding: 24px; }
.drawer.open { transform: none; }
.drawer h2 { color: var(--sea); font-size: 28px; margin-bottom: 4px; }
.drawer .sub { color: var(--muted); font-size: 14px; margin-bottom: 14px; }
.quick { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 18px; }
.quick a { text-decoration: none; }
.stages { display: flex; gap: 4px; margin-bottom: 18px; flex-wrap: wrap; }
.stages button { flex: 1 1 auto; border: 1.5px solid var(--line); background: #fff; border-radius: 10px; padding: 8px 6px; font: 600 12px var(--font-body); cursor: pointer; color: var(--muted); }
.stages button.on { color: #fff; }
.dgrid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 18px; }
.dgrid label { font-size: 12px; font-weight: 600; color: var(--muted); display: grid; gap: 4px; text-transform: uppercase; letter-spacing: .04em; }
.dgrid input, .dgrid select, .dgrid textarea { font: 14px var(--font-body); padding: 9px 11px; border: 1.5px solid var(--line); border-radius: 10px; outline: none; color: var(--ink); text-transform: none; letter-spacing: 0; background: #fff; }
.dgrid .full { grid-column: 1 / -1; }
.dgrid textarea { min-height: 70px; resize: vertical; }
.timeline { border-top: 1px solid var(--line); padding-top: 16px; }
.timeline h3 { font-size: 18px; color: var(--sea); }
.nota-form { display: grid; gap: 8px; margin-bottom: 16px; }
.nota-form textarea { font: 14px var(--font-body); padding: 10px 12px; border: 1.5px solid var(--line); border-radius: 10px; min-height: 70px; resize: vertical; outline: none; }
.nota-form .r { display: flex; gap: 8px; }
.nota-form select { font: 14px var(--font-body); padding: 8px 10px; border: 1.5px solid var(--line); border-radius: 10px; }
.ev { display: grid; grid-template-columns: 30px 1fr; gap: 10px; margin-bottom: 12px; }
.ev .ic { width: 30px; height: 30px; border-radius: 50%; background: var(--lagoon-soft); display: grid; place-items: center; font-size: 14px; }
.ev.sistema .ic { background: #f0ebe2; }
.ev .t { font-size: 14px; white-space: pre-wrap; }
.ev.sistema .t { color: var(--muted); font-size: 13px; }
.ev small { color: var(--muted); font-size: 12px; }
.ev .del { border: 0; background: none; color: var(--muted); cursor: pointer; font-size: 12px; padding: 0 0 0 8px; }
.danger { color: #b33a26; background: none; border: 0; font: 600 13px var(--font-body); cursor: pointer; margin-top: 18px; }

.toast { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%) translateY(80px); background: var(--ink); color: #fff; padding: 10px 18px; border-radius: 999px; font-size: 14px; transition: transform .25s; z-index: 90; }
.toast.show { transform: translateX(-50%); }
