@import url('https://fonts.googleapis.com/css2?family=Nunito:wght@400;500;600;700;800;900&display=swap');
:root{
  --bg:#f4f7fb;
  --surface:#ffffff;
  --surface-soft:#f8fafc;
  --surface-tint:#f1f6ff;
  --ink:#132238;
  --ink-soft:#34445c;
  --muted:#718096;
  --line:#e4eaf2;
  --line-strong:#d4ddea;
  --primary:#2563eb;
  --primary-dark:#1d4ed8;
  --primary-soft:#eaf2ff;
  --success:#0f9f6e;
  --warning:#d97706;
  --danger:#dc3f58;
  --info:#3b82f6;
  --violet:#7c3aed;
  --sidebar:#0d1728;
  --sidebar-soft:#14223a;
  --shadow-sm:0 4px 14px rgba(15,35,65,.05);
  --shadow:0 16px 45px rgba(15,35,65,.09);
  --shadow-lg:0 28px 70px rgba(10,28,55,.16);
  --radius-sm:10px;
  --radius:18px;
  --radius-lg:26px;
}

*{box-sizing:border-box}
html{font-family:Inter,ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif;color:var(--ink);background:var(--bg);-webkit-font-smoothing:antialiased}
body{margin:0;background:linear-gradient(180deg,#f7f9fc 0,#f3f6fa 100%);min-height:100vh}
body.menu-open{overflow:hidden}
a{color:var(--primary);text-decoration:none}
a:hover{text-decoration:none}
button,input,select,textarea{font:inherit}
button{color:inherit}
.icon{width:20px;height:20px;display:block;flex:0 0 auto}

/* Layout */
.app-shell{display:grid;grid-template-columns:272px minmax(0,1fr);min-height:100vh}
.sidebar{position:sticky;top:0;height:100vh;background:
  radial-gradient(circle at 30% 0%,rgba(55,111,228,.17),transparent 32%),
  linear-gradient(180deg,#101b2e 0%,#0b1423 100%);
  color:#edf4ff;padding:22px 16px 18px;display:flex;flex-direction:column;z-index:40;border-right:1px solid rgba(255,255,255,.04)}
.sidebar:after{content:"";position:absolute;inset:0;pointer-events:none;background:linear-gradient(90deg,transparent 80%,rgba(255,255,255,.02));}
.sidebar>*{position:relative;z-index:1}
.sidebar-backdrop{display:none}
.brand{display:flex;gap:12px;align-items:center;color:#fff;padding:2px 8px 22px;margin-bottom:4px}
.sidebar-brand-row{display:flex;align-items:flex-start;gap:8px;margin-bottom:4px}
.sidebar-brand-row .brand{flex:1;min-width:0;padding:2px 0 22px;margin:0}
.sidebar-top-logout{flex:0 0 36px;width:36px;height:36px;margin-top:4px;color:#a9b8cc;border:1px solid rgba(255,255,255,.08)}
.sidebar-top-logout:hover{background:rgba(255,255,255,.08);color:#fff}
.brand-copy{display:flex;flex-direction:column;min-width:0}
.brand-copy strong{font-size:16px;letter-spacing:-.02em}
.brand-copy small{font-size:11px;color:#7f91ad;margin-top:2px;font-weight:600}
.brand-mark{width:52px;height:52px;border-radius:17px;background:linear-gradient(135deg,#4f8cff 0%,#2458d3 60%,#7239d7 100%);display:grid;place-items:center;color:#fff;box-shadow:0 14px 34px rgba(37,99,235,.35);overflow:hidden}
.brand-mark .icon{width:25px;height:25px;stroke-width:1.9}
.brand-mark.small{width:40px;height:40px;border-radius:13px;flex:0 0 40px}
.brand-mark.small .icon{width:21px;height:21px}
.sidebar nav{display:flex;flex-direction:column}
.nav-label{font-size:10px;text-transform:uppercase;letter-spacing:.16em;color:#60738f;margin:20px 12px 8px;font-weight:800}
.nav-link{display:flex;align-items:center;gap:12px;color:#9eb0c9;padding:11px 12px;border-radius:12px;margin:2px 0;font-weight:670;font-size:14px;position:relative;transition:.18s ease}
.nav-link:before{content:"";position:absolute;left:-7px;width:3px;height:22px;border-radius:99px;background:#6ea0ff;opacity:0;transform:scaleY(.5);transition:.18s ease}
.nav-link:hover{background:rgba(255,255,255,.055);color:#eef5ff;transform:translateX(2px)}
.nav-link.active{background:linear-gradient(90deg,rgba(62,113,216,.24),rgba(62,113,216,.09));color:#fff;box-shadow:inset 0 0 0 1px rgba(111,157,245,.12)}
.nav-link.active:before{opacity:1;transform:scaleY(1)}
.nav-icon{width:22px;height:22px;display:grid;place-items:center;color:#8195b2}
.nav-icon .icon{width:19px;height:19px}
.nav-link.active .nav-icon,.nav-link:hover .nav-icon{color:#8eb7ff}
.sidebar-support{margin-top:auto;border:1px solid rgba(255,255,255,.07);background:rgba(255,255,255,.035);border-radius:14px;padding:12px;display:flex;gap:10px;align-items:center}
.sidebar-support-icon{width:34px;height:34px;border-radius:11px;display:grid;place-items:center;background:rgba(65,114,215,.16);color:#82adff}
.sidebar-support-icon .icon{width:18px;height:18px}
.sidebar-support div{display:flex;flex-direction:column}
.sidebar-support strong{font-size:12px;color:#dce8fa}
.sidebar-support small{font-size:10px;color:#7386a2;margin-top:2px}
.sidebar-user{margin-top:12px;border-top:1px solid rgba(255,255,255,.07);padding:15px 7px 0;display:grid;grid-template-columns:38px minmax(0,1fr);align-items:center;gap:10px}
.user-avatar,.topbar-avatar{display:grid;place-items:center;border-radius:12px;background:linear-gradient(135deg,#334b70,#1e2f4d);color:#dce9ff;font-weight:850;border:1px solid rgba(255,255,255,.08)}
.user-avatar{width:38px;height:38px}
.user-meta{display:flex;flex-direction:column;min-width:0}
.user-meta strong{font-size:12px;color:#eaf1fb;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.user-meta span{font-size:10px;color:#7386a2;margin-top:2px}
.logout-link{width:32px;height:32px;border-radius:10px;color:#8093ae;display:grid;place-items:center;transition:.16s ease}
.logout-link:hover{background:rgba(255,255,255,.06);color:#fff}
.logout-link .icon{width:17px;height:17px}

.main-area{min-width:0}
.topbar{min-height:96px;background:rgba(255,255,255,.82);backdrop-filter:blur(18px);-webkit-backdrop-filter:blur(18px);border-bottom:1px solid rgba(215,224,237,.85);display:flex;align-items:center;gap:16px;justify-content:space-between;padding:17px 32px;position:sticky;top:0;z-index:25}
.topbar-title{min-width:0}
.topbar-kicker{display:block;color:var(--primary);font-size:10px;text-transform:uppercase;letter-spacing:.14em;font-weight:850;margin-bottom:3px}
.topbar h1{margin:0;font-size:26px;letter-spacing:-.035em;line-height:1.15}
.topbar p{margin:5px 0 0;color:var(--muted);font-size:12px;text-transform:none}
.topbar-actions{display:flex;align-items:center;gap:12px}
.topbar-avatar{display:none;width:38px;height:38px;color:var(--primary);background:var(--primary-soft);border-color:#d8e6ff}
.menu-button{display:none;width:42px;height:42px;border:1px solid var(--line);border-radius:12px;background:#fff;align-items:center;justify-content:center;box-shadow:var(--shadow-sm);cursor:pointer}
.menu-button .icon{width:21px;height:21px}
.content{padding:28px 32px 64px;max-width:1540px;margin:auto}

/* Surfaces */
.panel{background:rgba(255,255,255,.94);border:1px solid rgba(224,231,240,.95);border-radius:var(--radius);padding:23px;box-shadow:var(--shadow-sm);margin-bottom:22px;transition:box-shadow .2s ease,border-color .2s ease}
.panel:hover{border-color:#dbe4ef}
.panel h2,.panel h3{margin:0 0 6px;letter-spacing:-.025em}
.panel h2{font-size:20px}
.panel h3{font-size:17px}
.panel-head{display:flex;align-items:center;justify-content:space-between;gap:18px;margin-bottom:19px}
.panel-head p{margin:5px 0 0;color:var(--muted);font-size:12px}
.eyebrow{font-size:10px;text-transform:uppercase;letter-spacing:.14em;color:var(--primary);font-weight:850;margin-bottom:6px}
.muted{color:var(--muted)}

/* Buttons */
.button{display:inline-flex;align-items:center;justify-content:center;gap:8px;border-radius:11px;padding:10px 15px;min-height:42px;border:1px solid transparent;cursor:pointer;font-weight:760;font-size:13px;line-height:1.2;white-space:nowrap;transition:transform .16s ease,box-shadow .16s ease,background .16s ease,border-color .16s ease}
.button .icon{width:17px;height:17px}
.button:hover{transform:translateY(-1px)}
.button.primary{background:linear-gradient(135deg,#2f73f1,#2258d2);color:#fff;box-shadow:0 9px 20px rgba(37,99,235,.2)}
.button.primary:hover{background:linear-gradient(135deg,#2768df,#194bc2);box-shadow:0 12px 24px rgba(37,99,235,.26)}
.button.secondary{background:#edf4ff;color:#2459b8;border-color:#d9e7ff}
.button.secondary:hover{background:#e4efff;border-color:#c9dcff}
.button.ghost{background:#fff;border-color:var(--line);color:var(--ink-soft);box-shadow:0 2px 5px rgba(15,35,65,.025)}
.button.ghost:hover{border-color:#cfd9e6;background:#fbfcfe}
.button.wide{width:100%}

/* Dashboard stats */
.stats-grid{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:17px;margin-bottom:22px}
.stat-card{position:relative;overflow:hidden;background:linear-gradient(145deg,#fff,#fbfdff);border:1px solid var(--line);border-radius:var(--radius);padding:20px;box-shadow:var(--shadow-sm);transition:transform .2s ease,box-shadow .2s ease}
.stat-card:after{content:"";position:absolute;width:110px;height:110px;border-radius:50%;right:-44px;bottom:-55px;opacity:.1;background:currentColor}
.stat-card:hover{transform:translateY(-3px);box-shadow:var(--shadow)}
.stat-card-top{display:flex;align-items:center;justify-content:space-between;gap:12px}
.stat-card-top>span:first-child{display:block;color:var(--muted);font-size:12px;font-weight:720}
.stat-icon{width:42px;height:42px;border-radius:13px;display:grid;place-items:center;background:var(--card-soft);color:var(--card-color)}
.stat-icon .icon{width:20px;height:20px}
.stat-card strong{display:block;font-size:29px;line-height:1.1;letter-spacing:-.045em;margin:15px 0 8px;color:var(--ink)}
.stat-card small{color:#8996a8;display:flex;align-items:center;gap:6px;font-size:11px}
.stat-card small .icon{width:13px;height:13px}
.stat-blue{--card-color:#2563eb;--card-soft:#eaf2ff;color:#2563eb}
.stat-amber{--card-color:#d97706;--card-soft:#fff3df;color:#d97706}
.stat-violet{--card-color:#7c3aed;--card-soft:#f0e9ff;color:#7c3aed}
.stat-green{--card-color:#0f9f6e;--card-soft:#e5f8f1;color:#0f9f6e}

/* Tables */
.table-wrap{overflow:auto;border:1px solid var(--line);border-radius:14px;background:#fff}
table{width:100%;border-collapse:separate;border-spacing:0;min-width:720px}
th,td{text-align:left;padding:14px 15px;border-bottom:1px solid #eaf0f6;vertical-align:middle}
th{background:#f8fafc;color:#78869a;font-size:10px;text-transform:uppercase;letter-spacing:.095em;font-weight:850;position:sticky;top:0;z-index:2}
th:first-child{border-radius:13px 0 0 0}
th:last-child{border-radius:0 13px 0 0}
td{font-size:13px;color:#27384f;background:#fff}
tbody tr{transition:background .15s ease}
tbody tr:hover td{background:#f9fbff}
tr:last-child td{border-bottom:0}
td strong{color:#17263a}
td small{color:var(--muted);line-height:1.5}
.actions{display:flex;gap:9px;align-items:center;flex-wrap:wrap}
.text-link{font-weight:760;font-size:12px;color:var(--primary);display:inline-flex;align-items:center;gap:5px}
.text-link:hover{color:var(--primary-dark)}

/* Badges */
.badge{display:inline-flex;align-items:center;border-radius:999px;padding:6px 10px;font-size:10px;font-weight:820;background:#eef2f6;color:#59677a;border:1px solid transparent;line-height:1}
.badge:before{content:"";width:6px;height:6px;border-radius:50%;background:currentColor;margin-right:6px;opacity:.8}
.badge.small{margin-top:5px;padding:4px 8px}
.badge.large{font-size:12px;padding:8px 12px}
.badge.success,.calendar-event.success{background:#e8f8f1;color:#0d805a;border-color:#d2f0e3}
.badge.warning,.calendar-event.warning{background:#fff4e2;color:#ad6200;border-color:#f9e7c9}
.badge.danger,.calendar-event.danger{background:#ffedf1;color:#b92d45;border-color:#f8d5dc}
.badge.info,.calendar-event.info{background:#eaf2ff;color:#2c62b8;border-color:#d8e6ff}
.badge.muted,.calendar-event.muted{background:#eef2f6;color:#637083;border-color:#e2e7ed}
.badge.status-unconfirmed,.calendar-event.status-unconfirmed{background:#fff1dd;color:#c46a00;border-color:#ffd7a0}
.badge.status-confirmed,.calendar-event.status-confirmed{background:#e8f1ff;color:#1f5fbf;border-color:#cfe0ff}
.badge.status-completed,.calendar-event.status-completed{background:#e5f8ef;color:#087a51;border-color:#c9efdd}
.badge.status-cancelled,.calendar-event.status-cancelled{background:#ffeaee;color:#b4233c;border-color:#f6ccd5}

/* Filters and forms */
.filters{display:flex;gap:12px;align-items:end;flex-wrap:wrap;background:#f8fafc;border:1px solid #e9eef5;border-radius:14px;padding:14px;margin-bottom:18px}
.filters label,.inline-search{margin:0}
.filters .grow{flex:1;min-width:220px}
.inline-search{display:flex;gap:10px;flex:1;max-width:650px}
.inline-search input{flex:1}
.form-layout{max-width:1050px}
.form-grid{display:grid;gap:17px}
.form-grid.two{grid-template-columns:repeat(2,minmax(0,1fr))}
.form-grid.compact{gap:12px}
.time-slot-field{border:0;padding:0;margin:0;min-width:0}
.time-slot-field legend{font-size:11px;font-weight:800;color:var(--text);margin-bottom:8px}
.time-slot-grid{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:8px}
.time-slot-option{cursor:pointer}
.time-slot-option input{position:absolute;opacity:0;pointer-events:none}
.time-slot-option span{display:flex;align-items:center;justify-content:center;min-height:44px;padding:10px;border:1px solid var(--border);border-radius:10px;background:#fff;color:var(--text);font-weight:800;transition:.15s ease}
.time-slot-option span:hover{border-color:#a9c5f5;background:#f7faff}
.time-slot-option input:checked + span{background:#e8f1ff;border-color:var(--primary);color:var(--primary);box-shadow:0 0 0 2px rgba(41,98,255,.1)}
.span-2{grid-column:span 2}
.stack{display:flex;flex-direction:column;gap:15px}
label{display:flex;flex-direction:column;gap:7px;font-size:12px;font-weight:760;color:#34445b}
.field-label{display:block}
input,select,textarea{width:100%;border:1px solid var(--line-strong);border-radius:11px;padding:11px 12px;min-height:43px;background:#fff;color:var(--ink);outline:none;box-shadow:0 1px 2px rgba(15,35,65,.025);transition:border-color .16s ease,box-shadow .16s ease,background .16s ease}
input::placeholder,textarea::placeholder{color:#a1adbc}
input:hover,select:hover,textarea:hover{border-color:#c4d0df}
input:focus,select:focus,textarea:focus{border-color:#5a91ef;box-shadow:0 0 0 4px rgba(37,99,235,.1);background:#fff}
textarea{resize:vertical;min-height:96px}
label small{font-weight:500;color:var(--muted)}
.check{flex-direction:row;align-items:center;gap:9px;background:#f8fafc;border:1px solid var(--line);padding:11px 12px;border-radius:11px}
.check input{width:17px;height:17px;min-height:0;accent-color:var(--primary)}
.form-actions{display:flex;justify-content:flex-end;gap:10px;margin-top:22px;padding-top:20px;border-top:1px solid var(--line)}

/* Alerts and empty states */
.alert{padding:13px 15px;border-radius:12px;margin-bottom:18px;font-size:13px;border:1px solid;box-shadow:0 3px 10px rgba(15,35,65,.035)}
.alert.success{background:#ecfaf4;border-color:#cceedd;color:#0c704f}
.alert.danger{background:#fff0f3;border-color:#f2ccd4;color:#a92b41}
.alert.info{background:#eef5ff;border-color:#d4e4ff;color:#2458a6}
.empty{text-align:center;color:var(--muted);padding:45px 18px;background:linear-gradient(180deg,#fbfcfe,#f8fafc);border-radius:12px;font-size:13px}
.empty:before{content:"";display:block;width:42px;height:42px;border-radius:14px;background:#edf3fb;margin:0 auto 12px;box-shadow:inset 0 0 0 1px #e2eaf4}
.empty.small{padding:24px}

/* Detail pages */
.detail-head{display:flex;justify-content:space-between;align-items:center;gap:20px;background:linear-gradient(135deg,#fff 0%,#f8fbff 100%)}
.detail-head h2{font-size:25px}
.detail-head p{margin:5px 0 0;color:var(--muted);font-size:13px}
.detail-actions{display:flex;align-items:center;gap:10px;flex-wrap:wrap}
.detail-grid{display:grid;grid-template-columns:1.45fr 1fr;gap:22px}
.info-list{margin:16px 0 0}
.info-list div{display:grid;grid-template-columns:140px 1fr;padding:12px 0;border-bottom:1px solid var(--line)}
.info-list div:last-child{border-bottom:0}
.info-list dt{font-size:11px;color:var(--muted);font-weight:760;text-transform:uppercase;letter-spacing:.04em}
.info-list dd{margin:0;font-size:13px;color:#293a50}
.money-panel{background:linear-gradient(155deg,#ffffff,#f2f7ff);border-color:#dce8fb}
.money-line{display:flex;justify-content:space-between;padding:12px 0;border-bottom:1px solid #dce6f2;font-size:13px}
.money-line.total{font-size:18px;border-bottom:0;margin-bottom:10px;color:#19355c}
.timeline{margin-top:17px}
.timeline-item{display:grid;grid-template-columns:16px 1fr;gap:12px;position:relative;padding-bottom:19px}
.timeline-item>span{width:11px;height:11px;border-radius:50%;background:#fff;border:3px solid var(--primary);margin-top:3px;z-index:1}
.timeline-item:before{content:"";position:absolute;left:4.5px;top:14px;bottom:0;width:2px;background:#dce5f0}
.timeline-item:last-child:before{display:none}
.timeline-item strong,.timeline-item small{display:block}
.timeline-item strong{font-size:13px}
.timeline-item small{color:var(--muted);margin-top:3px;font-size:11px}
.timeline-item p{font-size:12px;margin:7px 0 0;color:#536178}
.split-grid{display:grid;grid-template-columns:minmax(290px,390px) 1fr;gap:22px}

/* Calendar */
.calendar-panel{padding:20px}
.calendar-head{display:flex;align-items:center;justify-content:space-between;margin-bottom:18px;gap:12px}
.calendar-head h2{margin:0;font-size:20px}
.calendar-grid{display:grid;grid-template-columns:repeat(7,minmax(120px,1fr))}
.calendar-labels{font-size:10px;font-weight:850;text-transform:uppercase;letter-spacing:.08em;color:var(--muted);text-align:center}
.calendar-labels div{padding:10px}
.calendar-day{min-height:138px;border-right:1px solid #e7edf4;border-bottom:1px solid #e7edf4;padding:9px;background:#fff;transition:background .15s ease}
.calendar-day:hover{background:#fbfdff}
.calendar-day:nth-child(7n+1){border-left:1px solid #e7edf4}
.calendar-day:nth-child(-n+7){border-top:1px solid #e7edf4}
.calendar-day.outside{background:#f8fafc;color:#adb7c4}
.calendar-day.today{box-shadow:inset 0 0 0 2px var(--primary);background:#f7faff;position:relative;z-index:1}
.day-number{font-size:11px;font-weight:850;margin-bottom:7px;width:25px;height:25px;border-radius:8px;display:grid;place-items:center}
.calendar-day.today .day-number{background:var(--primary);color:#fff}
.calendar-event{display:flex;flex-direction:column;border-radius:8px;padding:7px 8px;margin:5px 0;font-size:10px;line-height:1.3;border-left:3px solid currentColor;transition:transform .15s ease}
.calendar-event:hover{filter:brightness(.98);transform:translateX(1px)}
.calendar-event span{white-space:nowrap;overflow:hidden;text-overflow:ellipsis;font-weight:780}
.calendar-event small{opacity:.8;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;margin-top:2px}

/* Login */
.login-body{min-height:100vh;padding:0;background:#eef3fa}
.login-shell{min-height:100vh;display:grid;grid-template-columns:minmax(430px,1.12fr) minmax(440px,.88fr)}
.login-showcase{position:relative;overflow:hidden;display:flex;align-items:center;padding:72px;background:
  radial-gradient(circle at 15% 15%,rgba(112,159,255,.28),transparent 25%),
  radial-gradient(circle at 80% 80%,rgba(132,71,217,.2),transparent 28%),
  linear-gradient(145deg,#0e1a2f 0%,#152b51 56%,#173c75 100%);color:#fff}
.login-showcase:after{content:"";position:absolute;inset:0;background-image:linear-gradient(rgba(255,255,255,.025) 1px,transparent 1px),linear-gradient(90deg,rgba(255,255,255,.025) 1px,transparent 1px);background-size:40px 40px;mask-image:linear-gradient(to bottom,black,transparent 95%)}
.login-showcase-content{position:relative;z-index:3;max-width:620px}
.login-logo{display:flex;align-items:center;gap:12px;font-size:15px;font-weight:820;margin-bottom:90px}
.login-logo .brand-mark{width:42px;height:42px;border-radius:13px}
.login-logo .brand-mark .icon{width:21px;height:21px}
.login-kicker{display:inline-flex;padding:7px 10px;border-radius:999px;border:1px solid rgba(255,255,255,.13);background:rgba(255,255,255,.07);font-size:10px;text-transform:uppercase;letter-spacing:.15em;color:#acc7fb;font-weight:820}
.login-showcase h2{font-size:clamp(37px,4vw,59px);line-height:1.03;letter-spacing:-.055em;margin:22px 0 18px;max-width:680px}
.login-showcase p{font-size:17px;line-height:1.65;color:#b7c7df;max-width:540px;margin:0}
.login-features{display:flex;gap:10px;flex-wrap:wrap;margin-top:35px}
.login-features span{display:flex;align-items:center;gap:8px;padding:10px 12px;border-radius:11px;background:rgba(255,255,255,.065);border:1px solid rgba(255,255,255,.075);font-size:11px;color:#dce9ff}
.login-features .icon{width:15px;height:15px;color:#8bb4ff}
.login-orb{position:absolute;border-radius:50%;filter:blur(1px);opacity:.6}
.login-orb-one{width:220px;height:220px;right:-70px;top:12%;background:radial-gradient(circle,#4e8cff 0,rgba(78,140,255,0) 68%)}
.login-orb-two{width:300px;height:300px;left:18%;bottom:-160px;background:radial-gradient(circle,#8148d7 0,rgba(129,72,215,0) 70%)}
.login-card{display:flex;flex-direction:column;justify-content:center;width:min(470px,calc(100% - 56px));margin:auto;padding:40px 0;background:transparent}
.login-card-head{margin-bottom:25px}
.login-card h1{font-size:31px;letter-spacing:-.045em;margin:0 0 8px}
.login-card-head>p{margin:0;line-height:1.55;font-size:13px}
.mobile-login-logo{display:none}
.login-form{gap:17px}
.login-submit{margin-top:5px;min-height:46px}
.demo-box{margin-top:19px;background:rgba(255,255,255,.68);border:1px solid #dbe4ef;border-radius:13px;padding:12px;color:#64748b;font-size:11px;line-height:1.55;display:flex;align-items:center;gap:11px;box-shadow:var(--shadow-sm)}
.demo-box strong{color:#34445b;font-size:11px}
.demo-icon{width:33px;height:33px;border-radius:10px;background:#eaf2ff;color:var(--primary);display:grid;place-items:center}
.demo-icon .icon{width:16px;height:16px}

/* Responsive */
@media(max-width:1180px){
  .stats-grid{grid-template-columns:repeat(2,1fr)}
  .detail-grid{grid-template-columns:1fr}
  .split-grid{grid-template-columns:1fr}
  .calendar-panel{overflow:auto}
  .login-showcase{padding:52px}
}

@media(max-width:900px){
  .app-shell{grid-template-columns:1fr}
  .sidebar{position:fixed;left:-290px;width:272px;transition:left .22s ease;box-shadow:none}
  .sidebar.open{left:0;box-shadow:18px 0 60px rgba(5,16,34,.35)}
  .sidebar-backdrop{display:block;position:fixed;inset:0;background:rgba(7,16,30,.54);backdrop-filter:blur(2px);z-index:35;opacity:0;visibility:hidden;transition:.2s ease}
  .sidebar-backdrop.open{opacity:1;visibility:visible}
  .menu-button{display:flex}
  .topbar{padding:15px 20px;min-height:86px}
  .topbar-avatar{display:grid}
  .content{padding:22px 20px 55px}
  .login-shell{grid-template-columns:1fr}
  .login-showcase{display:none}
  .login-body{background:radial-gradient(circle at top left,#e3edff,#f4f7fb 46%,#edf2f8)}
  .login-card{width:min(440px,calc(100% - 40px));background:rgba(255,255,255,.86);border:1px solid rgba(214,224,236,.9);padding:34px;border-radius:24px;box-shadow:var(--shadow-lg);backdrop-filter:blur(16px)}
  .mobile-login-logo{display:grid;margin-bottom:24px}
}

@media(max-width:680px){
  .topbar{gap:11px;padding:13px 14px}
  .topbar-kicker,.topbar p{display:none}
  .topbar h1{font-size:20px}
  .topbar-actions .button{width:42px;padding:0;font-size:0;border-radius:12px}
  .topbar-actions .button .icon{width:19px;height:19px}
  .topbar-avatar{display:none}
  .content{padding:17px 13px 48px}
  .stats-grid{grid-template-columns:1fr;gap:12px}
  .stat-card{padding:18px}
  .panel{padding:16px;border-radius:15px}
  .panel-head{align-items:flex-start;gap:13px;flex-direction:column}
  .panel-head>.button{width:100%}
  .form-grid.two{grid-template-columns:1fr}
  .time-slot-grid{grid-template-columns:repeat(2,minmax(0,1fr))}
  .span-2{grid-column:auto}
  .detail-head{align-items:flex-start;gap:14px;flex-direction:column}
  .detail-actions{width:100%;align-items:stretch;flex-direction:column}
  .detail-actions .button{width:100%}
  .filters{align-items:stretch;padding:12px}
  .filters label,.filters .grow{width:100%}
  .inline-search{max-width:none;flex-direction:column}
  .form-actions{flex-direction:column-reverse}
  .form-actions .button{width:100%}
  .calendar-grid{min-width:850px}
  .calendar-head{align-items:flex-start;flex-wrap:wrap}
  .info-list div{grid-template-columns:1fr;gap:5px}
  .login-card{padding:26px;width:min(420px,calc(100% - 26px));border-radius:20px}
  .login-card h1{font-size:27px}
}

/* v1.3.0: cliente por teléfono, contacto directo y calendario semanal */
.lookup-status{display:block;margin-top:7px;font-size:11px;color:var(--muted);font-weight:650}
.lookup-status.searching{color:#6b7280}
.lookup-status.found{color:#087a51}
.lookup-status.new{color:#9a5a00}
.lookup-status.error{color:#b4233c}

.button.call{background:#eef5ff;color:#1e5ab6;border-color:#d4e4ff}
.button.call:hover{background:#e4efff;border-color:#c4d9ff}
.button.whatsapp{background:#e8f8ef;color:#087a51;border-color:#c9efdd}
.button.whatsapp:hover{background:#dcf5e8;border-color:#b6e8d2}

.calendar-toolbar{display:flex;align-items:center;justify-content:space-between;gap:12px;margin-bottom:14px}
.calendar-view-switch{display:inline-grid;grid-template-columns:1fr 1fr;gap:3px;padding:4px;border-radius:12px;background:#edf2f8;border:1px solid #e1e8f0}
.calendar-view-switch a{min-width:92px;padding:8px 14px;text-align:center;border-radius:9px;color:#65748a;font-size:12px;font-weight:800;transition:.16s ease}
.calendar-view-switch a:hover{color:#2459b8}
.calendar-view-switch a.active{background:#fff;color:#1f5fbf;box-shadow:0 3px 10px rgba(15,35,65,.09)}
.calendar-today-link{font-size:12px;font-weight:800;color:var(--primary)}
.calendar-day-head{display:flex;align-items:center;justify-content:space-between;gap:8px;margin-bottom:7px}
.calendar-day-head>span{font-size:9px;color:#8a97a8;font-weight:760;white-space:nowrap}
.calendar-day.today{box-shadow:inset 0 0 0 3px #2f73f1;background:#e8f1ff}
.calendar-day.today .calendar-day-head>span{color:#1e5ab6}
.calendar-day.today .calendar-event{box-shadow:0 5px 14px rgba(37,99,235,.13)}
.calendar-empty-day{margin-top:18px;padding:15px 8px;text-align:center;border:1px dashed #dce4ee;border-radius:10px;color:#9aa6b5;font-size:10px;background:rgba(255,255,255,.55)}
.week-view .calendar-day{min-height:420px;padding:12px}
.week-view .calendar-event{padding:10px;margin:7px 0;font-size:11px}
.week-view .calendar-event strong{font-size:12px;margin-bottom:2px}
.week-view .calendar-event small{white-space:normal;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical}
.month-view .calendar-event small:first-of-type{display:none}

@media(max-width:900px){
  .week-view .calendar-grid,.month-view .calendar-grid{min-width:920px}
  .calendar-toolbar{position:sticky;left:0;max-width:calc(100vw - 82px)}
}

@media(max-width:680px){
  .calendar-toolbar{align-items:stretch;flex-direction:column;max-width:calc(100vw - 58px)}
  .calendar-view-switch{width:100%}
  .calendar-view-switch a{min-width:0}
  .calendar-today-link{text-align:center;padding:7px}
  .detail-actions .badge{align-self:flex-start}
}


/* v1.4.2: estadísticas, ganancias y comisiones quincenales */
.report-hero{display:grid;grid-template-columns:minmax(220px,1fr) auto minmax(165px,.62fr) auto;align-items:center;gap:11px;padding:9px 14px;margin-bottom:10px}
.report-month-nav{display:grid;grid-template-columns:30px minmax(0,1fr) 30px;align-items:center;gap:7px}
.report-month-nav h2{margin:1px 0 0;color:#1f5fd1;font-size:18px;line-height:1.08;letter-spacing:-.025em}
.report-arrow{width:29px;height:29px;border-radius:11px;border:1px solid var(--line);display:grid;place-items:center;background:#fff;color:#53647c;font-weight:900;box-shadow:var(--shadow-sm)}
.report-arrow:hover{color:var(--primary);border-color:#cbdcff;background:#f6f9ff}
.report-period-switch{display:inline-grid;grid-template-columns:1fr 1fr;gap:3px;background:#eef2f7;padding:4px;border:1px solid #e0e6ef;border-radius:13px}
.report-period-switch a{padding:7px 12px;border-radius:9px;color:#56667a;font-size:11px;font-weight:850;text-align:center;min-width:90px}
.report-period-switch a.active{background:linear-gradient(135deg,#2f73f1,#1f58d8);color:#fff;box-shadow:0 7px 16px rgba(37,99,235,.2)}
.report-cycle-info{display:flex;align-items:center;gap:8px;padding-left:11px;border-left:1px dashed #ced8e6}
.report-cycle-icon{width:34px;height:34px;border-radius:50%;display:grid;place-items:center;color:#315b98;background:#eef4fd}
.report-cycle-icon .icon{width:16px;height:16px}
.report-cycle-info div,.report-access-note div{display:flex;flex-direction:column;min-width:0}
.report-cycle-info strong,.report-access-note strong{font-size:11px;color:#27384f}
.report-cycle-info small,.report-access-note small{font-size:9px;color:var(--muted);margin-top:2px;line-height:1.25}
.report-access-note{display:flex;align-items:center;gap:10px;border:1px solid #cfe0ff;background:#f4f8ff;border-radius:12px;padding:11px 13px;color:#2764c5}
.report-access-note.collaborator{border-color:#cbeadb;background:#f2fbf7;color:#09825a}
.report-access-note>.icon{width:19px;height:19px}
.report-kpis{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:14px;margin-bottom:18px}
.report-kpis.three{grid-template-columns:repeat(3,minmax(0,1fr))}

.report-kpi{--kpi:#2563eb;--kpi-soft:#eaf2ff;position:relative;display:flex;align-items:center;gap:14px;background:#fff;border:1px solid var(--line);border-radius:17px;padding:18px 19px;box-shadow:var(--shadow-sm);overflow:hidden}
.report-kpi:before{content:"";position:absolute;left:0;top:0;bottom:0;width:4px;background:var(--kpi)}
.report-kpi-icon{width:48px;height:48px;border-radius:50%;display:grid;place-items:center;color:var(--kpi);background:var(--kpi-soft);flex:0 0 auto}
.report-kpi-icon .icon{width:23px;height:23px}
.report-kpi div{display:flex;flex-direction:column;min-width:0}
.report-kpi small{font-size:11px;color:#68778b;font-weight:730}
.report-kpi strong{font-size:25px;color:var(--kpi);letter-spacing:-.035em;margin-top:5px;white-space:nowrap}
.report-kpi.green{--kpi:#15965f;--kpi-soft:#e6f7ef}
.report-kpi.orange{--kpi:#ea6a0a;--kpi-soft:#fff0e2}
.report-kpi.violet{--kpi:#315fd2;--kpi-soft:#eaf0ff}
.report-analytics-grid{display:grid;grid-template-columns:minmax(0,1fr) minmax(430px,.95fr);gap:22px}
.report-chart-panel,.report-collaborators-panel{min-width:0}
.report-chart{height:280px;display:grid;grid-template-columns:repeat(var(--chart-columns),minmax(16px,1fr));align-items:end;gap:7px;padding:32px 8px 4px;border-bottom:1px solid #dfe7f1;background:repeating-linear-gradient(to top,transparent 0,transparent 54px,#edf1f6 55px)}
.report-bar-column{height:100%;display:grid;grid-template-rows:20px minmax(0,1fr) 23px;align-items:end;text-align:center;min-width:0}
.report-bar-value{font-size:9px;color:#8794a6;opacity:0;transition:.15s ease}
.report-bar-column:hover .report-bar-value{opacity:1}
.report-bar{display:block;width:min(24px,72%);margin:0 auto;border-radius:6px 6px 2px 2px;background:linear-gradient(180deg,#4485f4,#2260df);min-height:3px;box-shadow:0 5px 11px rgba(37,99,235,.13);transition:filter .15s ease,transform .15s ease}
.report-bar-column:hover .report-bar{filter:brightness(1.08);transform:scaleX(1.08)}
.report-bar-column small{font-size:9px;color:#718096;padding-top:7px}
.report-summary-table{min-width:600px}
.report-summary-table tfoot td{background:#eef4ff;color:#1b2f4c;font-weight:850;border-top:1px solid #d8e5f8}
.report-date-filter{display:flex;align-items:end;gap:13px;flex-wrap:wrap;margin-bottom:18px;padding:14px;border:1px solid var(--line);border-radius:13px;background:#f8fafc}
.report-date-filter label{min-width:190px}
.report-detail-panel .table-wrap{margin-top:4px}
.report-limit-note{font-size:11px;color:#9a5a00;background:#fff8e8;border:1px solid #f4dfad;padding:10px 12px;border-radius:10px;margin:12px 0 0}

@media(max-width:1280px){
  .report-hero{grid-template-columns:1fr auto 1fr}.report-scope-inline{grid-column:1/-1;flex-direction:row;align-items:center;justify-content:space-between;min-width:0}
  .report-analytics-grid{grid-template-columns:1fr}
}
@media(max-width:1050px){
  .report-kpis{grid-template-columns:repeat(2,1fr)}
  .report-hero{grid-template-columns:1fr 1fr}.report-cycle-info{border-left:0;padding-left:0}.report-scope-inline{grid-column:1/-1}
}
@media(max-width:680px){
  .report-hero{grid-template-columns:1fr;padding:10px}.report-month-nav{grid-template-columns:30px minmax(0,1fr) 30px}.report-month-nav h2{font-size:17px;text-align:center}.report-month-nav .eyebrow{text-align:center}
  .report-period-switch{width:100%}.report-period-switch a{min-width:0}.report-scope-inline{grid-column:auto;flex-direction:column;align-items:stretch}
  .report-kpis{grid-template-columns:1fr;gap:12px}.report-kpi{padding:16px}.report-kpi strong{font-size:23px}
  .report-chart{min-width:620px}.report-chart-panel{overflow:auto}.report-date-filter{align-items:stretch}.report-date-filter label,.report-date-filter .button{width:100%;min-width:0}
}


/* v1.5.1: identidad fija Agenda Tu Lavado y aceptación de servicios */
.brand-mark.has-logo{background:transparent;padding:0;border:0;border-radius:0;box-shadow:none;overflow:visible}
.brand-mark.has-logo img{width:100%;height:100%;display:block;object-fit:contain;border-radius:0;filter:drop-shadow(0 7px 13px rgba(0,0,0,.24))}
.brand-mark.small.has-logo{width:50px;height:50px;flex:0 0 50px}
.login-logo .brand-mark.has-logo{width:60px;height:60px;border-radius:0;box-shadow:none}
.mobile-login-logo.has-logo{width:65px;height:65px}
.brand-copy strong{font-size:15px}
.login-logo{gap:15px;font-size:17px}
.nav-link-label{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.nav-count-badge{margin-left:auto;min-width:22px;height:22px;padding:0 6px;border-radius:999px;display:inline-grid;place-items:center;background:#e3364f;color:#fff;border:2px solid #17243a;font-size:10px;font-weight:900;line-height:1;box-shadow:0 4px 12px rgba(220,63,88,.34)}
.nav-link.active .nav-count-badge{border-color:#233d69}
.pending-acceptance-banner{margin:16px 32px 0;display:grid;grid-template-columns:42px minmax(0,1fr) auto;align-items:center;gap:13px;padding:13px 16px;border:1px solid #f0c36c;border-radius:14px;background:linear-gradient(100deg,#fff7df,#fffaf0);color:#70430a;box-shadow:0 8px 22px rgba(146,91,10,.09);position:relative;z-index:20}
.pending-acceptance-banner:hover{border-color:#e6ad43;background:linear-gradient(100deg,#fff3d2,#fff9e9)}
.pending-banner-icon{width:38px;height:38px;border-radius:12px;display:grid;place-items:center;background:#f59e0b;color:#fff}
.pending-banner-icon .icon{width:20px;height:20px}
.pending-acceptance-banner>span:nth-child(2){display:flex;flex-direction:column;gap:2px}
.pending-acceptance-banner strong{font-size:13px;color:#75470b}
.pending-acceptance-banner small{font-size:11px;color:#9a681d}
.pending-banner-action{font-size:12px;font-weight:850;color:#925a08;white-space:nowrap}
.acceptance-modal-backdrop{display:none;position:fixed;inset:0;z-index:100;background:rgba(6,16,31,.68);backdrop-filter:blur(6px);padding:24px;overflow:auto;align-items:flex-start;justify-content:center}
.acceptance-modal-backdrop.open{display:flex}
.acceptance-modal{width:min(780px,100%);margin:auto;background:#f7f9fc;border:1px solid rgba(255,255,255,.5);border-radius:24px;box-shadow:0 32px 100px rgba(2,12,28,.34);overflow:hidden}
.acceptance-modal-head{display:flex;gap:15px;align-items:flex-start;background:#fff;padding:23px 24px;border-bottom:1px solid var(--line)}
.acceptance-modal-head h2{margin:1px 0 5px;font-size:22px;letter-spacing:-.035em}
.acceptance-modal-head p{margin:0;color:var(--muted);font-size:12px}
.acceptance-modal-icon{width:49px;height:49px;flex:0 0 49px;border-radius:15px;display:grid;place-items:center;background:#eaf2ff;color:#2563eb}
.acceptance-modal-icon .icon{width:24px;height:24px}
.acceptance-list{padding:18px;display:grid;gap:13px;max-height:58vh;overflow:auto}
.acceptance-card{background:#fff;border:1px solid var(--line);border-radius:16px;padding:17px;box-shadow:var(--shadow-sm)}
.acceptance-card-top{display:flex;align-items:center;justify-content:space-between;gap:12px}
.acceptance-card-top>strong{font-size:11px;color:var(--primary);text-transform:uppercase;letter-spacing:.08em}
.acceptance-card h3{margin:13px 0 12px;font-size:16px;line-height:1.35}
.acceptance-card dl{display:grid;grid-template-columns:1fr 1fr;gap:10px;margin:0}
.acceptance-card dl div{background:#f8fafc;border:1px solid #edf1f6;border-radius:10px;padding:9px 10px;min-width:0}
.acceptance-card dt{font-size:9px;text-transform:uppercase;letter-spacing:.08em;color:#8a97a8;font-weight:850;margin-bottom:4px}
.acceptance-card dd{margin:0;font-size:12px;color:#314157;overflow-wrap:anywhere}
.acceptance-card-actions{display:flex;align-items:center;justify-content:flex-end;gap:10px;margin-top:14px}
.acceptance-card-actions form{margin:0}
.acceptance-modal-footer{display:flex;align-items:center;justify-content:space-between;gap:14px;padding:14px 20px;background:#fff;border-top:1px solid var(--line);font-size:11px;color:var(--muted)}
.settings-grid{display:grid;grid-template-columns:minmax(0,1.1fr) minmax(340px,.9fr);gap:22px}
.settings-head-icon{width:48px;height:48px;border-radius:15px;display:grid;place-items:center;background:#eaf2ff;color:#2563eb}
.settings-head-icon.success{background:#e5f8f1;color:#0f9f6e}
.settings-head-icon .icon{width:23px;height:23px}
.logo-settings-preview{display:flex;align-items:center;gap:15px;padding:18px;border:1px dashed #cbd6e5;border-radius:15px;background:#f8fafc;margin-bottom:18px}
.logo-settings-preview .settings-preview-mark{width:90px;height:90px;border-radius:0;flex:0 0 90px}
.logo-settings-preview>div{display:flex;flex-direction:column;gap:5px}
.logo-settings-preview strong{font-size:14px}
.logo-settings-preview small{font-size:11px;color:var(--muted)}
.fixed-brand-preview{background:linear-gradient(135deg,#f7faff,#eef4ff);border-style:solid}
.settings-static-note{display:flex;align-items:center;gap:12px;padding:13px 14px;border-radius:13px;background:#f8fafc;border:1px solid var(--line);color:#475569}
.settings-static-note>.icon{width:20px;height:20px;color:#2563eb;flex:0 0 20px}
.settings-static-note>span{display:flex;flex-direction:column;gap:3px}
.settings-static-note strong{font-size:12px}
.settings-static-note small{font-size:10px;color:var(--muted);line-height:1.45}
.danger-text{color:var(--danger)!important}
.settings-rules{display:grid;gap:12px}
.settings-rules article{display:grid;grid-template-columns:36px minmax(0,1fr);gap:12px;align-items:flex-start;padding:14px;border:1px solid var(--line);border-radius:13px;background:#fbfcfe}
.settings-rules article>span{width:32px;height:32px;border-radius:10px;display:grid;place-items:center;background:#eaf2ff;color:#2563eb;font-size:12px;font-weight:900}
.settings-rules strong{font-size:13px}
.settings-rules p{margin:4px 0 0;font-size:11px;color:var(--muted);line-height:1.5}

@media(max-width:1000px){
  .settings-grid{grid-template-columns:1fr}
}
@media(max-width:760px){
  .pending-acceptance-banner{margin:10px 13px 0;grid-template-columns:38px minmax(0,1fr)}
  .pending-banner-action{display:none}
  .acceptance-modal-backdrop{padding:10px}
  .acceptance-modal{border-radius:18px}
  .acceptance-modal-head{padding:18px}
  .acceptance-list{padding:12px;max-height:62vh}
  .acceptance-card dl{grid-template-columns:1fr}
  .acceptance-card-actions{align-items:stretch;flex-direction:column}
  .acceptance-card-actions .button,.acceptance-card-actions form,.acceptance-card-actions form button{width:100%}
  .acceptance-modal-footer{align-items:stretch;flex-direction:column}
  .acceptance-modal-footer .button{width:100%}
}

/* v1.6.0: asignación obligatoria, estados visuales y Evolution API */
.automatic-status-note{display:flex;align-items:center;gap:11px;min-height:72px;padding:12px 14px;border:1px solid #ffd7a0;border-radius:11px;background:#fff7ea;color:#9b5700}
.automatic-status-note>.icon{width:21px;height:21px;flex:0 0 auto}
.automatic-status-note span{display:flex;flex-direction:column;gap:3px}
.automatic-status-note strong{font-size:12px;color:#955200}
.automatic-status-note small{font-size:11px;color:#9f6a27;line-height:1.45}

.status-button-selector{border:0;padding:0;margin:0;display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px}
.status-button-selector legend{grid-column:1/-1;font-size:12px;font-weight:800;color:#34445b;margin-bottom:2px}
.status-button-option{position:relative;cursor:pointer;display:block}
.status-button-option input{position:absolute;opacity:0;pointer-events:none}
.status-button-option span{display:flex;align-items:center;justify-content:center;min-height:46px;padding:10px 12px;border:1px solid transparent;border-radius:11px;font-size:11px;font-weight:850;text-align:center;transition:transform .15s ease,box-shadow .15s ease,filter .15s ease}
.status-button-option span:before{content:"";width:7px;height:7px;border-radius:50%;margin-right:7px;background:currentColor}
.status-button-option:hover span{transform:translateY(-1px);filter:brightness(.98)}
.status-button-option input:focus-visible+span{outline:3px solid rgba(37,99,235,.2);outline-offset:2px}
.status-button-option input:checked+span{box-shadow:0 0 0 3px rgba(37,99,235,.13),0 8px 18px rgba(15,35,65,.08);transform:translateY(-1px)}
.status-button-option.status-unconfirmed span{background:#fff1dd;color:#b96000;border-color:#ffd19a}
.status-button-option.status-confirmed span{background:#e8f1ff;color:#1f5fbf;border-color:#c8dcff}
.status-button-option.status-completed span{background:#e5f8ef;color:#087a51;border-color:#bfe8d5}
.status-button-option.status-cancelled span{background:#ffeaee;color:#b4233c;border-color:#f2c3cc}
.status-button-option.status-unconfirmed input:checked+span{border-color:#d67800}
.status-button-option.status-confirmed input:checked+span{border-color:#2563eb}
.status-button-option.status-completed input:checked+span{border-color:#0a8b5c}
.status-button-option.status-cancelled input:checked+span{border-color:#c62c46}

.settings-whatsapp-panel{max-width:980px}
.settings-head-icon.whatsapp-icon{background:#e5f8ef;color:#087a51}
.whatsapp-settings-form{margin-top:8px}
.reminder-toggle{align-items:flex-start;padding:14px 15px;background:#f5f9ff;border-color:#dce8f8}
.reminder-toggle span{display:flex;flex-direction:column;gap:3px}
.reminder-toggle strong{font-size:13px;color:#21364f}
.reminder-toggle small{font-size:11px;color:#6a7b91}
.saved-secret{color:#0b7c58;font-weight:700}
.inline-clear{display:flex;flex-direction:row;align-items:center;gap:7px;margin-top:4px;font-size:11px;font-weight:650;color:#a02a40;background:transparent;border:0;padding:0}
.inline-clear input{width:15px;height:15px;min-height:0}
.cron-info-box{display:flex;align-items:flex-start;gap:11px;padding:13px 14px;border:1px solid #dce8f8;border-radius:12px;background:#f5f9ff;color:#28598d}
.cron-info-box>.icon{width:20px;height:20px;flex:0 0 auto;margin-top:1px}
.cron-info-box div{display:flex;flex-direction:column;gap:3px}
.cron-info-box strong{font-size:12px;color:#244d78}
.cron-info-box small{font-size:11px;line-height:1.45;color:#607793}
.cron-info-box code{font-size:10px;background:#e6effb;padding:2px 5px;border-radius:5px;color:#244d78}
.settings-actions{justify-content:space-between}

@media (max-width:720px){
  .status-button-selector{grid-template-columns:1fr}
  .automatic-status-note{grid-column:1/-1}
  .settings-actions{flex-direction:column-reverse;align-items:stretch}
  .settings-actions .button{width:100%}
}

/* v1.7.0: técnicos, origen de servicios, estadísticas por origen y notificaciones */
.origin-badge{display:inline-flex;align-items:center;gap:6px;padding:6px 9px;border-radius:999px;font-size:10px;font-weight:850;border:1px solid transparent;white-space:nowrap}
.origin-badge.admin{background:#eaf2ff;color:#1f5fbf;border-color:#c8dcff}
.origin-badge.collaborator{background:#f0eaff;color:#6d46c7;border-color:#d8c8ff}
.status-completed-action{background:#0f9f6e;color:#fff;border-color:#0f9f6e}
.status-completed-action:hover{background:#0b875d;border-color:#0b875d}
.status-readonly-box{display:flex;flex-direction:column;gap:12px;padding:16px;border:1px solid var(--line);border-radius:13px;background:#f8fafc}
.status-readonly-box p{margin:0;color:var(--muted);font-size:12px;line-height:1.5}
.technician-placeholder{max-width:720px;padding:30px}
.technician-placeholder h2{margin:7px 0 9px;font-size:24px}

.statistics-origin-filter{display:flex;align-items:center;justify-content:space-between;gap:18px;margin-bottom:18px}
.statistics-origin-filter h3{margin:4px 0 4px;font-size:17px}
.statistics-origin-filter p{margin:0;color:var(--muted);font-size:11px}
.origin-switch{display:flex;gap:4px;padding:4px;background:#eef2f7;border:1px solid #dde5ef;border-radius:12px}
.origin-switch a{padding:9px 12px;border-radius:9px;color:#617189;font-size:11px;font-weight:800;white-space:nowrap}
.origin-switch a.active{background:#fff;color:#255fd2;box-shadow:0 3px 10px rgba(24,46,78,.08)}

.settings-layout{display:grid;grid-template-columns:220px minmax(0,1fr);gap:20px;align-items:start}
.settings-subnav{position:sticky;top:98px;padding:18px}
.settings-subnav h3{margin:5px 0 14px}
.settings-subnav-link{display:flex;align-items:center;gap:9px;padding:11px 12px;border-radius:10px;font-size:12px;font-weight:800;color:#53657c}
.settings-subnav-link .icon{width:17px;height:17px}
.settings-subnav-link.active{background:#eaf2ff;color:#255fd2}
.settings-whatsapp-panel{max-width:none}
.settings-section-title{padding-top:3px}
.settings-section-title h3{margin:0 0 4px;font-size:15px}
.settings-section-title p{margin:0;color:var(--muted);font-size:11px}
.notification-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:15px;margin-top:5px}
.notification-card{border:1px solid var(--line);border-radius:15px;padding:16px;background:#fbfcfe;display:flex;flex-direction:column;gap:12px}
.notification-card-head{display:flex;justify-content:space-between;align-items:flex-start;gap:15px}
.notification-card-head>div{display:grid;grid-template-columns:30px minmax(0,1fr);column-gap:10px;align-items:center;flex:1}
.notification-card-head h3{margin:0;font-size:14px}
.notification-card-head p{grid-column:2;margin:3px 0 0;color:var(--muted);font-size:10px;line-height:1.45}
.notification-number{grid-row:1/3;width:28px;height:28px;border-radius:9px;background:#eaf2ff;color:#255fd2;display:grid;place-items:center;font-size:11px;font-weight:900}
.notification-card textarea{min-height:165px;resize:vertical;font-size:12px;line-height:1.55}
.toggle-switch{position:relative;display:inline-flex;flex:0 0 auto;cursor:pointer;margin-top:2px}
.toggle-switch input{position:absolute;opacity:0;pointer-events:none}
.toggle-switch span{width:44px;height:24px;border-radius:999px;background:#cbd5e1;position:relative;transition:.2s}
.toggle-switch span:after{content:"";position:absolute;top:3px;left:3px;width:18px;height:18px;background:#fff;border-radius:50%;box-shadow:0 1px 4px rgba(0,0,0,.18);transition:.2s}
.toggle-switch input:checked+span{background:#2563eb}
.toggle-switch input:checked+span:after{transform:translateX(20px)}
.toggle-switch input:focus-visible+span{outline:3px solid rgba(37,99,235,.2);outline-offset:2px}
.notification-vars{margin:0;padding:10px 12px;border-radius:10px;background:#f8fafc;color:#617189;font-size:10px;border:1px solid var(--line)}
.notification-test-row{display:flex;align-items:flex-end;justify-content:space-between;gap:14px;padding:14px;border:1px solid var(--line);border-radius:12px;background:#fff}
.notification-test-row label{min-width:260px}

@media(max-width:1000px){
  .settings-layout{grid-template-columns:1fr}
  .settings-subnav{position:static;display:flex;align-items:center;gap:12px}
  .settings-subnav .eyebrow,.settings-subnav h3{display:none}
  .notification-grid{grid-template-columns:1fr}
  .statistics-origin-filter{align-items:flex-start;flex-direction:column}
}
@media(max-width:720px){
  .origin-switch{width:100%;display:grid;grid-template-columns:1fr 1fr}
  .origin-switch a{text-align:center;white-space:normal}
  .notification-test-row{align-items:stretch;flex-direction:column}
  .notification-test-row label{min-width:0}
  .notification-test-row .button{width:100%}
}

/* v1.9.0: WhatsApp CRM por usuario + IA OpenAI/Gemini */
.crm-page{display:flex;flex-direction:column;gap:14px;min-width:0}
.crm-toolbar{display:flex;align-items:center;justify-content:space-between;gap:18px;padding:18px 20px}
.crm-toolbar h2{margin:3px 0 3px;font-size:21px}
.crm-toolbar p{margin:0;color:var(--muted);font-size:11px}
.crm-connection-pill{display:inline-flex;align-items:center;gap:8px;padding:9px 12px;border-radius:999px;background:#f1f5f9;color:#64748b;border:1px solid #e2e8f0;font-size:11px;white-space:nowrap}
.crm-connection-pill>span{width:8px;height:8px;border-radius:50%;background:#94a3b8;box-shadow:0 0 0 4px rgba(148,163,184,.12)}
.crm-connection-pill.connected{background:#e8f8ef;color:#087a51;border-color:#c9ead8}
.crm-connection-pill.connected>span{background:#16a36a;box-shadow:0 0 0 4px rgba(22,163,106,.12)}
.crm-connection-pill.disconnected{background:#fff5e8;color:#9a5a00;border-color:#f5d7a7}
.crm-connection-pill.disconnected>span{background:#ef9b21;box-shadow:0 0 0 4px rgba(239,155,33,.12)}

.crm-layout{display:grid;grid-template-columns:minmax(245px,285px) minmax(390px,1fr) minmax(260px,310px);gap:14px;min-height:680px;height:calc(100vh - 205px);min-width:0}
.crm-layout>.panel{margin:0;padding:0;overflow:hidden;min-width:0}
.crm-conversations,.crm-chat-panel,.crm-context{display:flex;flex-direction:column;min-height:0}
.crm-pane-head,.crm-chat-head{min-height:65px;padding:14px 15px;border-bottom:1px solid var(--line);display:flex;align-items:center;gap:10px;background:#fff}
.crm-pane-head{justify-content:space-between}
.crm-pane-head>div{display:flex;flex-direction:column;gap:2px}
.crm-pane-head strong{font-size:13px;color:#1f3045}
.crm-pane-head small{font-size:10px;color:var(--muted)}
.crm-icon-button{width:34px;height:34px;display:grid;place-items:center;border:1px solid var(--line);border-radius:9px;background:#fff;color:#58708e;font-size:17px;cursor:pointer;transition:.15s}
.crm-icon-button:hover{background:#f5f8fc;color:#255fd2;border-color:#cbdaf0}
.crm-search{margin:12px 12px 8px;display:flex;align-items:center;gap:7px;border:1px solid var(--line);border-radius:10px;padding:0 9px;background:#f8fafc}
.crm-search span{font-size:18px;color:#93a2b5}
.crm-search input{border:0!important;background:transparent!important;box-shadow:none!important;min-height:38px!important;padding:8px 2px!important;font-size:11px!important;width:100%}
.crm-tabs{display:flex;gap:5px;padding:0 12px 10px;border-bottom:1px solid var(--line)}
.crm-tabs button{border:0;background:transparent;padding:7px 9px;border-radius:8px;font-size:10px;font-weight:800;color:#6b7b90;cursor:pointer}
.crm-tabs button.active,.crm-tabs button:hover{background:#e9f7ef;color:#0b8057}
.crm-chat-list{overflow:auto;flex:1;min-height:0;background:#fff}
.crm-chat-row{width:100%;border:0;border-bottom:1px solid #eef2f6;background:#fff;padding:11px 12px;display:grid;grid-template-columns:38px minmax(0,1fr) auto;gap:10px;align-items:center;text-align:left;cursor:pointer;transition:.12s}
.crm-chat-row:hover{background:#f7fbf9}
.crm-chat-row.active{background:#eaf9f1;box-shadow:inset 3px 0 #16a36a}
.crm-list-avatar,.crm-chat-avatar{display:grid;place-items:center;border-radius:50%;background:linear-gradient(145deg,#ddf4e8,#c5ead7);color:#087a51;font-weight:900;text-transform:uppercase}
.crm-list-avatar{width:38px;height:38px;font-size:13px}
.crm-row-copy{min-width:0;display:flex;flex-direction:column;gap:3px}
.crm-row-copy strong{font-size:11px;color:#21334a;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.crm-row-copy small{font-size:9.5px;color:#6e7f94;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.crm-row-meta{align-self:stretch;display:flex;flex-direction:column;align-items:flex-end;justify-content:center;gap:5px}
.crm-row-meta time{font-size:8.5px;color:#8a99aa;white-space:nowrap}
.crm-row-meta b{min-width:18px;height:18px;padding:0 5px;border-radius:999px;background:#12a66d;color:#fff;display:grid;place-items:center;font-size:8px}
.crm-empty-list,.crm-loading{padding:20px;text-align:center;color:#8391a4;font-size:10.5px;line-height:1.5}

.crm-chat-panel{position:relative;background:#f2eee8!important}
.crm-chat-head{z-index:3;background:#fff}
.crm-chat-avatar{width:38px;height:38px;font-size:13px;flex:0 0 auto}
.crm-chat-head>div:nth-child(2){display:flex;flex-direction:column;gap:2px;min-width:0}
.crm-chat-head strong{font-size:12px;color:#1f3045;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.crm-chat-head small{font-size:9.5px;color:#76879a;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.crm-chat-head-actions{margin-left:auto!important}
.crm-messages{flex:1;min-height:0;overflow:auto;padding:18px 17px;background-color:#f1ede7;background-image:radial-gradient(rgba(32,73,62,.05) 1px,transparent 1px);background-size:18px 18px}
.crm-empty-chat{height:100%;min-height:200px;display:flex;align-items:center;justify-content:center;flex-direction:column;gap:5px;color:#8793a1;text-align:center;font-size:10px}
.crm-empty-chat strong{font-size:13px;color:#5d6d7e}
.crm-bubble-wrap{display:flex;margin-bottom:8px}
.crm-bubble-wrap.from-me{justify-content:flex-end}
.crm-bubble-wrap.from-client{justify-content:flex-start}
.crm-bubble{max-width:78%;padding:8px 10px 6px;border-radius:10px;background:#fff;box-shadow:0 1px 2px rgba(30,41,59,.08);position:relative}
.crm-bubble-wrap.from-me .crm-bubble{background:#dff7d9;border-top-right-radius:3px}
.crm-bubble-wrap.from-client .crm-bubble{border-top-left-radius:3px}
.crm-bubble p{margin:0;color:#233245;font-size:10.5px;line-height:1.5;white-space:normal;overflow-wrap:anywhere}
.crm-bubble time{display:block;text-align:right;margin-top:3px;font-size:8px;color:#8694a3}
.crm-composer{padding:10px 12px;border-top:1px solid #e1ded9;background:#fff;display:grid;grid-template-columns:minmax(0,1fr) auto;gap:8px;align-items:end}
.crm-composer textarea{min-height:39px;max-height:110px;resize:vertical;border-radius:11px;font-size:10.5px;padding:10px 11px}
.crm-composer .button{min-height:39px}

.crm-connection-screen{position:absolute;inset:65px 0 0;z-index:2;background:rgba(248,250,252,.97);display:flex;align-items:center;justify-content:center;padding:24px;overflow:auto}
.crm-connection-screen.hidden{display:none}
.crm-connect-card{width:min(480px,100%);text-align:center;display:flex;flex-direction:column;align-items:center;gap:11px;padding:28px 24px;border:1px solid var(--line);border-radius:18px;background:#fff;box-shadow:0 16px 50px rgba(24,46,78,.10)}
.crm-big-whatsapp{width:64px;height:64px;border-radius:19px;background:#e3f8ed;color:#0b9b67;display:grid;place-items:center;font-size:34px;font-weight:900}
.crm-connect-card h3{margin:3px 0 0;font-size:19px}
.crm-connect-card p{margin:0;max-width:390px;color:var(--muted);font-size:11px;line-height:1.55}
.crm-connect-actions{display:flex;align-items:center;justify-content:center;gap:8px;flex-wrap:wrap;width:100%}
.crm-qr-box{display:flex;flex-direction:column;align-items:center;gap:9px;width:100%;margin-top:4px}
.crm-qr-box>strong{font-size:11px;color:#334a64}
.crm-qr-box img{width:220px;max-width:85%;aspect-ratio:1;object-fit:contain;background:#fff;border:1px solid var(--line);border-radius:12px;padding:9px}
.crm-qr-box small{font-size:9.5px;color:var(--muted)}
.crm-pair-code{padding:9px 13px;border-radius:9px;background:#f3f7fb;border:1px solid var(--line);font-size:10px;color:#5d6d7e;letter-spacing:.02em}
.crm-pair-code b{font-size:14px;color:#1f3045;letter-spacing:.08em}

.crm-context{overflow:auto!important;background:#fff}
.crm-context-section{padding:16px;border-bottom:1px solid var(--line)}
.crm-context-section:last-child{border-bottom:0}
.crm-client-card{margin-top:10px;display:flex;flex-direction:column;gap:5px;padding:13px;border:1px solid var(--line);border-radius:12px;background:#fbfcfe}
.crm-client-card>strong{font-size:13px;color:#1f3045}
.crm-client-card>small{font-size:10px;color:#4e6580;font-weight:750}
.crm-client-card>span{font-size:10px;color:#7a899b;line-height:1.45}
.crm-mini-history{display:flex;flex-direction:column;gap:5px;border-top:1px solid var(--line);padding-top:9px;margin-top:5px}
.crm-mini-history b{font-size:9px;color:#54677e;text-transform:uppercase;letter-spacing:.06em}
.crm-mini-history a{font-size:9.5px;padding:5px 6px;border-radius:7px;color:#315f9b;background:#f3f7fc;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.crm-ai-card p{font-size:10px;color:var(--muted);line-height:1.5;margin:7px 0 11px}
.crm-ai-title{display:flex;justify-content:space-between;align-items:flex-start;gap:8px}
.crm-ai-title h3{font-size:14px;margin:3px 0 0}
.crm-ai-actions{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:8px;margin-top:10px}
.crm-ai-actions .button{width:100%;min-width:0;padding-left:9px;padding-right:9px}
.crm-ai-provider{padding:5px 7px;border-radius:7px;background:#f0eaff;color:#6b46c1;font-size:8px;font-weight:900;letter-spacing:.04em}
.crm-ai-warning{display:block;margin-top:9px;padding:9px 10px;border-radius:9px;border:1px solid #f0d19c;background:#fff7e9;color:#9b630f;font-size:9.5px;font-weight:700;line-height:1.4}
.crm-extraction{margin-top:11px}
.crm-extraction-empty{padding:15px 10px;text-align:center;border:1px dashed #d7e0ea;border-radius:10px;color:#8795a5;font-size:9.5px;background:#fbfcfd}
.crm-ai-summary{padding:10px 11px;background:#f7f4ff;border:1px solid #e4dcfb;color:#5d4c89;border-radius:10px;font-size:9.5px;line-height:1.5;margin-bottom:9px}
.crm-extracted-fields{border:1px solid var(--line);border-radius:10px;overflow:hidden;margin-bottom:10px}
.crm-extracted-fields>div{display:grid;grid-template-columns:65px minmax(0,1fr) 34px;gap:6px;align-items:center;padding:7px 8px;border-bottom:1px solid #edf1f5;background:#fff}
.crm-extracted-fields>div:last-child{border-bottom:0}
.crm-extracted-fields span{font-size:8.8px;color:#7b8a9c}
.crm-extracted-fields strong{font-size:9.3px;color:#273a52;overflow-wrap:anywhere}
.crm-extracted-fields em{font-style:normal;text-align:right;font-size:8.5px;font-weight:850;color:#0f9a68}
.crm-ai-foot{display:block;margin-top:8px;text-align:center;color:#8a98a8;font-size:8px;line-height:1.4}
.button.wide{width:100%;justify-content:center}

.settings-ai-panel{max-width:none}
.settings-head-icon{width:42px;height:42px;display:grid;place-items:center;border-radius:12px;background:#f0eaff;color:#6d46c7;flex:0 0 auto}
.settings-head-icon .icon{width:20px;height:20px}
.ai-privacy-box{display:flex;align-items:flex-start;gap:11px;padding:13px 14px;border:1px solid #dcd5f4;border-radius:12px;background:#f8f6ff;color:#654e9a}
.ai-privacy-box>.icon{width:20px;height:20px;flex:0 0 auto;margin-top:1px}
.ai-privacy-box div{display:flex;flex-direction:column;gap:3px}
.ai-privacy-box strong{font-size:11px;color:#5a438f}
.ai-privacy-box small{font-size:10px;line-height:1.45;color:#76689b}
.crm-notification-route-note{display:flex;align-items:flex-start;gap:11px;padding:13px 14px;border:1px solid #cce8d9;border-radius:12px;background:#effaf4;color:#18704f}
.crm-notification-route-note>.icon{width:20px;height:20px;flex:0 0 auto;margin-top:1px}
.crm-notification-route-note div{display:flex;flex-direction:column;gap:3px}
.crm-notification-route-note strong{font-size:11px;color:#146647}
.crm-notification-route-note small{font-size:10px;line-height:1.5;color:#547567}

@media(max-width:1200px){
  .crm-layout{grid-template-columns:250px minmax(360px,1fr);height:auto;min-height:720px}
  .crm-context{grid-column:1/-1;display:grid;grid-template-columns:1fr 1fr;overflow:visible!important}
  .crm-context-section{border-bottom:0;border-right:1px solid var(--line)}
  .crm-context-section:last-child{border-right:0}
}
@media(max-width:820px){
  .crm-toolbar{align-items:flex-start;flex-direction:column}
  .crm-layout{display:flex;flex-direction:column;min-height:0;height:auto}
  .crm-conversations{min-height:310px;max-height:430px}
  .crm-chat-panel{min-height:650px}
  .crm-context{display:flex;flex-direction:column}
  .crm-context-section{border-right:0;border-bottom:1px solid var(--line)}
  .crm-connection-screen{inset:65px 0 0}
}
@media(max-width:520px){
  .crm-toolbar{padding:14px}
  .crm-layout{gap:10px}
  .crm-chat-panel{min-height:610px}
  .crm-messages{padding:13px 10px}
  .crm-bubble{max-width:88%}
  .crm-composer{grid-template-columns:minmax(0,1fr) 82px;padding:8px}
  .crm-connect-card{padding:20px 13px}
  .crm-qr-box img{width:200px}
}


/* v1.9.0: CRM v2 — modo foco, tipografía, emojis e identidad LID */
.crm-page,.crm-page button,.crm-page input,.crm-page textarea,.crm-page select{font-family:"Nunito","Segoe UI",Arial,sans-serif}
body.crm-focus-mode{overflow:hidden;background:#edf3f7}
body.crm-focus-mode .app-shell{display:block;min-height:100vh}
body.crm-focus-mode .sidebar,body.crm-focus-mode .sidebar-backdrop,body.crm-focus-mode .topbar,body.crm-focus-mode .pending-acceptance-banner{display:none!important}
body.crm-focus-mode .main-area{min-width:0;width:100%;min-height:100vh}
body.crm-focus-mode .content{max-width:none!important;width:100%;height:100vh;padding:10px!important;margin:0!important;overflow:hidden}
body.crm-focus-mode .crm-page{height:100%;gap:8px}
body.crm-focus-mode .crm-toolbar{flex:0 0 auto;padding:10px 14px;border-radius:15px}
body.crm-focus-mode .crm-layout{height:auto;min-height:0;flex:1;grid-template-columns:minmax(270px,315px) minmax(480px,1.45fr) minmax(285px,340px);gap:8px}
body.crm-focus-mode .crm-layout>.panel{border-radius:14px}
.crm-v2 .crm-toolbar-left,.crm-v2 .crm-toolbar-status{display:flex;align-items:center;gap:12px;min-width:0}
.crm-v2 .crm-toolbar-status{justify-content:flex-end;flex-wrap:wrap}
.crm-workspace-toggle{border:1px solid #dbe5ee;background:#fff;color:#1b3b5c;border-radius:10px;padding:8px 11px;font-weight:850;font-size:11px;cursor:pointer;white-space:nowrap;box-shadow:0 2px 8px rgba(15,35,65,.04)}
.crm-workspace-toggle:hover{background:#f0f7ff;border-color:#bcd2ef;color:#1762b8}
.crm-sync-state{font-size:9.5px;color:#66778b;font-weight:700;white-space:nowrap}
.crm-v2 .crm-pane-head strong{font-size:13.5px}
.crm-v2 .crm-row-copy strong{font-size:12px}
.crm-v2 .crm-row-copy small{font-size:10px}
.crm-v2 .crm-bubble p{font-size:11.5px;line-height:1.48}
.crm-v2 .crm-bubble time{font-size:8.5px}
.crm-tabs b{display:inline-grid;place-items:center;min-width:17px;height:17px;padding:0 4px;border-radius:99px;background:rgba(19,126,85,.09);font-size:8px;margin-left:3px}
.crm-merged-note{display:inline-block!important;color:#397d69!important;font-size:8px!important;font-weight:800!important;margin-top:1px}
.crm-contact-action{display:grid;text-decoration:none!important}
.crm-contact-action.disabled{opacity:.35;pointer-events:none}
.crm-chat-head-actions{display:flex;align-items:center;gap:5px}
.crm-date-separator{display:flex;justify-content:center;margin:13px 0}
.crm-date-separator span{padding:4px 9px;border-radius:8px;background:rgba(255,255,255,.88);box-shadow:0 1px 3px rgba(30,41,59,.08);color:#68788a;font-size:8px;font-weight:800}
.crm-quick-replies{display:flex;gap:6px;overflow-x:auto;padding:7px 10px;background:#f8fafb;border-top:1px solid #e5ebef;scrollbar-width:thin}
.crm-quick-replies button{border:1px solid #dce6e9;background:#fff;color:#3f5866;padding:6px 9px;border-radius:999px;font-size:9px;font-weight:800;white-space:nowrap;cursor:pointer;transition:.12s}
.crm-quick-replies button:hover{background:#ebf8f1;color:#087a51;border-color:#bfe3d1}
.crm-composer{grid-template-columns:auto minmax(0,1fr) auto!important;position:relative}
.crm-composer-tools{position:relative;align-self:end}
.crm-emoji-button{width:39px;height:39px;border:1px solid #dce5ea;border-radius:11px;background:#fff;font-size:19px;cursor:pointer}
.crm-emoji-button:hover{background:#f4faf7}
.crm-emoji-picker{display:none;position:absolute;left:0;bottom:48px;width:260px;padding:9px;grid-template-columns:repeat(6,1fr);gap:4px;background:#fff;border:1px solid #dce5ea;border-radius:13px;box-shadow:0 18px 45px rgba(20,43,60,.16);z-index:20}
.crm-emoji-picker.open{display:grid}
.crm-emoji-picker button{border:0;background:transparent;border-radius:8px;aspect-ratio:1;font-size:20px;cursor:pointer}
.crm-emoji-picker button:hover{background:#eef7f2}
.crm-send-button{border-radius:11px!important;min-width:88px}
.crm-v2-help h3{margin:5px 0 6px;font-size:13px}
.crm-v2-help p{font-size:9.5px;color:#6e7e90;line-height:1.55;margin:0}
.crm-v2-help code{font-size:8.5px;background:#f0f4f7;padding:2px 4px;border-radius:4px}
@media(max-width:1200px){body.crm-focus-mode .crm-layout{grid-template-columns:260px minmax(430px,1fr)}body.crm-focus-mode .crm-context{grid-column:1/-1;max-height:300px}}
@media(max-width:820px){body.crm-focus-mode{overflow:auto}body.crm-focus-mode .content{height:auto;min-height:100vh;overflow:visible}body.crm-focus-mode .crm-page{height:auto}body.crm-focus-mode .crm-layout{display:flex;height:auto}.crm-toolbar-status{width:100%;justify-content:flex-start!important}.crm-workspace-toggle span{display:none}.crm-chat-head-actions{gap:2px}.crm-contact-action,.crm-chat-head-actions .crm-icon-button{width:31px;height:31px}.crm-quick-replies{padding:6px}.crm-emoji-picker{left:-2px;width:245px}}


/* v1.9.1: CRM pulido — modo foco automático, compositor tipo WhatsApp y chat moderno */
.crm-page,.crm-page button,.crm-page input,.crm-page textarea,.crm-page select{
  font-family:Inter,ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,Arial,sans-serif
}
body.crm-focus-mode .crm-toolbar{
  background:rgba(255,255,255,.96);
  border:1px solid #e2e8ed;
  box-shadow:0 7px 24px rgba(20,42,57,.07)
}
.crm-workspace-toggle{
  display:inline-flex;align-items:center;gap:7px;
  border:0;background:#edf6f2;color:#087654;
  border-radius:999px;padding:8px 12px;
  font-weight:850;font-size:11px;box-shadow:none
}
.crm-workspace-toggle:hover{background:#dff2e9;color:#056345;border-color:transparent}
.crm-layout>.panel{border:1px solid #e1e8ec;box-shadow:0 8px 25px rgba(27,48,63,.055)}
.crm-conversations{background:#fff}
.crm-chat-row{padding:12px 13px;border-bottom-color:#f0f3f5}
.crm-chat-row:hover{background:#f6faf8}
.crm-chat-row.active{background:#e9f8f1;box-shadow:inset 3px 0 #12a66d}
.crm-list-avatar,.crm-chat-avatar{
  background:linear-gradient(145deg,#e5f7ed,#c9edda);
  color:#087654
}
.crm-row-copy strong{font-weight:760;letter-spacing:-.01em}
.crm-row-copy small{color:#7b8895}
.crm-chat-panel{
  background-color:#efeae2!important;
  background-image:
    radial-gradient(circle at 22px 22px,rgba(90,110,100,.035) 1.2px,transparent 1.3px),
    radial-gradient(circle at 7px 8px,rgba(90,110,100,.022) 1px,transparent 1.1px);
  background-size:31px 31px,27px 27px
}
.crm-chat-head{box-shadow:0 1px 0 rgba(30,45,55,.04)}
.crm-messages{padding:20px 22px}
.crm-bubble{
  border-radius:14px!important;
  box-shadow:0 1px 2px rgba(18,38,28,.08)!important;
  border:0!important
}
.crm-bubble-wrap.from-client .crm-bubble{background:#fff!important;border-top-left-radius:4px!important}
.crm-bubble-wrap.from-me .crm-bubble{background:#d9fdd3!important;border-top-right-radius:4px!important}
.crm-bubble p{color:#22312d!important}
.crm-bubble time{color:#71827b!important}
.crm-quick-replies{
  padding:7px 11px;background:#f6f8f9;border-top:1px solid #e3e8ea
}
.crm-quick-replies button{
  background:#fff;border-color:#e0e6e8;color:#516168;
  box-shadow:0 1px 2px rgba(20,40,50,.025)
}
.crm-composer{
  display:grid!important;grid-template-columns:38px minmax(0,1fr) 42px!important;
  align-items:end!important;gap:7px!important;
  padding:9px 10px!important;background:#f0f2f5!important;
  border-top:1px solid #dfe5e7!important
}
.crm-composer textarea{
  min-height:42px!important;max-height:125px!important;
  padding:11px 15px!important;border:0!important;
  border-radius:21px!important;background:#fff!important;
  box-shadow:0 1px 2px rgba(20,40,50,.05)!important;
  font-size:12px!important;line-height:1.45!important;
  resize:none!important
}
.crm-composer textarea:focus{outline:2px solid rgba(18,166,109,.13)!important}
.crm-composer-tools{display:grid;place-items:center;height:42px}
.crm-emoji-button{
  width:34px!important;height:34px!important;border:0!important;
  border-radius:50%!important;background:transparent!important;
  color:#60717b!important;padding:5px!important;
  display:grid!important;place-items:center!important
}
.crm-emoji-button:hover{background:#e2e7ea!important;color:#0d8b60!important}
.crm-emoji-button svg{
  width:23px;height:23px;fill:none;stroke:currentColor;stroke-width:1.8;
  stroke-linecap:round;stroke-linejoin:round
}
.crm-emoji-button svg circle:not(:first-child){fill:currentColor;stroke:none}
.crm-emoji-picker{
  left:0!important;bottom:45px!important;width:292px!important;
  padding:10px!important;grid-template-columns:repeat(7,1fr)!important;
  gap:3px!important;border:1px solid #dce3e5!important;
  border-radius:16px!important;box-shadow:0 18px 55px rgba(20,38,48,.2)!important;
  background:#fff!important
}
.crm-emoji-picker:after{
  content:"";position:absolute;bottom:-6px;left:15px;width:12px;height:12px;
  background:#fff;transform:rotate(45deg);border-right:1px solid #dce3e5;border-bottom:1px solid #dce3e5
}
.crm-emoji-picker button{font-size:20px!important;border-radius:9px!important;position:relative;z-index:1}
.crm-emoji-picker button:hover{background:#eef7f3!important}
.crm-send-button{
  width:42px!important;height:42px!important;min-width:42px!important;
  border:0!important;border-radius:50%!important;background:#12a66d!important;
  color:#fff!important;display:grid!important;place-items:center!important;
  cursor:pointer!important;box-shadow:0 3px 9px rgba(18,166,109,.23)!important;
  transition:transform .12s,background .12s,opacity .12s!important;
  font-size:17px!important;padding:0!important
}
.crm-send-button:hover:not(:disabled){background:#0c915d!important;transform:translateY(-1px)}
.crm-send-button:disabled{opacity:.42!important;cursor:not-allowed!important;box-shadow:none!important}
.crm-send-button span{display:block;transform:translateX(1px) rotate(-5deg)}
.crm-sync-state{color:#71808b}
.crm-date-separator span{
  background:rgba(255,255,255,.86);color:#65766f;border:1px solid rgba(214,221,218,.75)
}
.crm-client-card,.crm-extracted-fields,.crm-ai-summary{box-shadow:0 3px 12px rgba(22,45,56,.035)}
@media(max-width:820px){
  .crm-composer{grid-template-columns:36px minmax(0,1fr) 40px!important}
  .crm-emoji-picker{width:min(285px,calc(100vw - 42px))!important}
}


/* v1.9.2: CRM multimedia + escala tipográfica + apariencia WhatsApp */
.crm-page{font-size:130%}
.crm-toolbar{background:#f0f2f5!important;border-color:#d9e0e3!important}
.crm-toolbar h2{font-size:27px!important;letter-spacing:-.025em}
.crm-toolbar p{font-size:14px!important}
.crm-workspace-toggle{font-size:14px!important;padding:9px 14px!important}
.crm-sync-state,.crm-connection-pill{font-size:12.5px!important}
.crm-pane-head,.crm-chat-head{background:#f0f2f5!important;min-height:72px!important}
.crm-v2 .crm-pane-head strong{font-size:17.5px!important}
.crm-pane-head small{font-size:13px!important}
.crm-search{background:#fff!important;border:0!important;border-radius:9px!important;margin:9px 10px!important}
.crm-search input{font-size:14.3px!important;min-height:42px!important}
.crm-tabs button{font-size:13px!important}
.crm-tabs b{font-size:10.5px!important;min-width:20px;height:20px}
.crm-chat-row{grid-template-columns:48px minmax(0,1fr) auto!important;padding:12px 13px!important}
.crm-list-avatar{width:48px!important;height:48px!important;font-size:17px!important}
.crm-chat-avatar{width:44px!important;height:44px!important;font-size:15px!important}
.crm-v2 .crm-row-copy strong{font-size:15.6px!important;font-weight:650!important}
.crm-v2 .crm-row-copy small{font-size:13px!important;line-height:1.35!important}
.crm-row-meta time{font-size:11px!important}
.crm-row-meta b{font-size:11px!important;min-width:21px!important;height:21px!important}
.crm-chat-row.active{background:#f0f2f5!important;box-shadow:none!important}
.crm-chat-row:hover{background:#f5f6f6!important}
.crm-chat-head>div:nth-child(2) strong{font-size:16px!important}
.crm-chat-head>div:nth-child(2) small{font-size:13px!important}
.crm-chat-panel{background-color:#efeae2!important}
.crm-messages{padding:18px clamp(14px,4vw,54px)!important}
.crm-bubble{max-width:min(76%,720px)!important;padding:7px 8px 5px!important;border-radius:8px!important}
.crm-bubble-wrap.from-client .crm-bubble{border-top-left-radius:8px!important}
.crm-bubble-wrap.from-me .crm-bubble{border-top-right-radius:8px!important;background:#d9fdd3!important}
.crm-v2 .crm-bubble p{font-size:15px!important;line-height:1.42!important;margin:2px 4px 2px!important}
.crm-v2 .crm-bubble time{font-size:10.8px!important;margin-top:3px!important;padding:0 3px!important}
.crm-date-separator span{font-size:10.5px!important;padding:5px 10px!important}
.crm-quick-replies button{font-size:11.7px!important;padding:7px 11px!important}
.crm-composer textarea{font-size:15.6px!important;min-height:46px!important;padding:12px 16px!important}
.crm-composer{grid-template-columns:42px minmax(0,1fr) 46px!important;padding:8px 12px!important;background:#f0f2f5!important}
.crm-composer-tools{height:46px!important}
.crm-emoji-button{width:38px!important;height:38px!important;color:#54656f!important}
.crm-emoji-button svg{width:25px!important;height:25px!important}
.crm-send-button{width:46px!important;height:46px!important;min-width:46px!important;background:#00a884!important}
.crm-send-button:hover:not(:disabled){background:#008f72!important}
.crm-emoji-picker{bottom:50px!important;width:316px!important}
.crm-emoji-picker button{font-size:23px!important}
.crm-context-section .eyebrow{font-size:11px!important}
.crm-client-card strong,.crm-ai-title h3{font-size:16px!important}
.crm-client-card small,.crm-client-card span,.crm-ai-card p,.crm-extraction{font-size:12.5px!important}
.crm-v2-help,.crm-merged-note{display:none!important}

/* Imágenes de WhatsApp */
.crm-bubble.has-media{padding:4px 4px 5px!important;overflow:hidden}
.crm-bubble.has-media p{padding:2px 4px 0!important}
.crm-image-message{display:block;position:relative;width:min(360px,58vw);max-width:100%;padding:0;border:0;background:#dde3df;border-radius:6px;overflow:hidden;cursor:zoom-in;min-height:150px}
.crm-image-message img{display:block;width:100%;max-height:390px;object-fit:cover;background:#dde3df}
.crm-image-error{display:none;min-height:150px;padding:30px 18px;align-items:center;justify-content:center;flex-direction:column;text-align:center;color:#53635c;font-size:14px;line-height:1.35}
.crm-image-error small{font-size:11px;color:#7d8b85;margin-top:4px}
.crm-image-message.media-error .crm-image-error{display:flex}
.crm-media-placeholder{min-width:220px;min-height:72px;border-radius:6px;background:rgba(255,255,255,.46);display:flex;align-items:center;gap:10px;padding:14px;color:#44544d;font-size:14px}
.crm-media-placeholder:first-letter{font-size:23px}
.crm-media-modal{display:none;position:fixed;inset:0;z-index:99999;background:rgba(11,20,25,.94);align-items:center;justify-content:center;padding:38px}
.crm-media-modal.open{display:flex}
.crm-media-modal img{display:block;max-width:min(94vw,1400px);max-height:92vh;object-fit:contain;border-radius:4px;box-shadow:0 20px 80px rgba(0,0,0,.35)}
.crm-media-close{position:absolute;right:18px;top:14px;width:44px;height:44px;border:0;border-radius:50%;background:rgba(255,255,255,.12);color:#fff;font-size:31px;line-height:1;cursor:pointer}
.crm-media-close:hover{background:rgba(255,255,255,.2)}
body.crm-media-open{overflow:hidden!important}

@media(max-width:820px){
  .crm-page{font-size:118%}
  .crm-toolbar h2{font-size:23px!important}
  .crm-bubble{max-width:88%!important}
  .crm-v2 .crm-bubble p{font-size:14.5px!important}
  .crm-image-message{width:min(330px,72vw)}
  .crm-media-modal{padding:18px}
}


/* v1.9.3: leído inmediato + selector de emojis ordenado */
.crm-row-meta b{background:#25d366!important}
.crm-chat-row.active .crm-row-meta b{display:none!important}
.crm-emoji-picker{
  display:none!important;
  grid-template-columns:1fr!important;
  gap:0!important;
  width:350px!important;
  padding:0!important;
  overflow:hidden!important;
  border-radius:18px!important;
  background:#fff!important;
  border:1px solid #d8e0e3!important;
  box-shadow:0 20px 65px rgba(11,35,46,.24)!important;
}
.crm-emoji-picker.open{display:block!important}
.crm-emoji-picker:after{display:none!important}
.crm-emoji-head{height:46px;display:flex;align-items:center;justify-content:space-between;padding:0 13px 0 16px;border-bottom:1px solid #edf0f2;background:#fff}
.crm-emoji-head strong{font-size:14px;color:#34464f;font-weight:750}
.crm-emoji-close{width:31px!important;height:31px!important;aspect-ratio:auto!important;border:0!important;border-radius:50%!important;background:transparent!important;color:#657780!important;font-size:24px!important;line-height:1!important;display:grid!important;place-items:center!important;cursor:pointer}
.crm-emoji-close:hover{background:#f0f2f5!important}
.crm-emoji-tabs{height:48px;display:grid;grid-template-columns:repeat(5,1fr);align-items:stretch;border-bottom:1px solid #edf0f2;background:#fafbfb;padding:0 7px}
.crm-emoji-tabs button{height:48px!important;aspect-ratio:auto!important;border:0!important;border-radius:0!important;background:transparent!important;font-size:21px!important;cursor:pointer;position:relative;color:#667781}
.crm-emoji-tabs button:hover{background:#f1f5f4!important}
.crm-emoji-tabs button.active:after{content:"";position:absolute;left:12px;right:12px;bottom:0;height:3px;border-radius:3px 3px 0 0;background:#00a884}
.crm-emoji-grid{display:grid;grid-template-columns:repeat(8,1fr);gap:3px;padding:11px 10px 13px;max-height:242px;overflow-y:auto;overscroll-behavior:contain;background:#fff}
.crm-emoji-grid::-webkit-scrollbar{width:7px}.crm-emoji-grid::-webkit-scrollbar-thumb{background:#d7dee1;border-radius:10px}
.crm-emoji-item{width:auto!important;height:auto!important;aspect-ratio:1!important;border:0!important;background:transparent!important;border-radius:9px!important;font-size:25px!important;display:grid!important;place-items:center!important;cursor:pointer!important;padding:3px!important}
.crm-emoji-item:hover{background:#eef4f2!important;transform:scale(1.06)}
@media(max-width:820px){
  .crm-emoji-picker{width:min(340px,calc(100vw - 24px))!important;left:-4px!important}
  .crm-emoji-grid{grid-template-columns:repeat(7,1fr);max-height:225px}
  .crm-emoji-item{font-size:24px!important}
}

/* v1.9.5: cabecera CRM compacta para maximizar espacio de conversaciones */
body.crm-focus-mode .crm-toolbar{
  padding:5px 10px!important;
  min-height:48px!important;
  border-radius:10px!important;
  gap:10px!important;
}
.crm-v2 .crm-toolbar-left,.crm-v2 .crm-toolbar-status{gap:8px!important}
.crm-toolbar .eyebrow{font-size:8.5px!important;line-height:1!important;margin:0!important}
.crm-toolbar h2{
  font-size:18px!important;
  line-height:1.08!important;
  margin:1px 0 0!important;
  letter-spacing:-.02em!important;
}
.crm-toolbar p{
  font-size:9.5px!important;
  line-height:1.15!important;
  margin:1px 0 0!important;
}
.crm-workspace-toggle{
  padding:5px 9px!important;
  font-size:10.5px!important;
  min-height:30px!important;
}
.crm-toolbar-status{gap:6px!important}
.crm-sync-state{font-size:9.5px!important;line-height:1!important}
.crm-connection-pill{
  padding:4px 8px!important;
  gap:6px!important;
  font-size:10px!important;
  line-height:1!important;
  min-height:25px!important;
  border-radius:999px!important;
}
.crm-connection-pill>span{
  width:6px!important;
  height:6px!important;
  box-shadow:0 0 0 3px rgba(148,163,184,.11)!important;
}
.crm-connection-pill.connected>span{box-shadow:0 0 0 3px rgba(22,163,106,.10)!important}
.crm-connection-pill.disconnected>span{box-shadow:0 0 0 3px rgba(239,155,33,.10)!important}

/* Encabezados internos más bajos sin sacrificar legibilidad */
.crm-pane-head,.crm-chat-head{
  min-height:56px!important;
  padding:8px 11px!important;
}
.crm-v2 .crm-pane-head strong{font-size:15px!important}
.crm-pane-head small{font-size:11.5px!important}
.crm-chat-avatar{width:40px!important;height:40px!important;font-size:14px!important}
.crm-chat-head>div:nth-child(2) strong{font-size:15px!important}
.crm-chat-head>div:nth-child(2) small{font-size:11.5px!important}
.crm-chat-head-actions .crm-icon-button,.crm-contact-action{width:31px!important;height:31px!important;font-size:15px!important}

/* Más área útil para la bandeja y el historial */
body.crm-focus-mode .crm-page{gap:5px!important}
body.crm-focus-mode .crm-layout{gap:6px!important}
.crm-search{margin:6px 9px!important}
.crm-search input{min-height:36px!important;padding:6px 2px!important}
.crm-tabs{padding:0 9px 6px!important}
.crm-tabs button{padding:5px 7px!important}
.crm-chat-row{padding:9px 11px!important}

@media(max-width:820px){
  body.crm-focus-mode .crm-toolbar{padding:5px 7px!important;min-height:44px!important}
  .crm-toolbar h2{font-size:16px!important}
  .crm-toolbar p{display:none!important}
  .crm-toolbar .eyebrow{font-size:8px!important}
  .crm-sync-state{display:none!important}
  .crm-connection-pill{padding:4px 7px!important;font-size:9.5px!important}
  .crm-pane-head,.crm-chat-head{min-height:52px!important;padding:7px 9px!important}
}

/* v1.9.5: imágenes nítidas directamente dentro del chat */
.crm-image-message{
  width:min(430px,64vw)!important;
  min-height:190px!important;
  max-height:540px!important;
  background-color:#d8ddd9!important;
  background-position:center!important;
  background-size:cover!important;
  background-repeat:no-repeat!important;
  isolation:isolate;
}
.crm-image-message::before{
  content:"";
  position:absolute;
  inset:0;
  z-index:0;
  background:inherit;
  background-position:center;
  background-size:cover;
  filter:blur(13px);
  transform:scale(1.07);
  opacity:.42;
}
.crm-image-message::after{
  content:"";
  position:absolute;
  inset:0;
  z-index:1;
  background:linear-gradient(180deg,rgba(255,255,255,.04),rgba(0,0,0,.035));
  pointer-events:none;
}
.crm-image-message img{
  position:relative;
  z-index:2;
  width:100%!important;
  height:auto!important;
  max-height:540px!important;
  object-fit:contain!important;
  background:#d8ddd9!important;
  opacity:0;
  transition:opacity .18s ease;
}
.crm-image-message.media-ready img{opacity:1}
.crm-image-message.media-ready::before{opacity:0;transition:opacity .2s ease}
.crm-image-loading{
  position:absolute;
  inset:0;
  z-index:3;
  display:flex;
  flex-direction:column;
  align-items:center;
  justify-content:center;
  gap:8px;
  color:#475650;
  background:rgba(255,255,255,.18);
  pointer-events:none;
}
.crm-image-loading i{
  width:27px;
  height:27px;
  border-radius:50%;
  border:3px solid rgba(61,84,75,.2);
  border-top-color:#00a884;
  animation:crmImageSpin .7s linear infinite;
}
.crm-image-loading small{font-size:11px;font-weight:700;background:rgba(255,255,255,.72);padding:4px 8px;border-radius:999px}
.crm-image-message.media-ready .crm-image-loading,
.crm-image-message.media-error .crm-image-loading{display:none}
.crm-image-message .crm-image-error{position:relative;z-index:4;background:rgba(255,255,255,.86);width:100%;height:100%}
.crm-image-hd{
  position:absolute;
  right:7px;
  top:7px;
  z-index:5;
  display:none;
  padding:2px 5px;
  border-radius:4px;
  background:rgba(11,20,25,.58);
  color:#fff;
  font-size:9px;
  font-weight:800;
  letter-spacing:.04em;
  pointer-events:none;
}
.crm-image-message.media-ready:hover .crm-image-hd{display:block}
.crm-media-modal{backdrop-filter:blur(5px)}
.crm-media-modal::before{content:"";position:absolute;inset:0;background:radial-gradient(circle at 50% 50%,rgba(255,255,255,.035),transparent 55%);pointer-events:none}
.crm-media-modal img{position:relative;z-index:2;opacity:.2;transform:scale(.985);transition:opacity .18s ease,transform .18s ease}
.crm-media-modal img.ready{opacity:1;transform:scale(1)}
.crm-media-close{z-index:3}
@keyframes crmImageSpin{to{transform:rotate(360deg)}}
@media(max-width:820px){
  .crm-image-message{width:min(390px,82vw)!important;min-height:165px!important;max-height:470px!important}
  .crm-image-message img{max-height:470px!important}
}

/* v1.10.0 · historial paginado del CRM */
.crm-load-older{display:flex;justify-content:center;padding:2px 0 12px}
.crm-load-older button{appearance:none;border:1px solid #d7dedb;background:rgba(255,255,255,.92);color:#3d5a51;border-radius:999px;padding:7px 15px;font:700 12px/1.2 inherit;box-shadow:0 1px 4px rgba(31,50,44,.08);cursor:pointer;transition:.16s ease}
.crm-load-older button:hover{background:#fff;border-color:#a8bbb5;transform:translateY(-1px)}
.crm-load-older button:disabled{opacity:.6;cursor:wait;transform:none}


/* v1.10.1 · alta de servicios sin salir del CRM */
.crm-service-modal{display:none;position:fixed;inset:0;z-index:100020;align-items:center;justify-content:center;padding:22px}
.crm-service-modal.open{display:flex}
.crm-service-modal-backdrop{position:absolute;inset:0;background:rgba(11,20,25,.62);backdrop-filter:blur(4px)}
.crm-service-dialog{position:relative;z-index:2;width:min(760px,96vw);max-height:92vh;overflow:auto;background:#fff;border-radius:18px;border:1px solid #dce5e1;box-shadow:0 24px 80px rgba(11,20,25,.28)}
.crm-service-dialog-head{display:flex;align-items:flex-start;justify-content:space-between;gap:20px;padding:18px 20px 14px;border-bottom:1px solid #e8eeeb;background:#f8fbfa;position:sticky;top:0;z-index:3}
.crm-service-dialog-head h3{margin:2px 0 3px;font-size:20px;color:#172b24}.crm-service-dialog-head p{margin:0;color:#6f7f79;font-size:13px}
.crm-service-close{border:0;background:#e9efec;color:#40534c;width:34px;height:34px;border-radius:50%;font-size:24px;line-height:1;cursor:pointer}
.crm-service-form{padding:18px 20px 20px}.crm-service-grid{display:grid;grid-template-columns:1fr 1fr;gap:14px}.crm-service-grid .span-2{grid-column:1/-1}
.crm-service-grid label{display:flex;flex-direction:column;gap:6px;font-size:13px;font-weight:700;color:#31443d}.crm-service-grid input,.crm-service-grid select,.crm-service-grid textarea{width:100%;border:1px solid #d7e1dd;border-radius:10px;padding:10px 12px;font:inherit;font-weight:500;color:#1f332c;background:#fff;outline:none}.crm-service-grid input:focus,.crm-service-grid select:focus,.crm-service-grid textarea:focus{border-color:#1ca97a;box-shadow:0 0 0 3px rgba(28,169,122,.12)}
.crm-service-form-error{min-height:20px;margin-top:10px;color:#b42318;font-size:13px}.crm-service-actions{display:flex;justify-content:flex-end;gap:10px;margin-top:8px}.crm-modal-open{overflow:hidden}
.crm-toast{position:fixed;z-index:100050;left:50%;bottom:28px;transform:translate(-50%,18px);background:#172b24;color:#fff;border-radius:12px;padding:12px 18px;font-size:14px;font-weight:800;box-shadow:0 14px 35px rgba(0,0,0,.25);opacity:0;pointer-events:none;transition:.2s ease;max-width:min(90vw,520px);text-align:center}.crm-toast.show{opacity:1;transform:translate(-50%,0)}
@media(max-width:640px){.crm-service-modal{padding:8px}.crm-service-dialog{width:100%;max-height:96vh;border-radius:14px}.crm-service-grid{grid-template-columns:1fr}.crm-service-grid .span-2{grid-column:auto}.crm-service-form,.crm-service-dialog-head{padding-left:14px;padding-right:14px}}


/* v1.10.3 · modal de alta desde CRM reforzado + cache bust automático */
body.crm-modal-open{overflow:hidden!important}
#crmServiceModal.crm-service-modal{
  display:none!important;
  position:fixed!important;
  inset:0!important;
  width:100vw!important;
  height:100vh!important;
  z-index:2147483000!important;
  align-items:center!important;
  justify-content:center!important;
  padding:24px!important;
  margin:0!important;
  background:transparent!important;
}
#crmServiceModal.crm-service-modal.open{display:flex!important}
#crmServiceModal .crm-service-modal-backdrop{
  position:absolute!important;
  inset:0!important;
  background:rgba(8,21,17,.68)!important;
  backdrop-filter:blur(7px)!important;
  -webkit-backdrop-filter:blur(7px)!important;
}
#crmServiceModal .crm-service-dialog{
  position:relative!important;
  z-index:2!important;
  width:min(780px,calc(100vw - 48px))!important;
  max-height:min(90vh,850px)!important;
  overflow:auto!important;
  margin:auto!important;
  background:#fff!important;
  border:1px solid rgba(211,225,219,.95)!important;
  border-radius:22px!important;
  box-shadow:0 30px 90px rgba(0,0,0,.34)!important;
  animation:crmServiceModalIn .18s ease-out both;
}
#crmServiceModal .crm-service-dialog-head{
  padding:18px 22px 15px!important;
  background:#f7faf8!important;
  border-bottom:1px solid #e5ece8!important;
}
#crmServiceModal .crm-service-form{padding:20px 22px 22px!important}
#crmServiceModal .crm-service-actions{
  position:sticky!important;
  bottom:-22px!important;
  z-index:3!important;
  margin:14px -22px -22px!important;
  padding:14px 22px!important;
  background:rgba(255,255,255,.97)!important;
  border-top:1px solid #e7eeea!important;
  backdrop-filter:blur(8px)!important;
}
@keyframes crmServiceModalIn{from{opacity:0;transform:translateY(14px) scale(.985)}to{opacity:1;transform:none}}
@media(max-width:640px){
  #crmServiceModal.crm-service-modal{padding:10px!important}
  #crmServiceModal .crm-service-dialog{width:100%!important;max-height:95vh!important;border-radius:16px!important}
  #crmServiceModal .crm-service-dialog-head{padding:15px 16px 13px!important}
  #crmServiceModal .crm-service-form{padding:16px!important}
  #crmServiceModal .crm-service-actions{bottom:-16px!important;margin:12px -16px -16px!important;padding:12px 16px!important}
}


/* v1.11.0 - módulos por colaborador + Autoresponder */
.user-modules-box{display:grid;gap:10px;padding:16px;border:1px solid var(--border);border-radius:16px;background:var(--surface-soft,#f8fafc)}
.module-toggle-card{display:flex!important;align-items:center;justify-content:space-between;gap:18px;padding:14px 16px;border:1px solid var(--border);border-radius:14px;background:#fff;cursor:pointer}
.module-toggle-card>div{display:grid;gap:4px}.module-toggle-card small{color:var(--muted)}
.settings-autoresponder-panel textarea{min-height:310px;line-height:1.55}
.autoresponder-controls label{min-width:0}


/* v1.12.0 - Autoresponder webhook + espera aleatoria */
.form-grid.four{grid-template-columns:repeat(4,minmax(0,1fr));}
@media(max-width:1100px){.form-grid.four{grid-template-columns:repeat(2,minmax(0,1fr));}}
@media(max-width:680px){.form-grid.four{grid-template-columns:1fr;}}


/* v1.12.2 - estado y cierre de sesión de WhatsApp */
.crm-connection-controls{display:flex;align-items:center;gap:6px;min-width:0}
.crm-connection-pill.checking{background:#eef2f7;color:#596579;border-color:#dce3ec}
.crm-connection-pill.checking>span{background:#94a3b8;box-shadow:0 0 0 3px rgba(148,163,184,.10)!important}
/* v1.12.3 - cierre de sesión compacto y moderno */
.crm-whatsapp-logout{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  gap:6px;
  height:27px;
  padding:0 9px 0 7px;
  border:1px solid #d8dee6;
  background:rgba(255,255,255,.82);
  color:#5f6b78;
  border-radius:999px;
  font:inherit;
  font-size:10px;
  font-weight:700;
  line-height:1;
  cursor:pointer;
  white-space:nowrap;
  box-shadow:0 1px 2px rgba(15,23,42,.04);
  transition:background .16s ease,border-color .16s ease,color .16s ease,box-shadow .16s ease,transform .16s ease;
}
.crm-whatsapp-logout .crm-logout-icon{width:18px;height:18px;border-radius:50%;display:grid;place-items:center;background:#f1f4f7;color:#6b7785;transition:inherit}
.crm-whatsapp-logout .crm-logout-icon svg{width:12px;height:12px;stroke:currentColor;stroke-width:1.9;stroke-linecap:round;stroke-linejoin:round}
.crm-whatsapp-logout:hover{background:#fff;border-color:#f0b7b7;color:#b52d2d;box-shadow:0 2px 7px rgba(181,45,45,.10);transform:translateY(-1px)}
.crm-whatsapp-logout:hover .crm-logout-icon{background:#fff0f0;color:#c43131}
.crm-whatsapp-logout:focus-visible{outline:2px solid rgba(37,211,102,.28);outline-offset:2px}
.crm-whatsapp-logout:disabled{opacity:.62;cursor:wait;transform:none;box-shadow:none}
.crm-whatsapp-logout.is-loading .crm-logout-icon{position:relative;color:transparent;background:#f1f4f7}
.crm-whatsapp-logout.is-loading .crm-logout-icon:after{content:"";width:9px;height:9px;border:1.5px solid #a5afba;border-top-color:#596579;border-radius:50%;animation:crmLogoutSpin .7s linear infinite}
.crm-whatsapp-logout.hidden{display:none!important}
@keyframes crmLogoutSpin{to{transform:rotate(360deg)}}
@media(max-width:700px){
  .crm-whatsapp-logout{width:29px;height:29px;padding:0;border-radius:50%}
  .crm-whatsapp-logout .crm-logout-label{display:none}
  .crm-whatsapp-logout .crm-logout-icon{width:21px;height:21px}
  .crm-connection-controls{gap:4px}
}

/* v1.12.6 · Estado/reparación del webhook del Autoresponder */
.autoresponder-repair-form{flex:0 0 auto;margin:0}
.autoresponder-repair-form .button{white-space:nowrap}

/* v1.13.2 · CRM compacto: sin header superior, estados en sidebar y QR por usuario */
body.crm-focus-mode .crm-page{gap:0!important}
body.crm-focus-mode .crm-layout{height:100%!important;min-height:0!important;gap:8px!important}
.crm-sidebar-statusbar{
  min-height:32px;padding:5px 8px;border-bottom:1px solid #e7ecef;background:#f8fafb;
  display:flex;align-items:center;gap:5px;overflow:hidden
}
.crm-mini-status{
  display:inline-flex;align-items:center;gap:5px;min-width:0;padding:4px 7px;border:1px solid #dfe6e9;
  border-radius:999px;background:#fff;color:#65737f;font-size:9.5px!important;font-weight:800;line-height:1;white-space:nowrap
}
.crm-mini-status i{width:7px;height:7px;border-radius:50%;background:#9aa7b1;box-shadow:0 0 0 2px rgba(154,167,177,.10);flex:0 0 auto}
.crm-mini-status b{font-size:inherit;font-weight:800;overflow:hidden;text-overflow:ellipsis}
.crm-mini-status.connected{color:#087654;border-color:#cce8da;background:#f1fbf6}
.crm-mini-status.connected i{background:#18a56d;box-shadow:0 0 0 2px rgba(24,165,109,.13);animation:crmStatusPulse 1.6s ease-in-out infinite}
.crm-mini-status.checking{color:#8c6b16;border-color:#eadcb2;background:#fffaf0}
.crm-mini-status.checking i{background:#e1a928;animation:crmStatusPulse 1.8s ease-in-out infinite}
.crm-mini-status.disconnected{color:#7c8791;background:#f7f8f9}
.crm-mini-status.disconnected i{background:#a7b1b9;animation:none}
.crm-mini-status.is-button{appearance:none;cursor:pointer;font-family:inherit}
.crm-mini-status.is-button:hover{border-color:#badbc9;background:#eef9f3;color:#087654}
@keyframes crmStatusPulse{0%,100%{opacity:1;transform:scale(1)}50%{opacity:.35;transform:scale(.78)}}
.crm-sidebar-statusbar .crm-sync-state{margin-left:auto;min-width:0;overflow:hidden;text-overflow:ellipsis;font-size:9px!important;color:#7a8791!important;font-weight:700}
.crm-sidebar-statusbar .crm-sync-state.warning{color:#a36b10!important}
.crm-conversations-title.crm-pane-head{
  min-height:52px!important;height:52px!important;padding:8px 10px!important;background:#fff!important;
  justify-content:space-between!important;gap:7px!important
}
.crm-conversations-title>div:first-child{min-width:0}
.crm-conversations-title strong{font-size:15px!important;line-height:1.1}
.crm-conversations-title small{font-size:10.5px!important;line-height:1.1;margin-top:2px}
.crm-conversation-top-actions{display:flex;align-items:center;gap:5px;flex:0 0 auto}
.crm-exit-compact{
  padding:6px 9px!important;border-radius:8px!important;font-size:10.5px!important;background:#f3f6f7!important;
  color:#53636f!important;border:1px solid #e0e6e9!important;box-shadow:none!important
}
.crm-exit-compact:hover{background:#eaf0f2!important;color:#233a48!important}
.crm-search-row{display:flex;align-items:center;gap:6px;padding:6px 8px 7px;border-bottom:1px solid #e8edef;background:#fff}
.crm-search-row .crm-search{
  flex:1;min-width:0;margin:0!important;height:36px!important;display:flex!important;align-items:center!important;
  border:1px solid #e0e6e9!important;border-radius:9px!important;background:#f5f7f8!important;padding:0 8px!important;gap:5px!important
}
.crm-search-row .crm-search span{font-size:14px!important;line-height:1;flex:0 0 auto}
.crm-search-row .crm-search input{
  min-height:34px!important;height:34px!important;padding:5px 1px!important;font-size:12.5px!important;line-height:1.2!important
}
.crm-refresh-compact{width:34px!important;height:34px!important;min-width:34px!important;border-radius:9px!important;font-size:15px!important}
.crm-tabs{padding:5px 8px 7px!important;gap:4px!important}
.crm-tabs button{font-size:11px!important;padding:6px 8px!important}
.crm-tabs b{font-size:9px!important;min-width:18px!important;height:18px!important}
.crm-qr-modal{
  position:fixed;inset:0;z-index:1200;display:none;align-items:center;justify-content:center;padding:18px;
  background:rgba(19,32,39,.48);backdrop-filter:blur(3px)
}
.crm-qr-modal.open{display:flex}
.crm-qr-modal-card{
  position:relative;width:min(410px,100%);max-height:min(680px,calc(100vh - 32px));overflow:auto;text-align:center;
  padding:24px 22px 20px;border-radius:18px;background:#fff;box-shadow:0 24px 70px rgba(14,31,39,.25);border:1px solid #e3e9eb
}
.crm-qr-modal-close{position:absolute;right:11px;top:10px;width:31px;height:31px;border:0;border-radius:50%;background:#f1f4f5;color:#65737d;font-size:22px;cursor:pointer}
.crm-qr-modal-close:hover{background:#e6ecee;color:#263b47}
.crm-qr-modal-icon{width:46px;height:46px;margin:0 auto 8px;border-radius:13px;background:#eaf8f1;color:#0c8b5c;display:grid;place-items:center;font-size:26px;font-weight:900}
.crm-qr-modal-card h3{margin:2px 0 5px;font-size:19px;color:#20323d}
.crm-qr-modal-card>p{margin:0 auto 12px;max-width:335px;color:#697984;font-size:11.5px;line-height:1.45}
.crm-qr-modal .crm-qr-box{margin:8px 0 12px;min-height:105px;justify-content:center}
.crm-qr-modal .crm-qr-box img{width:230px!important;max-width:82%!important;border-radius:12px!important}
.crm-qr-modal .crm-qr-box small{font-size:10px!important;color:#7a8790}
.crm-qr-modal-actions{display:flex;justify-content:center;gap:7px;flex-wrap:wrap}
.crm-qr-modal-actions .button{font-size:11px;padding:8px 11px}
.crm-qr-connected{display:flex;flex-direction:column;align-items:center;gap:4px;padding:16px}
.crm-qr-connected>span{width:44px;height:44px;border-radius:50%;display:grid;place-items:center;background:#e6f8ef;color:#0b8f5f;font-size:24px;font-weight:900}
.crm-qr-connected strong{font-size:14px;color:#196248}
.crm-qr-connected small{font-size:10px;color:#718078}
@media(max-width:820px){
  .crm-sidebar-statusbar{position:sticky;top:0;z-index:8}
  .crm-sidebar-statusbar .crm-sync-state{display:none}
  .crm-conversations-title.crm-pane-head{height:50px!important;min-height:50px!important}
  .crm-search-row .crm-search input{font-size:12px!important}
  .crm-exit-compact{padding:6px 8px!important}
  .crm-qr-modal-card{padding:22px 14px 17px}
}

/* v1.13.4 · alcance del Autoresponder */


/* v1.13.7 · Browser notifications + Autoresponder reset */
.browser-notify-settings{margin-top:22px;padding-top:20px;border-top:1px solid var(--border,#e5e7eb)}
.browser-notify-status{font-size:12px;color:var(--muted);padding:9px 11px;border-radius:9px;background:#f8fafc}
.browser-notify-status.success{color:#166534;background:#f0fdf4;border:1px solid #bbf7d0}
.browser-notify-status.warning{color:#92400e;background:#fffbeb;border:1px solid #fde68a}
.autoresponder-reset-box{margin-top:22px;padding:18px;border:1px solid #e5e7eb;border-radius:14px;background:#fafafa;display:grid;gap:14px}
.autoresponder-reset-box form{margin:0}
.button.danger-outline{border:1px solid #fecaca;background:#fff;color:#b91c1c}
.button.danger-outline:hover{background:#fef2f2;border-color:#fca5a5}
input[type="range"]{accent-color:var(--primary,#2563eb)}

/* v1.13.8: controles compactos del Autoresponder */
.form-grid.three{grid-template-columns:repeat(3,minmax(0,1fr));}
@media(max-width:900px){.form-grid.three{grid-template-columns:1fr;}}


/* v1.13.9 · notificación visual de mensajes */


/* v1.13.11 · CRM inspirado en WhatsApp Web + mensajes predeterminados por colaborador */
body.crm-focus-mode .crm-page{padding:0!important}
body.crm-focus-mode .crm-layout{
  grid-template-columns:minmax(300px,350px) minmax(520px,1fr) minmax(275px,325px)!important;
  gap:0!important;border:1px solid #dfe5e7;border-radius:16px;overflow:hidden;background:#fff;
  box-shadow:0 14px 42px rgba(24,46,55,.08)
}
body.crm-focus-mode .crm-layout>.panel{border:0!important;border-radius:0!important;box-shadow:none!important}
.crm-conversations{border-right:1px solid #e2e6e8!important;background:#fff!important}
.crm-sidebar-statusbar{height:38px;min-height:38px;padding:6px 13px!important;background:#fff!important;border-bottom:0!important}
.crm-mini-status{border:0!important;background:transparent!important;padding:3px 4px!important;font-size:10px!important}
.crm-mini-status.connected{background:transparent!important}
.crm-conversations-title.crm-pane-head{height:58px!important;min-height:58px!important;padding:9px 14px!important;background:#fff!important;border-bottom:0!important}
.crm-conversations-title strong{font-size:20px!important;color:#00a884!important;font-weight:800!important;letter-spacing:-.02em}
.crm-conversations-title small{font-size:10.5px!important;color:#81909a!important}
.crm-exit-compact{border:0!important;background:#f1f2f4!important;border-radius:999px!important;padding:7px 11px!important}
.crm-search-row{padding:5px 12px 8px!important;border:0!important;background:#fff!important}
.crm-search-row .crm-search{height:41px!important;border:0!important;border-radius:22px!important;background:#f0f2f5!important;padding:0 14px!important}
.crm-search-row .crm-search:before{content:"⌕";font-size:22px;color:#667781;line-height:1;transform:translateY(-1px)}
.crm-search-row .crm-search input{height:39px!important;min-height:39px!important;font-size:13px!important;color:#26343d!important;background:transparent!important}
.crm-tabs{padding:4px 12px 10px!important;border-bottom:1px solid #edf0f2!important;gap:7px!important;background:#fff!important;overflow-x:auto}
.crm-tabs button{border:1px solid #dfe4e7!important;background:#fff!important;border-radius:18px!important;padding:7px 11px!important;font-size:11.5px!important;color:#54656f!important;white-space:nowrap}
.crm-tabs button.active{background:#e7fce9!important;border-color:#a9dfb6!important;color:#087a42!important}
.crm-tabs b{background:#eaf0ed!important;color:#0c8d56!important}
.crm-tabs button.active b{background:#1fa855!important;color:#fff!important}
.crm-chat-list{background:#fff!important}
.crm-chat-row{grid-template-columns:52px minmax(0,1fr) auto!important;gap:10px!important;padding:10px 13px!important;border-bottom:1px solid #f0f2f3!important;background:#fff!important;min-height:73px}
.crm-chat-row:hover{background:#f5f6f6!important}
.crm-chat-row.active{background:#f0f2f5!important;box-shadow:none!important}
.crm-list-avatar{width:48px!important;height:48px!important;background:#e8f8ef!important;color:#11855e!important;border:1px solid #d0eddd!important;font-size:15px!important;font-weight:800!important}
.crm-row-copy{gap:1px!important}
.crm-v2 .crm-row-copy strong{font-size:14.5px!important;color:#17252e!important;font-weight:650!important}
.crm-row-phone{font-size:10px!important;color:#95a0a6!important;line-height:1.15!important}
.crm-v2 .crm-row-copy small:last-child{font-size:12px!important;color:#667781!important;white-space:nowrap!important;overflow:hidden!important;text-overflow:ellipsis!important;display:block!important}
.crm-row-meta{align-self:start!important;padding-top:3px!important}
.crm-row-meta time{font-size:10.5px!important;color:#78909a!important}
.crm-row-meta b{background:#25d366!important;color:#fff!important;min-width:19px!important;height:19px!important;font-size:9.5px!important}
.crm-chat-panel{background:#efeae2!important;border-right:1px solid #e2e6e8!important;position:relative!important}
.crm-chat-panel:before{content:"";position:absolute;inset:64px 0 0;pointer-events:none;opacity:.22;background-image:radial-gradient(circle at 2px 2px,rgba(95,108,99,.14) 1px,transparent 1.5px);background-size:28px 28px;z-index:0}
.crm-chat-head{height:64px!important;min-height:64px!important;padding:8px 14px!important;background:#f0f2f5!important;border-bottom:1px solid #e4e8ea!important;z-index:3!important}
.crm-chat-avatar{width:42px!important;height:42px!important;background:#dff5e8!important;color:#087a55!important;border:0!important}
.crm-chat-head>div:nth-child(2) strong{font-size:14.5px!important;color:#16242d!important;font-weight:650!important}
.crm-chat-head>div:nth-child(2) small{font-size:11px!important;color:#667781!important}
.crm-live-sync{display:inline-flex;align-items:center;gap:5px;padding:5px 8px;border-radius:999px;color:#0b8158;background:#e3f5eb;font-size:9.5px;font-weight:800;white-space:nowrap}
.crm-messages{position:relative;z-index:1;padding:18px clamp(18px,5vw,72px)!important;background:transparent!important}
.crm-bubble{box-shadow:0 1px 1px rgba(11,20,26,.08)!important;border-radius:8px!important}
.crm-bubble-wrap.from-client .crm-bubble{background:#fff!important}
.crm-bubble-wrap.from-me .crm-bubble{background:#d9fdd3!important}
.crm-v2 .crm-bubble p{font-size:13.5px!important;line-height:1.38!important;color:#172229!important}
.crm-v2 .crm-bubble time{font-size:9.5px!important;color:#73817e!important}
.crm-date-separator span{background:#fff!important;border:0!important;box-shadow:0 1px 1px rgba(11,20,26,.08)!important;color:#667781!important}
.crm-quick-replies{position:relative;z-index:2;padding:6px 10px!important;background:#f0f2f5!important;border-top:1px solid #e0e5e7!important;gap:6px!important}
.crm-quick-replies button{background:#fff!important;border:1px solid #d9dfe2!important;color:#40515b!important;border-radius:16px!important;font-size:10.5px!important;padding:6px 10px!important;font-weight:650!important}
.crm-quick-replies button:hover{border-color:#8fd8b5!important;color:#087a55!important;background:#f0fbf5!important}
.crm-composer{position:relative;z-index:2;background:#f0f2f5!important;border-top:0!important;padding:8px 11px!important;gap:7px!important}
.crm-composer textarea{background:#fff!important;border:0!important;border-radius:24px!important;min-height:43px!important;padding:11px 16px!important;font-size:13.5px!important;box-shadow:none!important}
.crm-emoji-button{color:#54656f!important}
.crm-send-button{width:43px!important;height:43px!important;min-width:43px!important;background:#00a884!important;box-shadow:none!important}
.crm-context{background:#f7f9fa!important}
.crm-context-section{padding:15px!important;border-bottom:1px solid #e5eaec!important}
.crm-client-card,.crm-extracted-fields,.crm-ai-summary{background:#fff!important;border:1px solid #e5eaec!important;border-radius:12px!important;box-shadow:none!important}
.crm-ai-provider{background:#e7f8ef!important;color:#087a55!important}

/* Editor de mensajes predeterminados */
.crm-preset-settings{margin-top:24px;padding-top:22px;border-top:1px solid var(--border)}
.crm-preset-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px}
.crm-preset-editor{border:1px solid #e0e7e4;border-radius:15px;background:#fbfdfc;padding:13px}
.crm-preset-editor-head{display:flex;align-items:center;gap:9px;margin-bottom:11px;color:#1e3f35}
.crm-preset-preview-icon{width:34px;height:34px;border-radius:10px;background:#e8f8ef;display:grid;place-items:center;font-size:18px;flex:0 0 auto}
.crm-preset-editor-head strong{font-size:14px}
.crm-preset-fields{grid-template-columns:100px minmax(0,1fr)!important;gap:10px!important}
.crm-preset-fields textarea{min-height:84px;resize:vertical}

@media(max-width:1200px){
  body.crm-focus-mode .crm-layout{grid-template-columns:310px minmax(470px,1fr)!important}
  body.crm-focus-mode .crm-context{grid-column:1/-1!important;display:grid!important;grid-template-columns:1fr 1fr!important;max-height:none!important}
}
@media(max-width:820px){
  body.crm-focus-mode .crm-layout{display:flex!important;border-radius:0!important;border-left:0;border-right:0}
  .crm-conversations{min-height:360px!important;max-height:420px!important}
  .crm-chat-panel{min-height:680px!important;border-right:0!important}
  .crm-context{display:flex!important}
  .crm-preset-grid{grid-template-columns:1fr}
  .crm-preset-fields{grid-template-columns:82px minmax(0,1fr)!important}
}


/* v1.13.12 · teléfonos internacionales + ajustes compactos del CRM */
.crm-search-row .crm-search:before{content:none!important;display:none!important}
.crm-search-row .crm-search{padding-left:13px!important}
.crm-tabs{padding:3px 12px 7px!important;gap:4px!important}
.crm-tabs button{border-radius:14px!important;padding:4px 8px!important;font-size:10.5px!important;line-height:1.15!important}
.crm-tabs b{font-size:8.5px!important;min-width:16px!important;height:16px!important;margin-left:2px!important;padding:0 4px!important}
.phone-input-wrap{display:grid;grid-template-columns:minmax(150px,.9fr) minmax(0,1.1fr);gap:8px;align-items:center}
.phone-input-wrap select,.phone-input-wrap input{width:100%;min-width:0}
.phone-input-wrap select{font-size:12px}
.crm-service-form .phone-input-wrap-crm{grid-template-columns:minmax(145px,.95fr) minmax(0,1.05fr)}
@media(max-width:620px){
  .phone-input-wrap,.crm-service-form .phone-input-wrap-crm{grid-template-columns:minmax(130px,.95fr) minmax(0,1.05fr);gap:6px}
  .phone-input-wrap select{font-size:11px;padding-left:8px;padding-right:24px}
}


/* v1.13.13 · lista de conversaciones en dos líneas estilo WhatsApp Web */
.crm-v2,
.crm-v2 button,
.crm-v2 input,
.crm-v2 textarea,
.crm-v2 select{
  font-family:"Segoe UI","Helvetica Neue",Helvetica,Arial,sans-serif!important;
}
.crm-v2 .crm-chat-row{
  min-height:72px!important;
  padding:10px 13px!important;
  grid-template-columns:49px minmax(0,1fr) auto!important;
  gap:11px!important;
}
.crm-v2 .crm-list-avatar{
  width:49px!important;
  height:49px!important;
}
.crm-v2 .crm-row-copy{
  min-width:0!important;
  display:flex!important;
  flex-direction:column!important;
  justify-content:center!important;
  gap:2px!important;
}
.crm-v2 .crm-row-copy strong{
  display:block!important;
  min-width:0!important;
  overflow:hidden!important;
  text-overflow:ellipsis!important;
  white-space:nowrap!important;
  font-family:"Segoe UI","Helvetica Neue",Helvetica,Arial,sans-serif!important;
  font-size:16px!important;
  line-height:21px!important;
  font-weight:400!important;
  color:#111b21!important;
}
.crm-v2 .crm-row-copy .crm-row-preview,
.crm-v2 .crm-row-copy small:last-child{
  display:block!important;
  min-width:0!important;
  overflow:hidden!important;
  text-overflow:ellipsis!important;
  white-space:nowrap!important;
  font-family:"Segoe UI","Helvetica Neue",Helvetica,Arial,sans-serif!important;
  font-size:14px!important;
  line-height:20px!important;
  font-weight:400!important;
  color:#667781!important;
}
.crm-v2 .crm-row-phone{display:none!important}
.crm-v2 .crm-row-meta{
  align-self:stretch!important;
  padding-top:1px!important;
  display:flex!important;
  flex-direction:column!important;
  align-items:flex-end!important;
  justify-content:flex-start!important;
  gap:7px!important;
}
.crm-v2 .crm-row-meta time{
  font-family:"Segoe UI","Helvetica Neue",Helvetica,Arial,sans-serif!important;
  font-size:12px!important;
  line-height:18px!important;
  font-weight:400!important;
  color:#667781!important;
}


/* v1.13.14 · fotos reales de contactos Chatwoot/WhatsApp */
.crm-contact-avatar{
  position:relative!important;
  display:grid!important;
  place-items:center!important;
  overflow:hidden!important;
  border-radius:50%!important;
  flex:0 0 auto!important;
  background:#e8f8ef!important;
  color:#11855e!important;
}
.crm-contact-avatar>img{
  width:100%!important;
  height:100%!important;
  display:block!important;
  object-fit:cover!important;
  object-position:center!important;
  border-radius:inherit!important;
}
.crm-contact-avatar>.crm-avatar-fallback,
.crm-contact-avatar.crm-avatar-fallback{
  width:100%!important;
  height:100%!important;
  place-items:center!important;
  font:800 15px/1 "Segoe UI","Helvetica Neue",Helvetica,Arial,sans-serif!important;
  color:#11855e!important;
  background:#e8f8ef!important;
  text-transform:uppercase!important;
}
.crm-v2 .crm-list-avatar.crm-contact-avatar{width:49px!important;height:49px!important;border:1px solid #d0eddd!important}
.crm-v2 .crm-chat-avatar.crm-contact-avatar{width:42px!important;height:42px!important;border:0!important;background:#dff5e8!important}
.crm-v2 .crm-chat-avatar.crm-contact-avatar>.crm-avatar-fallback{font-size:13px!important;color:#087a55!important;background:#dff5e8!important}
.autoresponder-panel-head{align-items:flex-start;gap:18px}
.autoresponder-header-toggle{display:flex;align-items:center;gap:12px;padding:9px 11px 9px 14px;border:1px solid #dce5e1;border-radius:14px;background:#f7fbf9;cursor:pointer;flex:0 0 auto}
.autoresponder-header-toggle>span:first-child{display:grid;gap:1px;text-align:right}
.autoresponder-header-toggle strong{font-size:13px;color:#183f35}
.autoresponder-header-toggle small{font-size:10px;color:var(--muted)}
@media(max-width:760px){.autoresponder-panel-head{align-items:stretch}.autoresponder-header-toggle{width:100%;justify-content:space-between}.autoresponder-header-toggle>span:first-child{text-align:left}}


/* v1.13.16: reporte compacto + filtros de clientes */
.report-hero .eyebrow{font-size:9px;line-height:1;margin:0;letter-spacing:.08em}
.clients-list-head{align-items:center;gap:14px}
.clients-head-actions{display:flex;gap:8px;flex-wrap:wrap}
.clients-filter-form{display:grid;grid-template-columns:minmax(240px,1.6fr) repeat(4,minmax(135px,.72fr));gap:10px;align-items:end;padding:13px;margin:0 0 16px;border:1px solid var(--line);border-radius:14px;background:#f8fafc}
.clients-filter-form label{font-size:11px;font-weight:750;color:#526175;min-width:0}
.clients-filter-form input,.clients-filter-form select{margin-top:5px}
.clients-filter-search{grid-column:span 2}
.clients-filter-actions{display:flex;gap:8px;align-items:center}
@media(max-width:1180px){.clients-filter-form{grid-template-columns:repeat(3,minmax(0,1fr))}.clients-filter-search{grid-column:span 2}}
@media(max-width:720px){.clients-list-head{align-items:stretch;flex-direction:column}.clients-head-actions{width:100%}.clients-head-actions .button{flex:1}.clients-filter-form{grid-template-columns:1fr 1fr}.clients-filter-search{grid-column:1/-1}.clients-filter-actions{grid-column:1/-1}.report-hero{padding:9px 11px}.report-month-nav h2{font-size:17px}}
@media(max-width:480px){.clients-filter-form{grid-template-columns:1fr}.clients-filter-search,.clients-filter-actions{grid-column:auto}}

.report-scope-inline{display:flex;flex-direction:column;gap:4px;min-width:245px}
.report-scope-inline>small{font-size:9px;line-height:1;color:var(--muted);font-weight:800;text-transform:uppercase;letter-spacing:.055em}
.report-scope-inline .origin-switch{white-space:nowrap}
.report-scope-inline .origin-switch a{padding:7px 10px;font-size:10px}


/* v1.13.19 · popup universal Agregar servicio con IA + formulario */
.panel-head-actions,.calendar-toolbar-actions{display:flex;align-items:center;gap:8px;flex-wrap:wrap}
.calendar-add-service{min-height:36px}
.crm-add-service-button{padding:7px 10px!important;font-size:11px!important;white-space:nowrap}
.hl-service-dialog{overflow:hidden!important;display:flex!important;flex-direction:column!important}
.hl-service-dialog-head{flex:0 0 auto}
.hl-service-tabs{display:grid;grid-template-columns:1fr 1fr;gap:7px;padding:10px 18px;background:#fff;border-bottom:1px solid #e7eeea;flex:0 0 auto}
.hl-service-tabs button{border:1px solid #d9e3df;background:#f5f8f7;color:#52665f;border-radius:11px;padding:9px 11px;font-weight:800;font-size:12px;cursor:pointer;transition:.15s ease}
.hl-service-tabs button.active{background:#e9f8f2;border-color:#92d9bd;color:#08724f;box-shadow:0 0 0 2px rgba(28,169,122,.07)}
.hl-service-tab-panel{display:none;min-height:0;overflow:auto}
.hl-service-tab-panel.active{display:block}
#hlServicePanelAi{padding:18px 22px 22px}
.hl-service-ai-label{display:grid;gap:7px;font-size:12px;font-weight:800;color:#31443d}
.hl-service-ai-label textarea{width:100%;min-height:230px;resize:vertical;border:1px solid #d7e1dd;border-radius:12px;padding:12px 13px;font:500 13px/1.45 inherit;color:#1f332c;background:#fff;outline:none}
.hl-service-ai-label textarea:focus{border-color:#1ca97a;box-shadow:0 0 0 3px rgba(28,169,122,.12)}
.hl-service-ai-warning{margin:12px 0 0}
.hl-service-ai-result{margin-top:12px}.hl-service-ai-result .alert{margin:0}
.hl-service-ai-loading{padding:11px 13px;border-radius:11px;background:#f1f5f4;color:#53665f;font-size:12px;font-weight:700}
.hl-service-ai-actions{display:flex;justify-content:flex-end;gap:9px;margin-top:14px;position:sticky;bottom:0;padding-top:10px;background:linear-gradient(180deg,rgba(255,255,255,0),#fff 24%)}
.hl-service-form{overflow:auto}
@media(max-width:760px){
  .panel-head-actions{width:100%}.panel-head-actions .button{flex:1}
  .calendar-toolbar-actions{width:100%;display:grid;grid-template-columns:1fr 1fr}.calendar-toolbar-actions>*{width:100%;text-align:center}
  .crm-chat-head-actions{gap:5px!important}.crm-add-service-button{font-size:0!important;width:35px!important;height:35px!important;padding:0!important;border-radius:50%!important;display:grid!important;place-items:center!important}.crm-add-service-button::after{content:'+';font-size:22px;line-height:1;font-weight:800}
  #crmServiceModal.crm-service-modal{padding:0!important;align-items:flex-end!important}
  #crmServiceModal .crm-service-dialog{width:100%!important;max-height:96dvh!important;height:min(96dvh,900px)!important;border-radius:18px 18px 0 0!important;margin:0!important}
  #crmServiceModal .crm-service-dialog-head{padding:12px 14px 10px!important}.crm-service-dialog-head h3{font-size:17px!important}.crm-service-dialog-head p{font-size:11px!important;line-height:1.3!important}
  .hl-service-tabs{padding:8px 10px;gap:6px}.hl-service-tabs button{padding:8px 7px;font-size:10.5px}
  #hlServicePanelAi{padding:13px 12px 16px}.hl-service-ai-label textarea{min-height:210px}
  #crmServiceModal .crm-service-form{padding:12px!important}.crm-service-grid{gap:10px!important}.crm-service-grid label{font-size:11.5px!important;gap:4px!important}.crm-service-grid input,.crm-service-grid select,.crm-service-grid textarea{padding:9px 10px!important;font-size:13px!important}
  #crmServiceModal .crm-service-actions{margin:10px -12px -12px!important;padding:10px 12px!important}.hl-service-ai-actions{display:grid;grid-template-columns:1fr}.hl-service-ai-actions .button{width:100%;padding-left:8px;padding-right:8px;font-size:11px}
}
@media(max-width:420px){.calendar-toolbar-actions{grid-template-columns:1fr}.hl-service-tabs button{font-size:10px}.crm-service-dialog-head p{display:none}}

/* v1.13.20 · acciones CRM juntas */
@media(max-width:760px){.crm-ai-actions{grid-template-columns:1fr 1fr;gap:6px}.crm-ai-actions .button{font-size:11px!important;padding:9px 6px!important;white-space:normal!important;text-align:center;line-height:1.15}.crm-ai-actions .crm-availability-trigger{grid-column:1/-1}}



/* v1.13.22 · CRM separado y horas del colaborador */
.crm-extraction-card{background:#fbfaff}
.crm-extract-primary{margin-top:10px;display:grid;grid-template-columns:1fr}
.crm-extract-primary .button{width:100%;justify-content:center}
.crm-service-tools-card{background:#f8fafc!important}
.crm-service-tools-card .eyebrow{display:block;margin-bottom:9px}
.crm-service-actions{display:grid;grid-template-columns:1fr 1fr;gap:8px}
.crm-service-actions .button{width:100%;min-width:0;justify-content:center}
.schedule-slot-settings-grid{display:grid;grid-template-columns:repeat(5,minmax(0,1fr));gap:9px}
.schedule-slot-setting{display:flex;align-items:center;gap:9px;padding:11px;border:1px solid var(--line);border-radius:11px;background:#fff;cursor:pointer;transition:.15s ease}
.schedule-slot-setting input{width:17px;height:17px;accent-color:#255eb2;flex:0 0 auto}
.schedule-slot-setting span{display:grid;gap:2px}.schedule-slot-setting strong{font-size:12px;color:#26394e}.schedule-slot-setting small{font-size:8.5px;color:#7b8998}
.schedule-slot-setting:has(input:checked){border-color:#9fc0ee;background:#f1f6ff;box-shadow:inset 0 0 0 1px #d7e7fb}
@media(max-width:760px){
  .crm-service-actions{grid-template-columns:1fr 1fr}.crm-service-actions .button{font-size:11px!important;padding:9px 7px!important;white-space:normal!important}
  .schedule-slot-settings-grid{grid-template-columns:repeat(2,minmax(0,1fr))}
}
@media(max-width:420px){.schedule-slot-settings-grid{grid-template-columns:1fr}}


/* v1.13.27 · popup de disponibilidad reconstruido desde cero */
.crm-agenda-main-actions{
  display:grid;
  grid-template-columns:repeat(2,minmax(0,1fr));
  gap:10px;
}
.crm-agenda-main-actions .button{
  width:100%;
  min-width:0;
  min-height:42px;
  justify-content:center;
}
.crm-agenda-extract-action{
  margin-top:22px;
  padding-top:18px;
  border-top:1px solid #dfe7ee;
}
.crm-agenda-extract-action .button{
  width:100%;
  min-height:42px;
  justify-content:center;
}

.crm-schedule-modal{
  display:none;
  position:fixed;
  inset:0;
  z-index:100030;
  align-items:center;
  justify-content:center;
  padding:18px;
}
.crm-schedule-modal.open{display:flex}
.crm-schedule-backdrop{
  position:absolute;
  inset:0;
  background:rgba(11,25,39,.50);
  backdrop-filter:blur(5px);
}
.crm-schedule-dialog{
  position:relative;
  z-index:1;
  width:min(760px,calc(100vw - 36px));
  max-height:min(760px,92dvh);
  display:flex;
  flex-direction:column;
  overflow:hidden;
  background:#f7f9fb;
  border:1px solid #dfe6ed;
  border-radius:20px;
  box-shadow:0 26px 72px rgba(10,30,48,.24);
}
.crm-schedule-header{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:14px;
  flex:0 0 auto;
  padding:14px 16px;
  background:#fff;
  border-bottom:1px solid #e9eef2;
}
.crm-schedule-header>div{min-width:0}
.crm-schedule-kicker{
  display:block;
  margin-bottom:2px;
  color:#83909d;
  font-size:9px;
  font-weight:850;
  line-height:1;
  text-transform:uppercase;
  letter-spacing:.08em;
}
.crm-schedule-header h3{
  margin:0;
  color:#213447;
  font-size:18px;
  line-height:1.15;
}
.crm-schedule-close{
  width:34px;
  height:34px;
  flex:0 0 auto;
  display:grid;
  place-items:center;
  border:0;
  border-radius:11px;
  background:#eef2f5;
  color:#536273;
  font-size:22px;
  line-height:1;
  cursor:pointer;
}
.crm-schedule-close:hover{background:#e4e9ee}
.crm-schedule-collaborator{
  flex:0 0 auto;
  display:grid;
  grid-template-columns:auto minmax(220px,360px);
  align-items:center;
  justify-content:start;
  gap:10px;
  padding:10px 16px;
  background:#fff;
  border-bottom:1px solid #e9eef2;
}
.crm-schedule-collaborator label{
  color:#607080;
  font-size:10px;
  font-weight:850;
}
.crm-schedule-collaborator select{
  width:100%;
  min-height:38px;
  border:1px solid #d7dfe7;
  border-radius:10px;
  padding:7px 10px;
  background:#fff;
  color:#24384a;
  font:inherit;
  font-size:12px;
  font-weight:700;
}
.crm-schedule-days{
  flex:1 1 auto;
  min-height:0;
  overflow-y:auto;
  display:grid;
  grid-template-columns:repeat(3,minmax(0,1fr));
  align-items:start;
  gap:10px;
  padding:12px;
}
.crm-schedule-day{
  min-width:0;
  overflow:hidden;
  background:#fff;
  border:1px solid #e2e8ee;
  border-radius:14px;
  box-shadow:0 2px 8px rgba(22,42,61,.035);
}
.crm-schedule-day h4{
  margin:0;
  min-height:43px;
  display:flex;
  align-items:center;
  justify-content:center;
  padding:8px 5px;
  background:#f8fafc;
  border-bottom:1px solid #e8edf2;
  color:#2c4154;
  font-size:11px;
  font-weight:900;
  line-height:1.15;
  text-align:center;
}
.crm-schedule-hours{
  display:grid;
  grid-template-columns:1fr;
  gap:5px;
  padding:7px;
}
.crm-schedule-slot{
  min-height:31px;
  display:flex;
  align-items:center;
  justify-content:center;
  padding:5px 3px;
  border-radius:8px;
  border:1px solid transparent;
  font-size:10px;
  font-weight:900;
  line-height:1;
  white-space:nowrap;
}
.crm-schedule-slot.is-free{
  background:#dff6e8;
  border-color:#b9e5ca;
  color:#176b42;
}
.crm-schedule-slot.is-busy{
  background:#fde3e3;
  border-color:#f0bfc0;
  color:#a63c3f;
}
.crm-schedule-day-empty{
  padding:15px 5px;
  color:#86929d;
  font-size:9px;
  text-align:center;
}
.crm-schedule-message{
  grid-column:1/-1;
  padding:28px 15px;
  border:1px dashed #d6dfe7;
  border-radius:12px;
  background:#fff;
  color:#778692;
  font-size:11px;
  line-height:1.4;
  text-align:center;
}
.crm-schedule-navigation{
  flex:0 0 auto;
  display:grid;
  grid-template-columns:1fr 1fr;
  gap:10px;
  padding:10px 12px 12px;
  background:#fff;
  border-top:1px solid #e5ebf0;
}
.crm-schedule-nav{
  min-height:38px;
  border:1px solid #d6dfe7;
  border-radius:10px;
  background:#fff;
  color:#40566a;
  padding:7px 10px;
  font-size:10px;
  font-weight:850;
  cursor:pointer;
}
.crm-schedule-nav:hover{background:#f4f7f9}
.crm-schedule-nav-next{
  background:#edf4ff;
  border-color:#cbdcf5;
  color:#28558d;
}
.crm-schedule-nav:disabled{
  opacity:.34;
  cursor:not-allowed;
}

@media(max-width:760px){
  .crm-agenda-main-actions{gap:8px}
  .crm-agenda-main-actions .button,.crm-agenda-extract-action .button{
    min-height:40px;
    padding-left:7px!important;
    padding-right:7px!important;
    font-size:10.5px!important;
    white-space:normal!important;
    text-align:center;
  }
  .crm-agenda-extract-action{margin-top:26px;padding-top:20px}
  .crm-schedule-modal{align-items:flex-end;padding:0}
  .crm-schedule-dialog{
    width:100%;
    max-height:94dvh;
    border-radius:20px 20px 0 0;
    border-left:0;
    border-right:0;
    border-bottom:0;
  }
  .crm-schedule-header{padding:12px 13px 10px}
  .crm-schedule-header h3{font-size:16.5px}
  .crm-schedule-collaborator{
    grid-template-columns:1fr;
    gap:5px;
    padding:8px 10px;
  }
  .crm-schedule-days{
    grid-template-columns:repeat(3,minmax(0,1fr));
    gap:5px;
    padding:8px 6px;
  }
  .crm-schedule-day{border-radius:10px}
  .crm-schedule-day h4{
    min-height:44px;
    padding:6px 2px;
    font-size:8.3px;
    line-height:1.12;
  }
  .crm-schedule-hours{gap:4px;padding:5px}
  .crm-schedule-slot{
    min-height:28px;
    padding:4px 1px;
    border-radius:7px;
    font-size:8.8px;
  }
  .crm-schedule-navigation{gap:7px;padding:8px 8px 10px}
  .crm-schedule-nav{min-height:36px;padding:6px 5px;font-size:8.6px}
}
@media(max-width:390px){
  .crm-schedule-days{gap:4px;padding-left:5px;padding-right:5px}
  .crm-schedule-day h4{font-size:7.8px}
  .crm-schedule-slot{font-size:8.2px}
  .crm-schedule-nav{font-size:8px}
}

/* v1.13.28 · horarios por colaborador + aceptación inmediata en CRM */
.acceptance-modal-backdrop{z-index:100080}
#appointmentCollaborator:disabled,#appointmentDate:disabled,#appointmentTime:disabled,
#crmServiceCollaborator:disabled,#crmServiceDate:disabled,#crmServiceTime:disabled{opacity:.62;cursor:not-allowed;background:#f3f5f7}
#appointmentTime option,#crmServiceTime option{font-variant-numeric:tabular-nums}
