.intro{align-items:center}
.intro-actions{display:flex;align-items:center;gap:10px;flex-wrap:wrap}
.intro-actions .primary{min-height:48px;padding-inline:20px}
.stats{grid-template-columns:repeat(2,minmax(0,1fr));max-width:640px;gap:12px;margin-bottom:28px}
.stat{padding:20px 22px;border-radius:15px}
.stat strong{font-size:2.15rem}
.stat span{display:block;font-size:1rem;font-weight:800;color:#233e5b;margin-top:6px}
.stat small{display:block;color:#61758c;font-size:.78rem;line-height:1.35;margin-top:4px}
.library-head{display:flex;align-items:end;justify-content:space-between;gap:18px;margin-bottom:13px}
.library-head h2{font-size:1.45rem;margin:4px 0 0;letter-spacing:-.02em}
.library-head .search{width:min(350px,100%);font-size:.82rem;font-weight:700;color:#36516d}
.library-head .search input{margin-top:5px}
.case-filters{margin:0 0 12px}
.case-filters button{min-width:112px;min-height:44px;font-size:.9rem}
.library-panel{margin-bottom:22px}
.library-panel td:first-child small{overflow-wrap:anywhere}
.client-records{display:grid;gap:10px}
.client-record{min-width:0;overflow:hidden;background:#fff;border:1px solid #d9e5f2;border-radius:15px;box-shadow:0 5px 18px #1839640b}
.client-record:not(.trash-record){border-left:4px solid var(--creator-accent,#0b55a3)}
.record-top{display:flex;align-items:center;gap:13px;min-height:84px;padding:15px 18px}
.person-avatar{display:grid;flex:none;place-items:center;width:43px;height:43px;border-radius:13px;background:#dce9f7;color:#14569c;font-weight:900;font-size:1.05rem}
.person-avatar img{width:100%;height:100%;object-fit:cover;border-radius:inherit}
.person-avatar svg{width:24px;height:24px;color:#fff}
.profile-preview{display:flex;align-items:center;gap:13px;margin:20px 0;padding:14px;border:1px solid #dbe7f3;border-radius:13px}
.profile-preview .person-avatar{width:56px;height:56px;font-size:1.45rem;color:#fff}
.profile-preview strong{font-size:1.1rem}
#profileForm input[type=color]{display:block;width:76px;height:48px;margin-top:8px;padding:4px;border:1px solid #c7d6e7;border-radius:8px;background:#fff}
#profileForm input[type=file]{display:block;width:100%;margin-top:8px}
#profileForm #removePhotoBtn{margin-top:10px}
.record-info{display:grid;min-width:0;flex:1;gap:4px}
.record-info strong{font-size:1.03rem;line-height:1.25;overflow-wrap:anywhere}
.record-info .client-name{justify-self:start;max-width:100%;padding:3px 8px;border-radius:6px;background:color-mix(in srgb,var(--creator-accent,#0b55a3) 12%,white);color:#16324f;font-weight:900}
.record-by{color:#526b86;font-size:.82rem;line-height:1.35;overflow-wrap:anywhere}
.record-progress{flex:0 1 238px;display:grid;gap:7px;min-width:205px;max-width:238px;padding:4px 0}
.record-progress-row{display:grid;grid-template-columns:62px minmax(35px,1fr) 74px;align-items:center;gap:7px;min-width:0;color:#526b86;font-size:.78rem;line-height:1.2}
.record-progress-row>span:first-child{font-weight:700}
.record-progress-row strong{text-align:right;color:#1b4775;font-size:.8rem;font-variant-numeric:tabular-nums;white-space:nowrap}
.record-progress-row:last-child strong:not(:first-child){font-size:.75rem}
.record-progress-track{display:block;height:4px;min-width:0;overflow:hidden;border-radius:999px;background:#e4ebf3}
.record-progress-fill{display:block;height:100%;border-radius:inherit;background:#2b70b1;transition:width .25s ease}
.record-progress-row:last-child .record-progress-fill{background:#20927d}
.record-open{flex:none;border:1px solid #0b55a3;background:#0b55a3;color:#fff;font-weight:800;border-radius:9px;padding:10px 15px;min-height:40px}
.record-open:hover{background:#08417d}
.record-actions{margin-left:auto;display:flex;align-items:center;gap:8px}
.record-forward{grid-column:1/-1;justify-self:start;min-height:42px;border:1px solid #bdd4ed;border-radius:9px;background:#f3f8ff;color:#15549b;font-weight:700;padding:8px 12px;cursor:pointer}
.record-forward:hover{background:#dfefff}
.record-details{border-top:1px solid #edf2f8}
.record-details summary{display:flex;align-items:center;min-height:44px;cursor:pointer;padding:10px 18px;color:#0b55a3;font-size:.88rem;font-weight:800;list-style:none}
.record-details summary::-webkit-details-marker{display:none}
.record-details summary:before{content:'⌄';display:inline-block;margin-right:9px;transition:transform .2s}
.record-details[open] summary:before{transform:rotate(180deg)}
.record-content{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:10px;padding:4px 18px 16px}
.record-field{display:grid;align-content:start;gap:4px;min-width:0;color:#1d3854;font-size:.87rem;overflow-wrap:anywhere}
.record-field small{color:#667e97;font-size:.68rem;text-transform:uppercase;letter-spacing:.08em;font-weight:800}
.record-whatsapp{grid-column:1/-1;justify-self:start;margin-top:3px}
.record-delete{grid-column:1/-1;justify-self:start;border:1px solid #e7b3ae;background:#fff6f4;color:#9b3029;font-weight:800;border-radius:9px;padding:9px 13px;min-height:40px}
.record-delete:hover{background:#fce9e5}
.trash-view{max-width:960px;margin:0 auto}
.trash-view h1{margin:8px 0}
.trash-view p{color:#526b86}
.trash-record{display:flex;align-items:center;gap:16px;justify-content:space-between;padding:16px 18px}
@media(max-width:540px){.trash-record{align-items:stretch;flex-direction:column}.trash-record .record-open{align-self:flex-start}}
.account-menu{position:relative}
.account-menu summary{list-style:none;cursor:pointer;border:1px solid #8bb2db;border-radius:9px;padding:7px 12px;font-weight:700;max-width:320px;overflow-wrap:anywhere}
.account-menu summary::-webkit-details-marker{display:none}
.account-menu summary:after{content:'⌄';margin-left:8px;opacity:.8}
.account-options{position:absolute;right:0;top:calc(100% + 6px);z-index:30;display:grid;gap:5px;min-width:160px;padding:8px;background:#fff;border:1px solid #d4e1ef;border-radius:11px;box-shadow:0 10px 28px #102e4c29}
.top .account-options button{color:#19446f;background:#fff;border:0;text-align:left;margin:0}
.top .account-options button:hover{background:#edf5fe}
.performance{margin:22px 0}
.performance h2{font-size:1.35rem;margin:4px 0 7px}
.performance p{margin-bottom:17px}
.chart-legend{display:flex;gap:20px;flex-wrap:wrap;color:#4e6580;font-size:.82rem;margin-bottom:15px}
.chart-legend span:before{content:'';display:inline-block;width:10px;height:10px;border-radius:3px;background:#1c67ad;margin-right:6px}
.chart-legend span:last-child:before{background:#20a083}
.sales-chart{display:grid;gap:15px}
.sales-row{display:grid;grid-template-columns:minmax(150px,220px) minmax(0,1fr);align-items:center;gap:16px}
.sales-name{font-weight:800;color:#263f59;overflow-wrap:anywhere}
.sales-bars{display:grid;gap:5px}
.sales-bar{position:relative;display:flex;align-items:center;justify-content:flex-end;height:19px;background:#eaf1f8;border-radius:5px;overflow:hidden}
.sales-bar .bar-fill{position:absolute;left:0;top:0;bottom:0;min-width:0;background:#1c67ad;border-radius:5px}
.sales-bar.closed .bar-fill{background:#20a083}
.sales-bar .bar-value{position:relative;z-index:1;font-size:.72rem;margin-right:8px;color:#1d344f}
.performance-details{border-top:1px solid #e2ebf5;margin-top:20px;padding-top:15px}
.performance-details summary{cursor:pointer;color:#0b55a3;font-weight:800}
.performance-details #userCounts{margin-top:10px}
.performance-details .count-row small{color:#60778f;font-size:.78rem}
.history-card{margin:22px 0;padding:0;overflow:hidden}
.history-card>summary{cursor:pointer;list-style:none;display:flex;justify-content:space-between;align-items:center;padding:19px 24px}
.history-card>summary::-webkit-details-marker{display:none}
.history-card>summary:after{content:'Mostrar';font-size:.8rem;font-weight:800;color:#0b55a3}
.history-card[open]>summary:after{content:'Ocultar'}
.history-card>summary strong,.history-card>summary small{display:block}
.history-card>summary small{color:#60758d;font-size:.82rem;margin-top:3px}
.history-filters{padding:0 24px 14px}
.history-card .list-wrap{border-top:1px solid #e5edf6}
#historyBlock[hidden],#adminChart[hidden]{display:none}
@media(max-width:700px){
  .intro-actions{width:100%}
  .intro-actions button{flex:1 1 100%;min-height:46px}
  .stats{max-width:none}
  .library-head{align-items:stretch;flex-direction:column;gap:12px}
  .library-head .search{width:100%}
  .sales-row{grid-template-columns:1fr;gap:7px}
  .sales-bars{width:100%}
  .history-card>summary{padding:17px}
  .history-filters{padding:0 14px 12px}
  .account-menu summary{max-width:calc(100vw - 28px)}
  .record-top{display:grid;grid-template-columns:40px minmax(0,1fr);gap:10px;padding:13px}
  .person-avatar{width:40px;height:40px}
  .stats .stat span{font-size:.88rem}
  .stats .stat small{font-size:.84rem}
  .record-info strong{font-size:1.07rem}
  .record-by{font-size:.9rem}
  .record-progress{grid-column:2;width:100%;max-width:310px;min-width:0;gap:8px;padding:3px 0}
  .record-progress-row{grid-template-columns:62px minmax(35px,1fr) 74px;font-size:.8rem}
  .record-open{grid-column:2;justify-self:start;min-height:44px;padding:9px 13px;font-size:.94rem}
  .record-actions{grid-column:2;margin-left:0}
  .record-details summary{padding:10px 13px;font-size:.92rem}
  .record-delete,.record-whatsapp{min-height:44px}
  .record-content{grid-template-columns:repeat(2,minmax(0,1fr));padding:4px 13px 14px}
}
