:root{
  --ink:#0d0b08;--paper:#fff9ef;--sand:#f0d1a3;--sand2:#f8e6c9;--accent:#b7772d;
  --ok:#208047;--warn:#d98806;--bad:#b42318;--muted:#746958;--line:#ead6b8;
  --shadow:0 18px 50px rgba(20,13,5,.13)
}
*{box-sizing:border-box;min-width:0}
html,body{margin:0;width:100%;max-width:100%;overflow-x:hidden;font-family:system-ui,-apple-system,Segoe UI,Roboto,Arial,sans-serif;background:linear-gradient(135deg,var(--paper),#f4d9b0);color:var(--ink);touch-action:manipulation;-webkit-text-size-adjust:100%}
button,input,select,textarea{font:inherit;max-width:100%}a{color:inherit}.login-body{min-height:100vh;display:grid;place-items:center;padding:24px}.login-shell{width:min(1050px,100%);display:grid;grid-template-columns:1.05fr .95fr;gap:28px;align-items:center}.brand-card,.login-card,.panel{background:rgba(255,249,239,.94);border:1px solid rgba(13,11,8,.08);border-radius:28px;box-shadow:var(--shadow);padding:28px}.brand-card{text-align:center}.login-logo{width:190px;max-width:70%;border-radius:18px;box-shadow:0 10px 25px rgba(0,0,0,.10)}.brand-card h1,.login-card h1{font-size:clamp(2rem,5vw,4rem);margin:.3em 0 .1em}.brand-card p,.muted{color:var(--muted)}.small{font-size:.9rem}.stack{display:grid;gap:12px}.segmented{display:grid;grid-template-columns:1fr 1fr;background:var(--sand2);padding:6px;border-radius:16px;gap:6px}.segmented label{display:flex;gap:7px;align-items:center;justify-content:center;border-radius:12px;padding:10px;background:#fff8}input,select,textarea{width:100%;border:1px solid var(--line);border-radius:12px;padding:10px 12px;background:#fff;color:var(--ink)}textarea{min-height:75px}.btn{display:inline-flex;align-items:center;justify-content:center;gap:8px;border:0;border-radius:13px;padding:10px 14px;background:#ede0cb;color:var(--ink);font-weight:800;text-decoration:none;cursor:pointer}.btn.primary,.btn.publish{background:var(--ink);color:#fff}.btn.publish{background:var(--ok)}.danger-btn{background:#fee4e2;color:var(--bad)}.alert{padding:13px 15px;border-radius:15px;margin:10px 0;font-weight:750}.alert.ok,.okline{background:#dcfae6;color:#075e35}.alert.danger{background:#fee4e2;color:#912018}.alert.warn,.status-row.warn{background:#fef0c7;color:#93370d}.topbar{position:sticky;top:0;z-index:20;display:flex;align-items:center;justify-content:space-between;gap:18px;padding:10px 18px;background:rgba(13,11,8,.96);color:white;box-shadow:0 8px 30px rgba(0,0,0,.18);max-width:100%}.topbrand{display:flex;align-items:center;gap:12px}.topbrand img{width:54px;height:54px;object-fit:cover;border-radius:12px;background:var(--sand)}.topbrand span{display:block;color:#d9c7ab;font-size:.88rem}.topbar nav{display:flex;gap:8px;flex-wrap:wrap;justify-content:flex-end}.topbar nav a{padding:8px 10px;border-radius:10px;text-decoration:none;color:#fff;background:rgba(255,255,255,.08);white-space:nowrap}.topbar nav a.active{background:var(--sand);color:var(--ink)}.admin-wrap,.worker-wrap{width:min(1500px,100%);margin:auto;padding:22px;display:grid;gap:22px}.panel h1,.panel h2{margin-top:0}.panel-head{display:flex;align-items:flex-start;justify-content:space-between;gap:20px}.toolbar,.actions-line,.inline-form{display:flex;gap:12px;align-items:end;flex-wrap:wrap;margin:12px 0}.toolbar label{min-width:190px;flex:1}.status-row{padding:12px 15px;border-radius:15px;margin:12px 0;font-weight:800}.table-scroll{overflow:auto;border-radius:18px;border:1px solid var(--line);background:white;max-width:100%}table{width:100%;border-collapse:collapse;background:white}th,td{border-bottom:1px solid var(--line);padding:10px;text-align:left;vertical-align:top}thead th{position:sticky;top:0;background:#fff3dd;z-index:1}.schedule-table{min-width:1250px}.schedule-table th:first-child,.schedule-table td:first-child{position:sticky;left:0;background:#fffaf1;z-index:2}.worker-head{min-width:160px}.worker-head span{display:block;font-size:.83rem;color:var(--muted);font-weight:600}.shift-cell{min-width:150px}.mobile-day{display:none}.shift-cell .times{display:grid;grid-template-columns:1fr 1fr;gap:6px;margin:7px 0}.shift-cell .note{font-size:.88rem}.shift-cell.not-work .times,.shift-cell.not-work .note{opacity:.36}.total{min-width:105px;font-weight:900;border-left:4px solid transparent}.total span{display:block;font-size:.85rem}.total.ok{color:var(--ok);border-left-color:var(--ok)}.total.warn{color:var(--warn);border-left-color:var(--warn)}.total.bad{color:var(--bad);border-left-color:var(--bad)}.cards-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(230px,1fr));gap:14px}.mini-card{background:#fff;border:1px solid var(--line);border-radius:18px;padding:16px}.mini-card h3{margin-top:0}.pill{display:inline-block;background:var(--sand2);border:1px solid var(--line);border-radius:999px;padding:4px 8px;margin:2px;font-size:.85rem}.employee-form{background:#fffaf3;border:1px solid var(--line);border-radius:18px;padding:15px;margin:10px 0;display:grid;gap:10px}.grid-2{display:grid;grid-template-columns:repeat(auto-fit,minmax(200px,1fr));gap:10px}.check{display:flex;align-items:center;gap:8px}.check input{width:auto}.check-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(160px,1fr));gap:8px}.check-grid label{background:white;padding:9px;border-radius:12px;border:1px solid var(--line)}.check-grid input{width:auto}.worker-hero{display:flex;align-items:center;gap:16px;padding:16px 22px;background:var(--ink);color:#fff}.worker-hero img{width:76px;height:76px;object-fit:cover;border-radius:17px;background:var(--sand)}.worker-hero h1{margin:0}.worker-hero p{margin:2px 0;color:#d9c7ab}.worker-hero .btn{margin-left:auto}.worker-week-nav{display:flex;gap:10px;align-items:center;flex-wrap:wrap}.total-box{font-size:1.2rem;background:#fff3dd;border:1px solid var(--line);border-radius:18px;padding:15px;margin:10px 0}.worker-days{display:grid;grid-template-columns:repeat(auto-fit,minmax(230px,1fr));gap:14px}.day-card{background:#fff;border:1px solid var(--line);border-radius:20px;padding:16px}.day-card h3{margin:0 0 12px}.shift-badge{display:grid;gap:4px;border-radius:16px;padding:12px;margin:8px 0;background:#f7f1e7;border:1px solid var(--line)}.shift-badge.work{background:#dcfae6}.shift-badge.free{background:#eef2f6}.shift-badge.vacation{background:#e0f2fe}.shift-badge.sick{background:#fee4e2}.shift-badge.unavailable{background:#fef0c7}.shift-badge em{color:var(--muted)}
@media(max-width:900px){
  .login-body{padding:14px}.login-shell{grid-template-columns:1fr;gap:14px}.brand-card,.login-card,.panel{border-radius:20px;padding:16px}.brand-card{padding:14px}.login-logo{width:130px}.topbar{position:static;align-items:flex-start;flex-direction:column;padding:10px 12px}.topbar nav{width:100%;display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px;justify-content:stretch}.topbar nav a{text-align:center;white-space:normal}.admin-wrap,.worker-wrap{padding:10px;gap:12px}.toolbar,.actions-line,.inline-form{display:grid;grid-template-columns:1fr;align-items:stretch}.toolbar label{min-width:0;width:100%}.btn{width:100%}.table-scroll{overflow:visible;border:0;background:transparent}.schedule-table,.schedule-table thead,.schedule-table tbody,.schedule-table tr,.schedule-table th,.schedule-table td{display:block;width:100%;min-width:0}.schedule-table{background:transparent}.schedule-table thead{display:none}.schedule-table tr.schedule-worker-row{background:#fff;border:1px solid var(--line);border-radius:20px;margin:0 0 16px;padding:12px;box-shadow:0 8px 22px rgba(20,13,5,.07)}.schedule-table th:first-child,.schedule-table td:first-child,.schedule-table th,.schedule-table td{position:static;background:transparent;border-bottom:0;padding:8px 0}.worker-head{font-size:1.05rem;border-bottom:1px solid var(--line)!important;margin-bottom:8px}.shift-cell{border-top:1px solid #f1e1ca!important;padding-top:12px!important}.mobile-day{display:block;font-weight:900;margin-bottom:6px;color:var(--accent)}.shift-cell .times{grid-template-columns:1fr 1fr}.total{border-left:0;border-top:2px solid var(--line)!important;margin-top:8px;padding-top:12px!important}.admin-list,.admin-list thead,.admin-list tbody,.admin-list tr,.admin-list th,.admin-list td{display:block;width:100%}.admin-list thead{display:none}.admin-list tr{background:#fff;border:1px solid var(--line);border-radius:18px;margin:0 0 12px;padding:10px}.admin-list td{border:0;padding:8px 0}.admin-list td::before{content:attr(data-label);display:block;font-size:.78rem;text-transform:uppercase;letter-spacing:.04em;color:var(--muted);font-weight:900;margin-bottom:3px}.worker-hero{align-items:flex-start;padding:12px}.worker-hero img{width:56px;height:56px}.worker-hero .btn{margin-left:0;width:auto}.worker-days,.cards-grid{grid-template-columns:1fr}.grid-2{grid-template-columns:1fr}.check-grid{grid-template-columns:1fr}
}
@media print{body{background:white}.no-print,.topbar,.worker-hero{display:none!important}.admin-wrap,.worker-wrap{padding:0;width:100%}.panel{box-shadow:none;border:0;padding:0}.table-scroll{overflow:visible;border:0}.schedule-table{min-width:0;font-size:9px}.mobile-day{display:none}.shift-cell select,.shift-cell input{border:0;padding:0;background:transparent}.shift-cell .note:placeholder-shown{display:none}th,td{padding:4px}.schedule-table th:first-child,.schedule-table td:first-child,thead th{position:static}.cards-grid{display:none}}
.carry-info{font-weight:900;color:var(--muted)}
.carry-info.debt{color:var(--warn)}
.carry-info.credit{color:var(--ok)}
.total em{display:block;font-size:.72rem;color:var(--muted);font-style:normal;margin-top:3px}
.ok-text{color:var(--ok)}.warn-text{color:var(--warn)}.bad-text{color:var(--bad)}
@media print{
  @page{size:A4 landscape;margin:5mm}
  html,body{width:297mm;min-height:210mm;overflow:visible!important;background:white!important}
  .schedule-print-area{page-break-inside:avoid;break-inside:avoid;transform-origin:top left}
  .schedule-table{width:100%!important;table-layout:fixed!important;font-size:7px!important;line-height:1.05!important}
  .schedule-table th,.schedule-table td{padding:2px!important;word-break:normal!important;overflow:hidden!important}
  .worker-head{min-width:0!important;width:22mm!important}
  .worker-head span{font-size:6px!important;line-height:1.05!important}
  .shift-cell{min-width:0!important;width:auto!important}
  .shift-cell .times{display:block!important;margin:0!important}
  .shift-cell input[type="time"]{display:inline!important;width:46%!important;font-size:7px!important;margin:0!important}
  .shift-cell select{font-size:7px!important;white-space:normal!important}
  .shift-cell .note{display:none!important}
  .total{min-width:0!important;width:18mm!important;font-size:7px!important}
  .panel h1,.panel h2,.status-row{font-size:10px!important;margin:2px 0!important;padding:2px!important}
}

/* v4: administración móvil/PC sin scroll lateral y horarios por acordeón */
html, body { max-width:100%; overflow-x:hidden; }
*, *::before, *::after { box-sizing:border-box; }
img, table { max-width:100%; }
.schedule-accordion{display:grid;gap:12px;margin-top:14px;max-width:100%;}
.employee-schedule-card{background:#fff;border:1px solid var(--line);border-radius:20px;box-shadow:0 8px 22px rgba(20,13,5,.06);overflow:hidden;max-width:100%;}
.employee-schedule-card summary{cursor:pointer;list-style:none;display:flex;align-items:center;justify-content:space-between;gap:12px;padding:14px 16px;background:#fffaf1;}
.employee-schedule-card summary::-webkit-details-marker{display:none;}
.employee-schedule-card summary::before{content:'▸';font-weight:900;color:var(--accent);transition:transform .15s ease;}
.employee-schedule-card[open] summary::before{transform:rotate(90deg);}
.worker-summary-main{display:grid;gap:3px;min-width:0;flex:1;}
.worker-summary-main strong{font-size:1.05rem;}
.worker-summary-main small{color:var(--muted);font-weight:700;line-height:1.25;}
.employee-schedule-card .total{min-width:110px;border-left:0;text-align:right;padding:0;}
.employee-week-grid{display:grid;grid-template-columns:repeat(7,minmax(0,1fr));gap:10px;padding:14px;max-width:100%;}
.day-editor{background:#fff;border:1px solid var(--line);border-radius:16px;padding:10px;min-width:0;}
.day-editor h4{margin:0 0 8px;font-size:.9rem;color:var(--accent);}
.day-editor select,.day-editor input{font-size:.9rem;min-width:0;}
.day-editor .times{display:grid;grid-template-columns:1fr 1fr;gap:6px;margin:7px 0;}
.print-only{display:none!important;}
.compact-print-table{width:100%;border-collapse:collapse;table-layout:fixed;background:white;}
.compact-print-table th,.compact-print-table td{border:1px solid #111;padding:3px;text-align:center;vertical-align:middle;line-height:1.05;}
.compact-print-table th:first-child,.compact-print-table td:first-child{text-align:left;width:26mm;font-weight:800;}
.print-sheet h1,.print-sheet p{margin:0 0 4px;text-align:center;}
@media(max-width:1150px){.employee-week-grid{grid-template-columns:repeat(4,minmax(0,1fr));}}
@media(max-width:760px){.employee-schedule-card summary{align-items:flex-start;}.employee-schedule-card .total{text-align:left;min-width:86px}.employee-week-grid{grid-template-columns:1fr}.day-editor .times{grid-template-columns:1fr 1fr;}.worker-summary-main small{font-size:.78rem}}

@media print{
  @page{size:A4 landscape;margin:4mm}
  html,body{width:297mm;min-height:210mm;overflow:visible!important;background:white!important;}
  .no-print,.topbar,.worker-hero,.schedule-form,.worker-days,.total-box,.worker-week-nav{display:none!important;}
  .print-only{display:block!important;}
  .admin-wrap,.worker-wrap{padding:0!important;margin:0!important;width:100%!important;max-width:100%!important;}
  .panel{box-shadow:none!important;border:0!important;padding:0!important;margin:0!important;background:white!important;}
  .print-sheet{page-break-inside:avoid;break-inside:avoid;width:100%;}
  .print-sheet h1{font-size:12px!important;line-height:1.05!important;}
  .print-sheet p{font-size:9px!important;}
  .compact-print-table{font-size:7px!important;line-height:1!important;page-break-inside:avoid;break-inside:avoid;}
  .compact-print-table th,.compact-print-table td{padding:1.5px!important;word-break:normal!important;overflow:hidden!important;}
  .compact-print-table th:first-child,.compact-print-table td:first-child{width:24mm!important;}
}

/* v5: acordeón de horarios más limpio y exportación/impresión unificada */
.schedule-accordion{
  gap:14px;
}
.employee-schedule-card{
  border-radius:22px;
  border:1px solid rgba(13,11,8,.10);
  box-shadow:0 10px 28px rgba(20,13,5,.08);
  background:#fffdf8;
}
.employee-schedule-card summary,
.employee-schedule-card summary.employee-row-summary{
  list-style:none;
  cursor:pointer;
  display:grid;
  grid-template-columns:32px minmax(0,1fr) auto;
  align-items:center;
  gap:12px;
  padding:15px 18px;
  background:linear-gradient(90deg,#fffaf1,#fff);
  border-left:6px solid var(--sand);
}
.employee-schedule-card summary::before{content:none!important;display:none!important;}
.employee-open-indicator{
  width:26px;height:26px;border-radius:999px;
  display:grid;place-items:center;
  background:#f3dfbf;border:1px solid var(--line);
  color:var(--ink);font-weight:900;
}
.employee-open-indicator::before{content:'+';line-height:1;}
.employee-schedule-card[open] .employee-open-indicator::before{content:'−';}
.worker-summary-main strong{font-size:1.08rem;line-height:1.15;}
.worker-summary-main small{display:block;color:var(--muted);font-weight:700;}
.worker-summary-main .edit-hint{font-size:.78rem;color:#9b6a2e;font-weight:800;margin-top:3px;}
.worker-summary-status{
  display:grid;gap:2px;justify-items:end;text-align:right;
  min-width:112px;padding:8px 10px;border-radius:14px;
  background:#f7f1e7;border:1px solid var(--line);font-weight:900;
}
.worker-summary-status span{font-size:.82rem;}
.worker-summary-status em{display:block;font-size:.70rem;color:var(--muted);font-style:normal;}
.worker-summary-status.ok{background:#dcfae6;color:var(--ok);border-color:#abefc6;}
.worker-summary-status.warn{background:#fef0c7;color:var(--warn);border-color:#fedf89;}
.worker-summary-status.bad{background:#fee4e2;color:var(--bad);border-color:#fecdca;}
.employee-schedule-card[open] summary.employee-row-summary{border-bottom:1px solid var(--line);}
.employee-week-grid{background:#fffaf3;}
.day-editor{box-shadow:inset 0 1px 0 rgba(255,255,255,.6);}
.day-editor h4{font-size:.92rem;letter-spacing:.01em;}
@media(max-width:760px){
  .employee-schedule-card summary,.employee-schedule-card summary.employee-row-summary{grid-template-columns:28px minmax(0,1fr);}
  .worker-summary-status{grid-column:2;justify-items:start;text-align:left;width:100%;min-width:0;}
}

@media print{
  @page{size:A4 landscape;margin:4mm;}
  html,body{width:297mm!important;height:auto!important;min-height:0!important;background:#fff!important;overflow:visible!important;}
  .no-print,.topbar,.worker-hero,.schedule-form,.worker-days,.total-box,.worker-week-nav,.alert{display:none!important;}
  .print-only{display:block!important;}
  .worker-wrap,.admin-wrap{display:block!important;width:100%!important;max-width:100%!important;margin:0!important;padding:0!important;}
  .panel{display:block!important;width:100%!important;max-width:100%!important;margin:0!important;padding:0!important;border:0!important;box-shadow:none!important;background:#fff!important;}
  .panel>h2:not(.print-keep), .panel>.total-box{display:none!important;}
  .print-sheet{display:block!important;width:287mm!important;max-width:287mm!important;margin:0 auto!important;page-break-inside:avoid!important;break-inside:avoid!important;overflow:hidden!important;}
  .print-sheet h1{font-size:12px!important;line-height:1!important;margin:0 0 2mm!important;text-align:center!important;}
  .print-sheet p{font-size:8px!important;line-height:1!important;margin:0 0 2mm!important;text-align:center!important;}
  .compact-print-table,.worker-print-table{width:100%!important;max-width:100%!important;border-collapse:collapse!important;table-layout:fixed!important;font-size:7px!important;line-height:1!important;page-break-inside:avoid!important;break-inside:avoid!important;}
  .compact-print-table th,.compact-print-table td,.worker-print-table th,.worker-print-table td{border:1px solid #111!important;padding:1.2px!important;text-align:center!important;vertical-align:middle!important;word-break:normal!important;overflow:hidden!important;}
  .compact-print-table th:first-child,.compact-print-table td:first-child,.worker-print-table th:first-child,.worker-print-table td:first-child{width:25mm!important;text-align:left!important;font-weight:800!important;}
  .worker-print-table th:last-child,.worker-print-table td:last-child,.compact-print-table th:last-child,.compact-print-table td:last-child{width:16mm!important;}
}


/* v6: acordeones de horario como botones anchos, más claros y sin aspecto de texto suelto */
.schedule-accordion{display:grid;gap:12px;margin-top:14px;max-width:100%;}
.employee-schedule-card{border:0!important;background:transparent!important;box-shadow:none!important;overflow:visible!important;margin:0!important;max-width:100%;}
.employee-schedule-card summary.employee-row-summary,
.employee-schedule-card summary{
  width:100%!important;
  display:grid!important;
  grid-template-columns:36px minmax(0,1fr) auto!important;
  align-items:center!important;
  gap:14px!important;
  padding:14px 16px!important;
  border:2px solid #21170d!important;
  border-radius:18px!important;
  background:linear-gradient(135deg,#fff8ed,#f1d4a8)!important;
  color:var(--ink)!important;
  box-shadow:0 8px 18px rgba(20,13,5,.10)!important;
  cursor:pointer!important;
  min-height:68px!important;
}
.employee-schedule-card summary.employee-row-summary:hover{filter:brightness(.985);transform:translateY(-1px);}
.employee-schedule-card[open] summary.employee-row-summary{border-radius:18px 18px 0 0!important;border-bottom-color:var(--line)!important;}
.employee-open-indicator{width:28px;height:28px;border-radius:999px;background:var(--ink);display:grid;place-items:center;color:#fff;font-weight:900;flex:0 0 auto;}
.employee-open-indicator::before{content:'+'!important;font-size:19px;line-height:1;}
.employee-schedule-card[open] .employee-open-indicator::before{content:'−'!important;}
.worker-summary-main{display:grid!important;gap:2px!important;min-width:0!important;}
.worker-summary-main strong{font-size:1.05rem!important;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;}
.worker-summary-main small{font-size:.82rem!important;color:#5f5140!important;font-weight:800!important;white-space:normal!important;}
.worker-summary-main .edit-hint{display:none!important;}
.worker-summary-status{min-width:128px!important;box-shadow:inset 0 0 0 1px rgba(0,0,0,.04);}
.employee-week-grid{border:2px solid #21170d;border-top:0;border-radius:0 0 18px 18px;padding:12px;background:#fffaf3!important;}

/* v6: trabajadores organizados por locales */
.employee-location-groups{display:grid;gap:18px;margin-top:16px;}
.location-employee-group{background:#fff;border:1px solid var(--line);border-radius:22px;padding:16px;box-shadow:0 8px 22px rgba(20,13,5,.06);}
.location-employee-group h3{margin:0 0 12px;display:flex;align-items:center;justify-content:space-between;gap:10px;}
.location-employee-group h3 span{font-size:.82rem;background:var(--sand2);border:1px solid var(--line);border-radius:999px;padding:5px 9px;color:var(--muted);}
.employee-list-cards{display:grid;grid-template-columns:repeat(auto-fit,minmax(260px,1fr));gap:12px;}
.employee-admin-card{background:#fffaf3;border:1px solid var(--line);border-radius:18px;padding:13px;}
.employee-admin-card.is-inactive{opacity:.58;}
.employee-admin-head{display:flex;align-items:flex-start;justify-content:space-between;gap:10px;}
.employee-admin-head strong{display:block;font-size:1rem;}
.employee-admin-head small{display:block;color:var(--muted);font-weight:750;margin-top:2px;}
.employee-admin-head details{min-width:92px;text-align:right;}
.employee-admin-head details>summary{display:inline-flex;align-items:center;justify-content:center;border:0;border-radius:12px;padding:8px 11px;background:#ede0cb;font-weight:900;cursor:pointer;list-style:none;}
.employee-admin-head details>summary::-webkit-details-marker{display:none;}
.employee-admin-locations{margin-top:10px;}
.admin-create-box{background:#fffaf3;border:1px solid var(--line);border-radius:18px;padding:12px;margin:12px 0;}
.admin-create-box>summary{font-weight:900;cursor:pointer;}

@media(max-width:760px){
  .employee-schedule-card summary.employee-row-summary,.employee-schedule-card summary{grid-template-columns:32px minmax(0,1fr)!important;}
  .worker-summary-status{grid-column:1 / -1!important;width:100%!important;justify-items:start!important;text-align:left!important;min-width:0!important;}
  .employee-admin-head{display:grid;grid-template-columns:1fr;}
  .employee-admin-head details{min-width:0;text-align:left;}
}

/* v6: impresión compacta real para trabajador, igual que administración */
@media print{
  @page{size:A4 landscape;margin:3mm;}
  body.worker-body{background:#fff!important;width:297mm!important;max-width:297mm!important;overflow:visible!important;}
  body.worker-body .no-print,
  body.worker-body .worker-hero,
  body.worker-body .worker-days,
  body.worker-body .total-box,
  body.worker-body .worker-week-nav,
  body.worker-body .alert{display:none!important;}
  body.worker-body .worker-wrap{display:block!important;width:100%!important;max-width:100%!important;margin:0!important;padding:0!important;}
  body.worker-body .panel{display:block!important;width:100%!important;max-width:100%!important;margin:0!important;padding:0!important;border:0!important;box-shadow:none!important;background:#fff!important;overflow:visible!important;}
  body.worker-body .panel>h2{display:none!important;}
  body.worker-body .print-only,
  body.worker-body .worker-print-sheet{display:block!important;visibility:visible!important;}
  body.worker-body .worker-print-sheet{width:291mm!important;max-width:291mm!important;margin:0 auto!important;padding:0!important;page-break-inside:avoid!important;break-inside:avoid!important;overflow:hidden!important;}
  body.worker-body .worker-print-sheet h1{font-size:12px!important;line-height:1!important;margin:0 0 1.5mm!important;text-align:center!important;}
  body.worker-body .worker-print-sheet p{font-size:8px!important;line-height:1!important;margin:0 0 2mm!important;text-align:center!important;}
  body.worker-body .worker-print-table{width:100%!important;max-width:100%!important;border-collapse:collapse!important;table-layout:fixed!important;font-size:6.5px!important;line-height:1!important;page-break-inside:avoid!important;break-inside:avoid!important;}
  body.worker-body .worker-print-table th,
  body.worker-body .worker-print-table td{border:1px solid #111!important;padding:1px!important;text-align:center!important;vertical-align:middle!important;word-break:normal!important;overflow:hidden!important;height:auto!important;}
  body.worker-body .worker-print-table th:first-child,
  body.worker-body .worker-print-table td:first-child{width:25mm!important;text-align:left!important;font-weight:900!important;}
  body.worker-body .worker-print-table th:last-child,
  body.worker-body .worker-print-table td:last-child{width:15mm!important;}
}


/* v7: desplegables del creador de horarios con presencia clara de botón */
.schedule-accordion{
  display:grid!important;
  gap:14px!important;
  margin-top:18px!important;
  width:100%!important;
}
.employee-schedule-card{
  display:block!important;
  width:100%!important;
  border:0!important;
  background:transparent!important;
  margin:0!important;
  padding:0!important;
}
.employee-schedule-card > summary,
.employee-schedule-card > summary.employee-row-summary{
  appearance:none!important;
  -webkit-appearance:none!important;
  list-style:none!important;
  width:100%!important;
  min-height:78px!important;
  display:grid!important;
  grid-template-columns:42px minmax(0,1fr) minmax(120px,auto) auto!important;
  align-items:center!important;
  gap:14px!important;
  padding:15px 18px!important;
  border:2px solid #16100a!important;
  border-radius:20px!important;
  background:linear-gradient(135deg,#17110b 0%,#2a1c10 38%,#b9782c 100%)!important;
  color:#fff!important;
  box-shadow:0 12px 26px rgba(24,14,4,.22), inset 0 1px 0 rgba(255,255,255,.22)!important;
  cursor:pointer!important;
  user-select:none!important;
  transition:transform .15s ease, box-shadow .15s ease, filter .15s ease!important;
}
.employee-schedule-card > summary::-webkit-details-marker{display:none!important;}
.employee-schedule-card > summary::marker{content:''!important;}
.employee-schedule-card > summary:hover{
  transform:translateY(-2px)!important;
  box-shadow:0 16px 32px rgba(24,14,4,.28), inset 0 1px 0 rgba(255,255,255,.22)!important;
  filter:saturate(1.03)!important;
}
.employee-schedule-card[open] > summary.employee-row-summary,
.employee-schedule-card[open] > summary{
  border-radius:20px 20px 0 0!important;
  background:linear-gradient(135deg,#0d0b08 0%,#23170d 45%,#9f6423 100%)!important;
}
.employee-open-indicator{
  width:34px!important;
  height:34px!important;
  border-radius:999px!important;
  background:#fff!important;
  color:#17110b!important;
  display:grid!important;
  place-items:center!important;
  font-weight:1000!important;
  box-shadow:0 5px 14px rgba(0,0,0,.22)!important;
}
.employee-open-indicator::before{content:'+'!important;font-size:24px!important;line-height:1!important;}
.employee-schedule-card[open] .employee-open-indicator::before{content:'−'!important;font-size:25px!important;}
.employee-schedule-card .worker-summary-main strong{
  color:#fff!important;
  font-size:1.16rem!important;
  letter-spacing:.01em!important;
}
.employee-schedule-card .worker-summary-main small{
  color:#f7e5c8!important;
  font-weight:750!important;
  line-height:1.25!important;
}
.employee-schedule-card .worker-summary-main .edit-hint{
  display:block!important;
  color:#ffe7b8!important;
  font-size:.78rem!important;
  text-transform:uppercase!important;
  letter-spacing:.04em!important;
  margin-top:4px!important;
}
.employee-schedule-card .worker-summary-status{
  min-width:122px!important;
  justify-items:center!important;
  text-align:center!important;
  border:1px solid rgba(255,255,255,.65)!important;
  border-radius:16px!important;
  background:rgba(255,255,255,.92)!important;
  box-shadow:none!important;
}
.employee-schedule-card .worker-summary-status.ok{color:var(--ok)!important;}
.employee-schedule-card .worker-summary-status.warn{color:var(--warn)!important;}
.employee-schedule-card .worker-summary-status.bad{color:var(--bad)!important;}
.employee-schedule-card .worker-summary-status em{color:#5f5140!important;}
.worker-summary-cta{
  display:inline-flex!important;
  align-items:center!important;
  justify-content:center!important;
  min-height:38px!important;
  padding:8px 13px!important;
  border-radius:999px!important;
  background:#fff!important;
  color:#17110b!important;
  font-weight:1000!important;
  white-space:nowrap!important;
  box-shadow:0 6px 14px rgba(0,0,0,.18)!important;
}
.employee-week-grid{
  border:2px solid #16100a!important;
  border-top:0!important;
  border-radius:0 0 20px 20px!important;
  padding:14px!important;
  background:#fff8ec!important;
  box-shadow:0 10px 24px rgba(24,14,4,.10)!important;
}
@media(max-width:760px){
  .employee-schedule-card > summary,
  .employee-schedule-card > summary.employee-row-summary{
    grid-template-columns:38px minmax(0,1fr)!important;
    min-height:0!important;
    padding:14px!important;
  }
  .employee-schedule-card .worker-summary-status{
    grid-column:1 / -1!important;
    width:100%!important;
    justify-items:start!important;
    text-align:left!important;
  }
  .worker-summary-cta{
    grid-column:1 / -1!important;
    width:100%!important;
  }
}

/* v8: bloqueos visuales por turnos en otros locales */
.locked-shifts{
  display:grid!important;
  gap:6px!important;
  margin:8px 0 10px!important;
}
.locked-shift{
  border:1px solid #b42318!important;
  background:#fee4e2!important;
  color:#912018!important;
  border-radius:11px!important;
  padding:7px 8px!important;
  font-size:.82rem!important;
  font-weight:900!important;
  line-height:1.2!important;
  box-shadow:inset 0 0 0 1px rgba(255,255,255,.55)!important;
}
.shift-cell.has-locked-conflict{
  border-color:#d92d20!important;
  background:#fff1f0!important;
  box-shadow:0 0 0 2px rgba(217,45,32,.16)!important;
}
.locked-conflict-msg{
  margin-top:8px!important;
  border-radius:10px!important;
  padding:7px 8px!important;
  background:#d92d20!important;
  color:#fff!important;
  font-weight:900!important;
  font-size:.78rem!important;
  line-height:1.25!important;
}
.btn.is-disabled-by-conflict,
.btn:disabled{
  opacity:.45!important;
  cursor:not-allowed!important;
  filter:grayscale(.3)!important;
}
.shift-cell.not-work .locked-shifts,
.shift-cell.not-work .locked-shift{
  opacity:1!important;
}

/* v10: recupera los 4 campos 2x2 de la v8, y deja solo 2 campos si hay turno bloqueado en otro local */
.day-editor .times.times-full-four{display:grid;grid-template-columns:1fr 1fr;gap:6px;margin:7px 0;}
.day-editor .times.times-locked-two{display:grid;grid-template-columns:1fr 1fr;gap:6px;margin:7px 0;padding:8px;background:#fff7ec;border:1px solid rgba(112,27,21,.22);border-radius:12px;}
.single-slot-note{margin:6px 0 0;font-size:12px;font-weight:800;color:#8d342d;line-height:1.25;}

/* v11 · Avisos de horarios publicados */
.notify-dot {
  display: inline-block;
  width: .7rem;
  height: .7rem;
  margin-left: .35rem;
  border-radius: 999px;
  background: #d72626;
  box-shadow: 0 0 0 4px rgba(215, 38, 38, .18), 0 0 18px rgba(215, 38, 38, .55);
  vertical-align: middle;
}

.worker-notification-banner {
  position: sticky;
  top: 0;
  z-index: 50;
  margin: .75rem auto 0;
  width: min(940px, calc(100vw - 1rem));
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .65rem;
  padding: .75rem .9rem;
  border: 2px solid #2a160d;
  border-radius: 18px;
  background: linear-gradient(135deg, #ffe2af, #fff7e8);
  color: #17100a;
  box-shadow: 0 12px 30px rgba(0,0,0,.16);
}

.worker-notification-banner strong { font-size: 1rem; }
.worker-notification-banner span { flex: 1; color: #4e4132; font-size: .92rem; }
.worker-notification-banner button {
  border: 0;
  border-radius: 999px;
  padding: .55rem .85rem;
  background: #15110c;
  color: #fff4df;
  font-weight: 800;
}

.notify-permission-btn {
  white-space: nowrap;
  border-color: #d9ae68 !important;
  background: #fff2d8 !important;
  color: #1b130b !important;
}

@media (max-width: 720px) {
  .worker-hero { gap: .55rem; }
  .notify-permission-btn { width: 100%; order: 4; }
  .worker-notification-banner {
    align-items: stretch;
    flex-direction: column;
  }
  .worker-notification-banner button { width: 100%; }
}

/* v12 · Web Push real y vista trabajador limpia */
.worker-actions{display:flex;gap:10px;align-items:center;flex-wrap:wrap;margin-left:auto;justify-content:flex-end;}
.worker-actions .btn{margin-left:0!important;}
.worker-actions .btn.ghost{background:rgba(255,255,255,.12);color:#fff;border:1px solid rgba(255,255,255,.25);}
.notify-permission-btn:disabled{opacity:.85!important;cursor:default!important;}
@media(max-width:720px){
  .worker-hero{display:grid;grid-template-columns:56px 1fr;align-items:center;}
  .worker-actions{grid-column:1 / -1;width:100%;display:grid;grid-template-columns:1fr;}
  .worker-actions .btn{width:100%!important;}
}


/* v13 · Vista trabajador limpia y botón Salir arriba a la derecha */
.worker-logout-btn{
  margin-left:auto!important;
  width:auto!important;
  align-self:flex-start;
  background:rgba(255,255,255,.14)!important;
  color:#fff!important;
  border:1px solid rgba(255,255,255,.28)!important;
  white-space:nowrap;
}
.notify-permission-btn[data-state="enabled"]{
  background:#fee4e2!important;
  color:#912018!important;
  border-color:#f5a9a4!important;
}
@media(max-width:720px){
  .worker-hero{grid-template-columns:56px 1fr auto!important;}
  .worker-logout-btn{grid-column:3;grid-row:1;width:auto!important;padding:9px 12px!important;}
  .worker-actions{grid-column:1 / -1;width:100%;display:grid;grid-template-columns:1fr;}
  .worker-actions .notify-permission-btn{width:100%!important;}
}

/* v14: exportación compacta optimizada para ocupar A4 horizontal completo */
@media print{
  @page{size:A4 landscape;margin:6mm;}
  html,body{width:297mm!important;min-height:210mm!important;margin:0!important;padding:0!important;background:#fff!important;overflow:visible!important;-webkit-print-color-adjust:exact!important;print-color-adjust:exact!important;}
  body *{box-shadow:none!important;}
  .no-print,.topbar,.worker-hero,.worker-week-nav,.worker-days,.total-box,.alert,.schedule-form,.toolbar,.actions-line,.cards-grid{display:none!important;}
  .admin-wrap,.worker-wrap{display:block!important;width:100%!important;max-width:none!important;margin:0!important;padding:0!important;}
  .panel{display:block!important;width:100%!important;max-width:none!important;margin:0!important;padding:0!important;border:0!important;background:#fff!important;box-shadow:none!important;overflow:visible!important;}
  .panel>h1,.panel>h2,.panel>.panel-head{display:none!important;}
  .print-only,.print-sheet,.worker-print-sheet{display:block!important;visibility:visible!important;}

  .print-sheet{
    width:285mm!important;
    height:198mm!important;
    max-width:285mm!important;
    max-height:198mm!important;
    margin:0 auto!important;
    padding:0!important;
    overflow:hidden!important;
    break-inside:avoid!important;
    page-break-inside:avoid!important;
    page-break-after:avoid!important;
    background:#fff!important;
  }
  .print-sheet h1{
    height:9mm!important;
    margin:0!important;
    padding:0!important;
    display:flex!important;
    align-items:center!important;
    justify-content:center!important;
    font-size:18px!important;
    line-height:1!important;
    letter-spacing:.02em!important;
    text-align:center!important;
    color:#111!important;
  }
  .print-sheet p{
    height:7mm!important;
    margin:0 0 2mm!important;
    padding:0!important;
    display:flex!important;
    align-items:center!important;
    justify-content:center!important;
    font-size:11px!important;
    line-height:1!important;
    text-align:center!important;
    color:#111!important;
  }

  .compact-print-table{
    width:285mm!important;
    height:180mm!important;
    max-height:180mm!important;
    table-layout:fixed!important;
    border-collapse:collapse!important;
    border:1.4px solid #111!important;
    background:#fff!important;
    color:#111!important;
    font-size:10px!important;
    line-height:1.12!important;
  }
  .compact-print-table thead{display:table-header-group!important;}
  .compact-print-table tbody{display:table-row-group!important;}
  .compact-print-table tr{display:table-row!important;break-inside:avoid!important;page-break-inside:avoid!important;}
  .compact-print-table th,.compact-print-table td{
    display:table-cell!important;
    border:1px solid #111!important;
    padding:2.2mm 1.4mm!important;
    text-align:center!important;
    vertical-align:middle!important;
    word-break:normal!important;
    overflow-wrap:anywhere!important;
    overflow:hidden!important;
    background:#fff!important;
    color:#111!important;
  }
  .compact-print-table th{
    height:10mm!important;
    background:#111!important;
    color:#fff!important;
    font-size:10px!important;
    font-weight:900!important;
    text-transform:uppercase!important;
    letter-spacing:.03em!important;
  }
  .compact-print-table th:first-child,.compact-print-table td:first-child{
    width:34mm!important;
    text-align:left!important;
    font-weight:900!important;
    font-size:10px!important;
  }
  .compact-print-table th:last-child,.compact-print-table td:last-child{
    width:18mm!important;
    font-weight:900!important;
  }
  .compact-print-table td:not(:first-child):not(:last-child){font-size:9.6px!important;font-weight:750!important;}

  /* Impresión del trabajador: sustituye la fila larguísima por tarjetas de día que llenan el A4 */
  body.worker-body .worker-print-sheet{width:285mm!important;height:198mm!important;max-width:285mm!important;max-height:198mm!important;margin:0 auto!important;overflow:hidden!important;}
  body.worker-body .worker-print-table{display:none!important;}
  .worker-print-grid{
    display:grid!important;
    grid-template-columns:repeat(7,1fr)!important;
    gap:2.2mm!important;
    width:285mm!important;
    height:168mm!important;
    margin-top:2mm!important;
  }
  .worker-print-day{
    display:flex!important;
    flex-direction:column!important;
    min-width:0!important;
    border:1.4px solid #111!important;
    border-radius:3mm!important;
    overflow:hidden!important;
    background:#fff!important;
    color:#111!important;
    break-inside:avoid!important;
  }
  .worker-print-day h3{
    margin:0!important;
    padding:2.5mm 1mm!important;
    background:#111!important;
    color:#fff!important;
    font-size:12px!important;
    line-height:1!important;
    text-align:center!important;
    text-transform:uppercase!important;
  }
  .worker-print-day-content{
    flex:1!important;
    display:flex!important;
    flex-direction:column!important;
    justify-content:center!important;
    gap:2mm!important;
    padding:2.4mm!important;
    font-size:10.5px!important;
    line-height:1.18!important;
    text-align:center!important;
  }
  .worker-print-shift{
    border:1px solid #222!important;
    border-radius:2mm!important;
    padding:2mm 1.2mm!important;
    background:#f7f7f7!important;
    font-weight:850!important;
  }
  .worker-print-shift strong{display:block!important;font-size:10px!important;margin-bottom:1.2mm!important;}
  .worker-print-shift span{display:block!important;font-size:11.5px!important;font-weight:950!important;}
  .worker-print-shift em{display:block!important;font-size:8.5px!important;margin-top:1mm!important;font-style:normal!important;}
  .worker-print-empty{color:#555!important;font-weight:800!important;font-size:11px!important;}
}


/* v15: impresión A4 horizontal bonita, con logo y mejor aprovechamiento del espacio */
@media print{
  @page{size:A4 landscape;margin:6mm;}
  html,body{width:297mm!important;min-height:210mm!important;-webkit-print-color-adjust:exact!important;print-color-adjust:exact!important;background:#fff!important;}
  .status-row,.schedule-meta,.record-log,.worker-published-dot,.worker-notice{display:none!important;}

  .print-sheet,.admin-print-sheet,.worker-print-sheet{width:285mm!important;height:198mm!important;max-width:285mm!important;max-height:198mm!important;margin:0 auto!important;padding:0!important;overflow:hidden!important;background:#fff!important;}

  .print-brand-header{display:flex!important;align-items:center!important;justify-content:space-between!important;gap:8mm!important;height:22mm!important;margin:0 0 3mm!important;padding:0 1mm!important;}
  .print-brand-left{display:flex!important;align-items:center!important;gap:4mm!important;min-width:0!important;}
  .print-brand-logo{width:18mm!important;height:18mm!important;object-fit:contain!important;flex:0 0 18mm!important;}
  .print-brand-kicker{font-size:8px!important;font-weight:900!important;letter-spacing:.22em!important;color:#8b6a27!important;text-transform:uppercase!important;margin-bottom:1mm!important;}
  .print-brand-header h1{margin:0!important;padding:0!important;font-size:18px!important;line-height:1.05!important;color:#111!important;text-align:left!important;}
  .print-brand-meta{display:flex!important;align-items:center!important;justify-content:flex-end!important;gap:2mm!important;flex-wrap:wrap!important;max-width:110mm!important;}
  .print-chip{display:inline-flex!important;align-items:center!important;justify-content:center!important;padding:1.3mm 2.6mm!important;border-radius:999px!important;background:#111!important;color:#fff!important;font-size:8.5px!important;font-weight:800!important;line-height:1!important;white-space:nowrap!important;}

  .admin-print-sheet .compact-print-table{width:285mm!important;height:auto!important;min-height:169mm!important;max-height:169mm!important;border:1.4px solid #161616!important;table-layout:fixed!important;border-collapse:collapse!important;}
  .admin-print-sheet .compact-print-table th,.admin-print-sheet .compact-print-table td{border:1px solid #222!important;padding:2.1mm 1.4mm!important;vertical-align:middle!important;}
  .admin-print-sheet .compact-print-table th{background:#111!important;color:#fff!important;font-size:10px!important;font-weight:900!important;}
  .admin-print-sheet .compact-print-table td{font-size:9.5px!important;line-height:1.15!important;font-weight:700!important;color:#111!important;}
  .admin-print-sheet .compact-print-table th:first-child,.admin-print-sheet .compact-print-table td:first-child{width:36mm!important;font-size:10px!important;font-weight:900!important;text-align:left!important;background:#faf7ef!important;}
  .admin-print-sheet .compact-print-table th:last-child,.admin-print-sheet .compact-print-table td:last-child{width:18mm!important;font-weight:900!important;background:#faf7ef!important;}
  .admin-print-sheet .compact-print-table td:not(:first-child):not(:last-child){font-size:9.2px!important;}

  body.worker-body .worker-print-table{display:none!important;}
  body.worker-body .worker-print-sheet{width:285mm!important;height:198mm!important;}
  body.worker-body .worker-brand-header{margin-bottom:3.5mm!important;}
  body.worker-body .worker-print-grid{display:grid!important;grid-template-columns:repeat(4,1fr)!important;grid-template-rows:repeat(2,1fr)!important;gap:2.4mm!important;width:285mm!important;height:171mm!important;margin:0!important;}
  body.worker-body .worker-print-day{display:flex!important;flex-direction:column!important;min-width:0!important;border:1.3px solid #1b1b1b!important;border-radius:3mm!important;overflow:hidden!important;background:#fffdf8!important;box-shadow:none!important;}
  body.worker-body .worker-print-day h3{margin:0!important;padding:2.2mm 1mm!important;background:linear-gradient(90deg,#0f0f0f,#2a2a2a)!important;color:#fff!important;font-size:11px!important;line-height:1!important;text-transform:uppercase!important;text-align:center!important;letter-spacing:.05em!important;}
  body.worker-body .worker-print-day-content{flex:1!important;display:flex!important;flex-direction:column!important;justify-content:flex-start!important;gap:1.6mm!important;padding:2mm!important;font-size:9.4px!important;line-height:1.2!important;text-align:center!important;overflow:hidden!important;}
  body.worker-body .worker-print-shift{border:1px solid #d7caa3!important;border-radius:2mm!important;padding:1.8mm 1.2mm!important;background:#fff!important;}
  body.worker-body .worker-print-shift strong{display:block!important;font-size:8.5px!important;line-height:1.1!important;margin-bottom:1mm!important;color:#8b6a27!important;text-transform:uppercase!important;letter-spacing:.05em!important;}
  body.worker-body .worker-print-shift span{display:block!important;font-size:11px!important;line-height:1.12!important;font-weight:900!important;color:#111!important;}
  body.worker-body .worker-print-shift em{display:block!important;font-size:7.6px!important;line-height:1.15!important;margin-top:1mm!important;font-style:normal!important;color:#444!important;}
  body.worker-body .worker-print-empty{display:flex!important;align-items:center!important;justify-content:center!important;min-height:100%!important;color:#6a6a6a!important;font-size:10.5px!important;font-weight:800!important;}
  body.worker-body .worker-print-summary .worker-print-day-content{justify-content:center!important;gap:2mm!important;background:linear-gradient(180deg,#fffaf0,#fff)!important;}
  body.worker-body .worker-print-summary .summary-card{background:#fff!important;border-color:#cab87a!important;}
}
