
:root{--bg:#f6f7f9;--card:#fff;--text:#171717;--muted:#6b7280;--border:#e5e7eb;--accent:#b52a1f;--accent2:#951f17}
*{box-sizing:border-box}body{margin:0;font-family:Arial,Helvetica,sans-serif;background:var(--bg);color:var(--text)}
a{text-decoration:none;color:inherit}header{background:#fff;border-bottom:1px solid var(--border);padding:14px 22px}
.header-row{display:flex;align-items:center;gap:14px;max-width:1500px;margin:auto}.brand-logo{width:46px;height:46px;object-fit:contain}
h1{font-size:20px;margin:0}.sub,.small{color:var(--muted);font-size:12px}main{max-width:1500px;margin:20px auto;padding:0 18px 40px}
.nav{display:flex;gap:8px;flex-wrap:wrap;margin-bottom:16px}.nav a{border:1px solid var(--border);background:#fff;padding:10px 14px;border-radius:9px;font-weight:700}.nav a.active{background:var(--accent);color:#fff}
.card{background:#fff;border:1px solid var(--border);border-radius:14px;padding:18px;margin-bottom:16px}.grid{display:grid;grid-template-columns:repeat(7,minmax(130px,1fr));gap:10px}
label{font-size:12px;font-weight:700;display:block;margin-bottom:6px}input,select{width:100%;padding:10px;border:1px solid #d1d5db;border-radius:8px;background:#fff}
button{cursor:pointer}.btn{border:0;border-radius:8px;padding:10px 14px;font-weight:700}.btn-primary{background:var(--accent);color:#fff}.btn-light{background:#f3f4f6}.btn-good{background:#166534;color:#fff}.btn-bad{background:#b91c1c;color:#fff}
.inline{display:flex;gap:8px;align-items:center}.right{margin-left:auto}.stats{display:grid;grid-template-columns:repeat(4,1fr);gap:12px;margin-bottom:16px}.stat{background:#fff;border:1px solid var(--border);border-radius:12px;padding:14px}.stat b{display:block;font-size:24px;margin-top:6px}.stat span{font-size:12px;color:var(--muted)}
.table-wrap{overflow:auto}table{width:100%;border-collapse:collapse;font-size:13px}th,td{border-bottom:1px solid var(--border);padding:10px 8px;text-align:left;white-space:nowrap}th{color:#4b5563;font-size:12px;background:#fafafa}
.badge{padding:4px 7px;border-radius:999px;font-size:11px;font-weight:700;display:inline-block}.good{background:#dcfce7;color:#166534}.warn{background:#fef3c7;color:#92400e}.bad{background:#fee2e2;color:#991b1b}.draft{background:#e5e7eb;color:#374151}
.users-cards{display:grid;grid-template-columns:repeat(auto-fit,minmax(310px,1fr));gap:14px}.user-card{border:1px solid var(--border);border-radius:12px;padding:16px;background:#fff}.user-card-head{display:flex;justify-content:space-between;gap:12px;align-items:flex-start;margin-bottom:12px}.user-card-name{font-size:17px;font-weight:800}.user-card-role{font-size:12px;color:var(--muted);margin-top:3px}.user-info{display:grid;grid-template-columns:90px 1fr;gap:8px 10px;font-size:13px;margin-bottom:14px}.user-info .k{font-weight:700;color:#4b5563}.user-info .v{overflow-wrap:anywhere}.user-card-actions{display:flex;gap:8px;flex-wrap:wrap}
.login-shell{min-height:100vh;display:grid;place-items:center;padding:20px}.login-box{width:min(900px,100%);background:#fff;border:1px solid var(--border);border-radius:16px;padding:26px}.login-grid{display:grid;grid-template-columns:1fr 1fr;gap:28px}.register-panel{border-left:1px solid var(--border);padding-left:28px}
.modal{display:none;position:fixed;inset:0;background:rgba(0,0,0,.45);z-index:1000;align-items:center;justify-content:center;padding:20px}.modal-card{width:min(460px,100%);background:#fff;border-radius:14px;padding:22px}
@media(max-width:1000px){.grid{grid-template-columns:repeat(2,1fr)}.stats{grid-template-columns:repeat(2,1fr)}}@media(max-width:700px){.login-grid{grid-template-columns:1fr}.register-panel{border-left:0;border-top:1px solid var(--border);padding-left:0;padding-top:24px}}@media(max-width:600px){.grid{grid-template-columns:1fr}.stats{grid-template-columns:1fr}.users-cards{grid-template-columns:1fr}}

/* Timesheet period entry */
.timesheet-period-card h3,.entries-card h3{margin:0 0 18px}.period-grid{display:grid;grid-template-columns:minmax(220px,1fr) minmax(220px,1fr) auto;gap:14px;align-items:end}.period-action{padding-bottom:1px}.required{color:#b91c1c}.period-help{margin-top:10px}.form-error{display:none;margin-top:12px;padding:10px 12px;border-radius:8px;background:#fee2e2;color:#991b1b;font-weight:700;font-size:13px}.entries-head{display:flex;justify-content:space-between;align-items:center;gap:12px;margin-bottom:12px}.entries-head h3{margin-bottom:4px}.timesheet-table th{font-size:13px}.timesheet-table td{vertical-align:middle}.timesheet-table select{min-width:130px;font-size:15px}.timesheet-table td:nth-child(2) select{min-width:260px}.day-pill{display:inline-block;background:#dbeafe;color:#1e3a5f;border-radius:999px;padding:6px 10px;font-weight:700}.hours-box{min-width:82px;min-height:40px;background:#f3f4f6;border-radius:8px;padding:11px 10px;text-align:center;font-weight:700}.timesheet-footer{display:flex;align-items:center;gap:16px;justify-content:flex-end;flex-wrap:wrap;margin-top:14px}.timesheet-footer>div:first-child{margin-right:auto}.row-error td{background:#fff7f7}.row-error .row-end{border-color:#b91c1c}.save-success{text-align:center;padding:32px}.save-success p{color:var(--muted)}
@media(max-width:800px){.period-grid{grid-template-columns:1fr}.period-action .btn{width:100%}.entries-head{align-items:flex-start}.timesheet-table td:nth-child(2) select{min-width:210px}}


/* Time Entry layout refinements */
body[data-page="timesheet"] main{max-width:1100px;margin:22px auto;padding:0 20px 48px}
body[data-page="timesheet"] .nav{margin-bottom:18px}
body[data-page="timesheet"] .card{box-shadow:0 1px 2px rgba(0,0,0,.03)}
body[data-page="timesheet"] .timesheet-period-card,
body[data-page="timesheet"] .entries-card{padding:22px 24px}
body[data-page="timesheet"] .period-grid{grid-template-columns:1fr 1fr auto;gap:16px}
body[data-page="timesheet"] .period-grid input{min-height:44px;font-size:16px}
body[data-page="timesheet"] .period-action .btn{min-height:44px;white-space:nowrap}
body[data-page="timesheet"] .timesheet-table{table-layout:fixed}
body[data-page="timesheet"] .timesheet-table th:nth-child(1){width:16%}
body[data-page="timesheet"] .timesheet-table th:nth-child(2){width:28%}
body[data-page="timesheet"] .timesheet-table th:nth-child(3),
body[data-page="timesheet"] .timesheet-table th:nth-child(4){width:22%}
body[data-page="timesheet"] .timesheet-table th:nth-child(5){width:12%}
body[data-page="timesheet"] .timesheet-table select{min-width:0;width:100%;min-height:44px}
body[data-page="timesheet"] .timesheet-table td:nth-child(2) select{min-width:0}

@media(max-width:760px){
  body[data-page="timesheet"] header{padding:10px 14px}
  body[data-page="timesheet"] .header-row{gap:9px}
  body[data-page="timesheet"] .brand-logo{width:38px;height:38px}
  body[data-page="timesheet"] h1{font-size:17px}
  body[data-page="timesheet"] .header-row>.right{gap:6px}
  body[data-page="timesheet"] .header-row>.right .small{display:none}
  body[data-page="timesheet"] main{max-width:620px;margin:14px auto;padding:0 12px 34px}
  body[data-page="timesheet"] .nav{margin-bottom:12px}
  body[data-page="timesheet"] .nav a{padding:9px 12px;font-size:13px}
  body[data-page="timesheet"] .timesheet-period-card,
  body[data-page="timesheet"] .entries-card{padding:16px;border-radius:12px}
  body[data-page="timesheet"] .timesheet-period-card h3,
  body[data-page="timesheet"] .entries-card h3{font-size:18px}
  body[data-page="timesheet"] .period-grid{grid-template-columns:1fr;gap:13px}
  body[data-page="timesheet"] .period-action .btn{width:100%;font-size:15px}
  body[data-page="timesheet"] .period-help{line-height:1.4}
  body[data-page="timesheet"] .entries-head{display:grid;grid-template-columns:1fr;gap:10px;margin-bottom:14px}
  body[data-page="timesheet"] .entries-head .btn{width:100%}
  body[data-page="timesheet"] .table-wrap{overflow:visible}
  body[data-page="timesheet"] .timesheet-table,
  body[data-page="timesheet"] .timesheet-table tbody{display:block;width:100%}
  body[data-page="timesheet"] .timesheet-table thead{display:none}
  body[data-page="timesheet"] .timesheet-table tr{display:grid;grid-template-columns:1fr 1fr;gap:12px;padding:15px;margin-bottom:12px;border:1px solid var(--border);border-radius:12px;background:#fff}
  body[data-page="timesheet"] .timesheet-table td{display:block;padding:0;border:0;white-space:normal;min-width:0}
  body[data-page="timesheet"] .timesheet-table td:first-child{grid-column:1/-1;padding-bottom:10px;border-bottom:1px solid var(--border)}
  body[data-page="timesheet"] .timesheet-table td:nth-child(2){grid-column:1/-1}
  body[data-page="timesheet"] .timesheet-table td:nth-child(5){grid-column:1/-1}
  body[data-page="timesheet"] .timesheet-table td:not(:first-child)::before{content:attr(data-label);display:block;margin-bottom:6px;font-size:12px;font-weight:700;color:#4b5563}
  body[data-page="timesheet"] .day-pill{font-size:15px;padding:6px 10px}
  body[data-page="timesheet"] .timesheet-table select{font-size:16px;min-height:46px;padding:10px 12px}
  body[data-page="timesheet"] .hours-box{min-height:46px;display:flex;align-items:center;justify-content:flex-start;padding:10px 12px;font-size:16px}
  body[data-page="timesheet"] .timesheet-footer{display:grid;grid-template-columns:1fr;gap:10px;margin-top:16px}
  body[data-page="timesheet"] .timesheet-footer>div:first-child{margin-right:0;font-size:17px}
  body[data-page="timesheet"] .timesheet-footer .btn{width:100%;min-height:46px;font-size:15px}
  body[data-page="timesheet"] .save-success{padding:24px 16px}
}

@media(max-width:420px){
  body[data-page="timesheet"] .timesheet-table tr{grid-template-columns:1fr;gap:10px}
  body[data-page="timesheet"] .timesheet-table td:nth-child(3),
  body[data-page="timesheet"] .timesheet-table td:nth-child(4){grid-column:1/-1}
}

/* Timesheet v3: centered form, top notices, saved-entry history */
body[data-page="timesheet"] main{max-width:1180px;padding-left:34px;padding-right:34px}
body[data-page="timesheet"] .timesheet-period-card,
body[data-page="timesheet"] .entries-card,
body[data-page="timesheet"] .saved-card,
body[data-page="timesheet"] .save-success{max-width:1040px;margin-left:auto;margin-right:auto}
body[data-page="timesheet"] .timesheet-period-card{padding:24px 28px}
body[data-page="timesheet"] .period-grid{grid-template-columns:minmax(230px,300px) minmax(230px,300px) auto;justify-content:start;gap:14px}
body[data-page="timesheet"] .period-grid input{width:100%;min-height:42px;padding:8px 10px;font-size:15px}
body[data-page="timesheet"] .period-action .btn{min-height:42px}

.top-message{display:none;max-width:1040px;margin:0 auto 14px;padding:13px 16px;border-radius:10px;font-size:14px;font-weight:700;border:1px solid transparent}
.top-message.show{display:block}
.top-message.error{background:#fee2e2;color:#991b1b;border-color:#fecaca}
.top-message.alert{background:#ffedd5;color:#9a3412;border-color:#fdba74}
.top-message.info{background:#dbeafe;color:#1e3a8a;border-color:#93c5fd}

.saved-card{padding:22px 24px}
.saved-head{display:flex;justify-content:space-between;align-items:flex-start;gap:16px;margin-bottom:14px}
.saved-head h3{margin:0 0 4px}
.saved-grand{min-width:120px;text-align:right}
.saved-grand span,.saved-grand small{display:block;color:var(--muted);font-size:11px}
.saved-grand strong{display:block;font-size:20px;margin-top:3px}
.saved-list{display:grid;gap:10px}
.saved-period{border:1px solid var(--border);border-radius:11px;overflow:hidden;background:#fff}
.saved-summary{width:100%;display:grid;grid-template-columns:1fr auto 24px;align-items:center;gap:14px;padding:14px 16px;background:#fff;border:0;text-align:left;color:var(--text)}
.saved-summary:hover{background:#fafafa}
.saved-dates,.saved-hours{display:flex;flex-direction:column;gap:3px;min-width:0}
.saved-dates small,.saved-hours small{font-size:11px;color:var(--muted);font-weight:400}
.saved-hours{text-align:right;min-width:72px}
.saved-hours strong{font-size:18px}
.saved-chevron{font-size:18px;color:var(--muted);transition:transform .15s ease}
.saved-summary[aria-expanded="true"] .saved-chevron{transform:rotate(180deg)}
.saved-details{border-top:1px solid var(--border);padding:8px 14px 12px;background:#fafafa}
.saved-entry-head,.saved-entry-row{display:grid;grid-template-columns:150px 1fr 190px 70px;gap:12px;align-items:center;padding:9px 4px;border-bottom:1px solid var(--border);font-size:12px}
.saved-entry-head{font-weight:700;color:#4b5563;font-size:11px}
.saved-entry-row strong{text-align:right}
.saved-entry-total{display:flex;justify-content:flex-end;gap:20px;padding:12px 4px 2px;font-size:13px}
.saved-loading,.empty-saved{padding:18px 4px;color:var(--muted);font-size:13px}

@media(max-width:760px){
  body[data-page="timesheet"] main{padding-left:16px;padding-right:16px}
  body[data-page="timesheet"] .timesheet-period-card,
  body[data-page="timesheet"] .entries-card,
  body[data-page="timesheet"] .saved-card,
  body[data-page="timesheet"] .save-success,
  .top-message{max-width:none}
  body[data-page="timesheet"] .timesheet-period-card{padding:18px}
  body[data-page="timesheet"] .period-grid{grid-template-columns:1fr;gap:12px}
  body[data-page="timesheet"] .period-grid input{max-width:none;min-height:44px}
  .saved-head{align-items:center}
  .saved-summary{grid-template-columns:1fr auto 20px;padding:13px 12px;gap:9px}
  .saved-dates strong{font-size:13px}
  .saved-hours strong{font-size:16px}
  .saved-entry-head{display:none}
  .saved-entry-row{grid-template-columns:1fr auto;gap:5px 10px;padding:11px 2px}
  .saved-entry-row span:nth-child(1){font-weight:700}
  .saved-entry-row span:nth-child(2){text-align:right}
  .saved-entry-row span:nth-child(3){color:var(--muted)}
  .saved-entry-row strong{text-align:right}
  .saved-entry-total{justify-content:space-between}
}

@media(max-width:420px){
  body[data-page="timesheet"] main{padding-left:12px;padding-right:12px}
  .saved-card{padding:16px}
  .saved-head{display:grid;grid-template-columns:1fr auto}
  .saved-grand strong{font-size:17px}
}


/* Timesheet v4: professional saved-entry layout */
body[data-page="timesheet"] .card{border-radius:18px;box-shadow:0 8px 24px rgba(15,23,42,.04)}
body[data-page="timesheet"] .timesheet-period-card,
body[data-page="timesheet"] .entries-card,
body[data-page="timesheet"] .saved-card{padding:26px 30px}
body[data-page="timesheet"] .timesheet-period-card h3,
body[data-page="timesheet"] .entries-card h3,
body[data-page="timesheet"] .saved-card h3{font-size:18px;margin-bottom:18px}
body[data-page="timesheet"] label{margin-bottom:8px;font-size:12px;letter-spacing:.02em}
body[data-page="timesheet"] input,
body[data-page="timesheet"] select{min-height:44px;padding:10px 12px;border-radius:10px}
body[data-page="timesheet"] .period-grid{align-items:end;column-gap:16px;row-gap:14px}
body[data-page="timesheet"] .period-help{margin-top:12px}
body[data-page="timesheet"] .entries-head{margin-bottom:18px}
body[data-page="timesheet"] .saved-card{margin-top:18px}
.saved-head{margin-bottom:18px}
.saved-head .small{font-size:13px;line-height:1.45}
.saved-grand{background:#f8fafc;border:1px solid var(--border);border-radius:14px;padding:14px 16px;min-width:170px}
.saved-grand span{font-size:12px}
.saved-grand strong{font-size:24px;color:#111827}
.saved-stats{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:12px;margin-bottom:18px}
.saved-stat{background:#f8fafc;border:1px solid var(--border);border-radius:14px;padding:14px 16px}
.saved-stat span{display:block;font-size:12px;color:var(--muted);margin-bottom:8px}
.saved-stat strong{font-size:22px;line-height:1.1}
.saved-list{gap:14px}
.saved-period{border-radius:15px;border:1px solid var(--border);box-shadow:0 1px 2px rgba(15,23,42,.03)}
.saved-summary{grid-template-columns:minmax(0,1fr) auto 24px;gap:18px;padding:18px 18px;background:#fff}
.saved-main{display:flex;flex-direction:column;gap:10px;min-width:0}
.saved-dates strong{font-size:16px;line-height:1.3}
.saved-dates small{font-size:12px}
.saved-chips{display:flex;flex-wrap:wrap;gap:8px}
.saved-chip{display:inline-flex;align-items:center;padding:6px 10px;border-radius:999px;background:#eff6ff;color:#1d4ed8;font-size:12px;font-weight:700}
.saved-chip.muted{background:#f3f4f6;color:#4b5563}
.saved-hours{min-width:110px;align-items:flex-end;justify-content:center}
.saved-hours strong{font-size:24px;line-height:1.1}
.saved-hours small{font-size:12px}
.saved-details{padding:12px 16px 14px;background:#fcfcfd}
.saved-entry-list{border:1px solid var(--border);border-radius:12px;overflow:hidden;background:#fff}
.saved-entry-head{padding:12px 14px;border:0;border-bottom:1px solid var(--border);background:#f8fafc;font-size:11px;text-transform:uppercase;letter-spacing:.04em}
.saved-entry-row{padding:12px 14px;border-bottom:1px solid var(--border);font-size:13px}
.saved-entry-row:last-child{border-bottom:0}
.saved-entry-row strong{font-size:13px;color:#111827}
.saved-entry-total{margin-top:12px;padding:0 4px;font-size:14px}
.empty-saved,.saved-loading{padding:10px 2px 2px;font-size:14px}

@media(max-width:760px){
  body[data-page="timesheet"] .timesheet-period-card,
  body[data-page="timesheet"] .entries-card,
  body[data-page="timesheet"] .saved-card{padding:18px}
  .saved-head{display:grid;grid-template-columns:1fr;gap:12px}
  .saved-grand{min-width:0;text-align:left}
  .saved-stats{grid-template-columns:1fr 1fr}
  .saved-summary{grid-template-columns:1fr auto 20px;align-items:start;padding:14px 14px 13px}
  .saved-main{gap:8px}
  .saved-dates strong{font-size:15px}
  .saved-hours{min-width:82px}
  .saved-hours strong{font-size:19px}
  .saved-details{padding:12px}
  .saved-entry-list{border-radius:10px}
}

@media(max-width:520px){
  .saved-stats{grid-template-columns:1fr}
  .saved-summary{grid-template-columns:1fr auto;gap:10px}
  .saved-summary .saved-chevron{grid-column:2;grid-row:1 / span 2;align-self:center}
  .saved-hours{align-items:flex-start;text-align:left}
}


/* Timesheet v5 - implements approved visual mockup */
body[data-page="timesheet"]{background:#f5f7f9}
body[data-page="timesheet"] header{padding:16px 30px;background:#fff}
body[data-page="timesheet"] .header-row{max-width:1420px}
body[data-page="timesheet"] .brand-logo{width:44px;height:44px}
body[data-page="timesheet"] h1{font-size:20px;letter-spacing:.01em}
body[data-page="timesheet"] .sub{font-size:12px;margin-top:1px}
body[data-page="timesheet"] main{max-width:1420px;margin:18px auto 0;padding:0 34px 54px}
body[data-page="timesheet"] .nav{max-width:1040px;margin:0 auto 18px;gap:8px}
body[data-page="timesheet"] .nav a{border:0;background:transparent;padding:0}
body[data-page="timesheet"] .nav a.active{display:inline-flex;align-items:center;gap:8px;background:linear-gradient(180deg,#c43a2b,#ae2c20);padding:11px 16px;border-radius:8px;color:#fff;box-shadow:0 5px 12px rgba(181,42,31,.18);position:relative}
body[data-page="timesheet"] .nav a.active::after{content:"";position:absolute;left:0;right:0;bottom:-10px;height:2px;background:var(--accent);border-radius:2px}
body[data-page="timesheet"] .timesheet-period-card,
body[data-page="timesheet"] .entries-card,
body[data-page="timesheet"] .saved-card,
body[data-page="timesheet"] .save-success,
.top-message{max-width:1040px}
body[data-page="timesheet"] .card{border:1px solid #e3e7eb;border-radius:16px;box-shadow:0 7px 22px rgba(15,23,42,.055)}
body[data-page="timesheet"] .timesheet-period-card{padding:24px 26px 20px}
body[data-page="timesheet"] .timesheet-period-card h3{font-size:18px;margin-bottom:18px}
body[data-page="timesheet"] .period-grid{grid-template-columns:minmax(0,1fr) minmax(0,1fr);gap:18px 24px;align-items:end}
body[data-page="timesheet"] .period-action{grid-column:1 / -1;padding:0}
body[data-page="timesheet"] .period-grid input{min-height:44px;border-radius:8px;border-color:#cfd6dd;background:#fff;font-size:15px}
body[data-page="timesheet"] .period-action .btn{min-height:40px;padding:10px 18px;border-radius:7px}
body[data-page="timesheet"] .period-help{margin-top:7px;font-size:12px}
body[data-page="timesheet"] .saved-card{padding:22px 24px 20px}
.saved-head{display:flex;align-items:flex-start;justify-content:space-between;gap:20px;margin-bottom:14px}
.saved-head h3{font-size:18px;margin:0 0 4px!important}
.saved-head .small{font-size:12px}
.saved-grand{display:none}
.saved-stats{grid-template-columns:repeat(4,minmax(0,1fr));gap:12px;margin-bottom:14px}
.saved-stat{position:relative;background:#fff;border:1px solid #dfe4e8;border-radius:11px;padding:14px 14px 14px 58px;min-height:72px;display:flex;flex-direction:column;justify-content:center}
.saved-stat::before{position:absolute;left:12px;top:50%;transform:translateY(-50%);width:34px;height:34px;border-radius:9px;display:flex;align-items:center;justify-content:center;background:#f3f4f6;color:#475569;font-size:18px}
.saved-stat:nth-child(1)::before{content:"◷";background:#fef2f2;color:#b52a1f}
.saved-stat:nth-child(2)::before{content:"▣"}
.saved-stat:nth-child(3)::before{content:"▤"}
.saved-stat:nth-child(4)::before{content:"⊘"}
.saved-stat span{font-size:12px;margin-bottom:4px;color:#475569}
.saved-stat strong{font-size:19px;color:#111827}
.saved-stats .saved-stat:first-child strong{color:#b52a1f}
.saved-list{gap:12px}
.saved-period{border:1px solid #dfe4e8;border-radius:11px;overflow:hidden;background:#fff;box-shadow:none}
.saved-summary{grid-template-columns:minmax(0,1fr) 110px 22px;padding:12px 14px;gap:12px;background:#fff}
.saved-main{flex-direction:row;align-items:center;gap:12px;min-width:0}
.saved-main::before{content:"▣";width:30px;height:30px;border-radius:8px;background:#fff1ef;color:#b52a1f;display:flex;align-items:center;justify-content:center;flex:0 0 30px}
.saved-dates{gap:2px}
.saved-dates strong{font-size:14px}
.saved-dates small{display:none}
.saved-chips{gap:6px;margin-left:2px}
.saved-chip{padding:5px 9px;font-size:11px;background:#eaf8ef;color:#1c6b39;border-radius:999px}
.saved-chip.muted{background:#f3f4f6;color:#5f6670}
.saved-hours{align-items:flex-end;min-width:100px}
.saved-hours strong{font-size:17px;color:#b52a1f}
.saved-hours small{display:none}
.saved-details{padding:0;background:#fff;border-top:1px solid #e5e7eb}
.saved-entry-head,.saved-entry-row{grid-template-columns:1.05fr 1.2fr 1.2fr .5fr;gap:10px}
.saved-entry-head{padding:10px 14px;background:#f7f8fa;font-size:11px;color:#667085;text-transform:none;letter-spacing:0}
.saved-entry-row{padding:9px 14px;font-size:12px}
.saved-entry-row strong{text-align:left}
.saved-entry-total{margin:0;padding:10px 14px;border-top:1px solid #e5e7eb;background:#fafbfc;justify-content:space-between;font-size:12px}
.saved-entry-total strong{font-size:13px}

@media(max-width:900px){
  .saved-stats{grid-template-columns:1fr 1fr}
}
@media(max-width:760px){
  body[data-page="timesheet"] header{padding:10px 14px}
  body[data-page="timesheet"] main{padding:0 14px 34px}
  body[data-page="timesheet"] .nav{margin-bottom:14px}
  body[data-page="timesheet"] .timesheet-period-card,
  body[data-page="timesheet"] .saved-card,
  body[data-page="timesheet"] .entries-card{padding:16px}
  body[data-page="timesheet"] .period-grid{grid-template-columns:1fr;gap:12px}
  body[data-page="timesheet"] .period-action{grid-column:auto}
  .saved-main{flex-wrap:wrap}
  .saved-summary{grid-template-columns:1fr auto 18px}
  .saved-entry-row{grid-template-columns:1fr auto}
  .saved-entry-row span:nth-child(3){grid-column:1}
  .saved-entry-row strong{grid-column:2;grid-row:2;text-align:right}
}
@media(max-width:520px){
  .saved-stats{grid-template-columns:1fr}
  .saved-summary{grid-template-columns:1fr auto}
  .saved-summary .saved-chevron{display:none}
  .saved-chips{width:100%;margin-left:42px}
}


/* v6 polished administration navigation */
body:not([data-page="login"]) main{padding-top:0}
.admin-nav{display:flex;align-items:center;gap:8px;flex-wrap:wrap;margin:0 0 20px;padding:10px;background:#fff;border:1px solid var(--border);border-radius:16px;box-shadow:0 6px 20px rgba(15,23,42,.05)}
.admin-nav a{display:inline-flex;align-items:center;gap:8px;min-height:42px;padding:10px 14px;border:1px solid transparent;border-radius:11px;background:transparent;color:#374151;font-size:13px;font-weight:700;transition:background .16s ease,border-color .16s ease,color .16s ease,transform .16s ease}
.admin-nav a:hover{background:#f8fafc;border-color:#e5e7eb;color:#111827}
.admin-nav a.active{background:var(--accent);border-color:var(--accent);color:#fff;box-shadow:0 4px 12px rgba(181,42,31,.18)}
.admin-nav a.active:hover{background:var(--accent2);border-color:var(--accent2);color:#fff}
.admin-nav .nav-icon{display:grid;place-items:center;width:22px;height:22px;border-radius:7px;background:#f3f4f6;color:#4b5563;font-size:13px;line-height:1}
.admin-nav a.active .nav-icon{background:rgba(255,255,255,.18);color:#fff}
body[data-page="timesheet"] .admin-nav{max-width:1040px;margin-left:auto;margin-right:auto}
@media(max-width:760px){
  .admin-nav{gap:6px;padding:8px;border-radius:14px;overflow-x:auto;flex-wrap:nowrap;scrollbar-width:none}
  .admin-nav::-webkit-scrollbar{display:none}
  .admin-nav a{flex:0 0 auto;padding:9px 12px;min-height:40px;font-size:12px}
  .admin-nav .nav-icon{width:20px;height:20px}
}


/* v7: Time Entry admin nav aligned with all admin tabs */
body[data-page="timesheet"] .nav.admin-nav{max-width:1040px;margin:0 auto 20px;padding:10px;gap:8px}
body[data-page="timesheet"] .nav.admin-nav a{display:inline-flex;align-items:center;gap:8px;min-height:42px;padding:10px 14px;border:1px solid transparent;border-radius:11px;background:transparent;color:#374151;font-size:13px;font-weight:700;position:static;box-shadow:none}
body[data-page="timesheet"] .nav.admin-nav a::after{display:none!important}
body[data-page="timesheet"] .nav.admin-nav a:hover{background:#f8fafc;border-color:#e5e7eb;color:#111827}
body[data-page="timesheet"] .nav.admin-nav a.active{background:var(--accent);border-color:var(--accent);color:#fff;box-shadow:0 4px 12px rgba(181,42,31,.18)}
body[data-page="timesheet"] .nav.admin-nav a.active:hover{background:var(--accent2);border-color:var(--accent2);color:#fff}
body[data-page="timesheet"] .nav.admin-nav .nav-icon{display:grid;place-items:center;width:22px;height:22px;border-radius:7px;background:#f3f4f6;color:#4b5563;font-size:13px;line-height:1}
body[data-page="timesheet"] .nav.admin-nav a.active .nav-icon{background:rgba(255,255,255,.18);color:#fff}
@media(max-width:760px){body[data-page="timesheet"] .nav.admin-nav{max-width:none;overflow-x:auto;flex-wrap:nowrap;padding:8px;gap:6px}body[data-page="timesheet"] .nav.admin-nav a{flex:0 0 auto;min-height:40px;padding:9px 12px;font-size:12px}}


/* v8: one consistent admin navigation container on every admin page */
body:not([data-page="login"]) main{max-width:1180px;margin:22px auto;padding-left:34px;padding-right:34px}
body:not([data-page="login"]) .admin-nav{
  width:100%;
  max-width:1040px;
  margin:0 auto 20px;
  padding:10px;
  display:flex;
  align-items:center;
  gap:8px;
  flex-wrap:wrap;
  background:#fff;
  border:1px solid var(--border);
  border-radius:16px;
  box-shadow:0 6px 20px rgba(15,23,42,.05);
}
body:not([data-page="login"]) .admin-nav a{
  display:inline-flex;
  align-items:center;
  gap:8px;
  min-height:42px;
  padding:10px 14px;
  border:1px solid transparent;
  border-radius:11px;
  background:transparent;
  color:#374151;
  font-size:13px;
  font-weight:700;
  line-height:1;
}
body:not([data-page="login"]) .admin-nav a:hover{background:#f8fafc;border-color:#e5e7eb;color:#111827}
body:not([data-page="login"]) .admin-nav a.active{background:var(--accent);border-color:var(--accent);color:#fff;box-shadow:0 4px 12px rgba(181,42,31,.18)}
body:not([data-page="login"]) .admin-nav .nav-icon{display:grid;place-items:center;width:22px;height:22px;border-radius:7px;background:#f3f4f6;color:#4b5563;font-size:13px}
body:not([data-page="login"]) .admin-nav a.active .nav-icon{background:rgba(255,255,255,.18);color:#fff}
body:not([data-page="login"]) #pageRoot{max-width:1040px;margin-left:auto;margin-right:auto}
@media(max-width:760px){
  body:not([data-page="login"]) main{margin:14px auto;padding-left:14px;padding-right:14px}
  body:not([data-page="login"]) .admin-nav{max-width:none;overflow-x:auto;flex-wrap:nowrap;padding:8px;gap:6px;border-radius:14px;scrollbar-width:none}
  body:not([data-page="login"]) .admin-nav::-webkit-scrollbar{display:none}
  body:not([data-page="login"]) .admin-nav a{flex:0 0 auto;min-height:40px;padding:9px 12px;font-size:12px}
  body:not([data-page="login"]) .admin-nav .nav-icon{width:20px;height:20px}
}

/* v9 Weekly View: pending approval + approved by employee */
body[data-page="weekly"] main{max-width:1180px;margin:22px auto;padding:0 34px 48px}
body[data-page="weekly"] .admin-nav{max-width:1040px;margin:0 auto 20px}
body[data-page="weekly"] #pageRoot{max-width:1040px;margin:0 auto}
.weekly-title{display:flex;justify-content:space-between;align-items:flex-end;margin:4px 0 18px}.weekly-title h2{margin:0 0 5px;font-size:24px}.weekly-title p,.section-head p{margin:0;color:var(--muted);font-size:13px}.review-stats{display:grid;grid-template-columns:repeat(4,1fr);gap:12px;margin-bottom:18px}.review-stat{background:#fff;border:1px solid var(--border);border-radius:14px;padding:16px 18px}.review-stat span{display:block;color:var(--muted);font-size:12px;margin-bottom:7px}.review-stat strong{font-size:22px}.review-section{padding:22px 24px;margin-bottom:18px}.section-head{display:flex;justify-content:space-between;align-items:flex-start;gap:14px;margin-bottom:16px}.section-head h3{margin:0 0 4px;font-size:18px}.employee-groups{display:grid;gap:16px}.employee-group{border:1px solid var(--border);border-radius:14px;overflow:hidden;background:#fff}.employee-group-head{display:grid;grid-template-columns:42px 1fr auto;gap:12px;align-items:center;padding:14px 16px;background:#f8fafc;border-bottom:1px solid var(--border)}.employee-avatar{width:38px;height:38px;border-radius:50%;display:grid;place-items:center;background:#fee2e2;color:var(--accent);font-weight:800}.employee-group-head>div:nth-child(2){display:flex;flex-direction:column;gap:3px}.employee-group-head span{font-size:11px;color:var(--muted)}.employee-hours{font-weight:800;font-size:16px}.review-period{border-bottom:1px solid var(--border)}.review-period:last-child{border-bottom:0}.review-period-head{display:flex;justify-content:space-between;gap:16px;align-items:center;padding:15px 16px}.review-range{font-weight:800;font-size:14px;margin-bottom:4px}.review-meta{font-size:11px;color:var(--muted)}.review-right{display:flex;align-items:center;gap:9px;flex-wrap:wrap;justify-content:flex-end}.review-right>strong{font-size:16px}.review-right .btn{padding:8px 11px;font-size:12px}.review-details{padding:0 16px 14px;background:#fcfcfd}.review-row{display:grid;grid-template-columns:170px 1fr 210px 80px;gap:12px;padding:10px 12px;border-bottom:1px solid var(--border);font-size:12px;background:#fff}.review-header{font-size:10px;font-weight:800;text-transform:uppercase;letter-spacing:.04em;background:#f8fafc;color:#4b5563;border:1px solid var(--border);border-radius:10px 10px 0 0}.review-row:not(.review-header){border-left:1px solid var(--border);border-right:1px solid var(--border)}.review-row strong{text-align:right}.review-total{display:flex;justify-content:flex-end;gap:24px;padding:12px 6px 0;font-size:13px}.empty-review{padding:24px;text-align:center;color:var(--muted);background:#f8fafc;border:1px dashed #d1d5db;border-radius:12px}.approved-section{margin-top:20px}
@media(max-width:800px){body[data-page="weekly"] main{padding-left:16px;padding-right:16px}.review-stats{grid-template-columns:1fr 1fr}.review-period-head{align-items:flex-start;flex-direction:column}.review-right{justify-content:flex-start}.review-row{grid-template-columns:1fr 1fr;gap:6px 10px}.review-header{display:none}.review-row span:nth-child(3){color:var(--muted)}.review-row strong{text-align:right}.employee-group-head{grid-template-columns:38px 1fr}.employee-hours{grid-column:2}.section-head{align-items:center}}
@media(max-width:480px){.review-stats{grid-template-columns:1fr}.review-section{padding:16px}.employee-group-head{padding:12px}.review-period-head{padding:13px}.review-details{padding:0 10px 12px}}

/* v10 Locations admin improvements */
.location-form{margin-top:18px}
.location-name-row{display:grid;grid-template-columns:minmax(240px,360px);gap:14px;margin-bottom:16px}
.location-days-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(220px,1fr));gap:14px}
.location-day-card{border:1px solid var(--border);border-radius:14px;padding:14px;background:#f9fafb}
.location-day-card label{margin-bottom:10px}
.location-time-row{display:grid;grid-template-columns:1fr auto 1fr;align-items:center;gap:10px}
.location-time-row span{color:var(--muted);font-size:13px;font-weight:700;text-align:center}
.location-actions{margin-top:18px;display:flex;justify-content:flex-start}
body[data-page="locations"] .table-wrap table th,
body[data-page="locations"] .table-wrap table td{white-space:nowrap}
body[data-page="locations"] .table-wrap table td strong{font-size:14px}
@media(max-width:760px){
  .location-name-row{grid-template-columns:1fr}
  .location-days-grid{grid-template-columns:1fr}
  .location-day-card{padding:12px}
  .location-actions .btn{width:100%}
}

/* v11 Locations: compact list + create/edit modal */
body[data-page="locations"] .locations-page-card{padding:24px 26px}
.locations-page-head{display:flex;justify-content:space-between;align-items:center;gap:16px;margin-bottom:18px}
.locations-page-head h3{margin:0 0 5px}
.locations-table-wrap{border:1px solid var(--border);border-radius:14px;overflow:auto}
.locations-table{margin:0}
.locations-table th{background:#f8fafc}
.location-row-actions{display:flex;gap:7px;align-items:center}
.location-row-actions .btn{padding:8px 10px;font-size:12px}
.location-modal-card{width:min(760px,100%);max-height:calc(100% - 40px);overflow:auto;padding:0;border-radius:18px}
.location-modal-head{display:flex;align-items:flex-start;justify-content:space-between;gap:16px;padding:20px 22px 14px;border-bottom:1px solid var(--border)}
.location-modal-head h3{margin:0 0 5px}
.location-modal-close{font-size:22px;line-height:1;padding:8px 12px}
.location-modal-body{padding:18px 22px}
.location-modal-message{display:none;margin:16px 22px 0;padding:11px 13px;border-radius:10px;font-size:13px;font-weight:700}
.location-modal-message.show{display:block}
.location-modal-message.error{background:#fee2e2;color:#991b1b;border:1px solid #fecaca}
.location-modal-message.info{background:#dbeafe;color:#1e3a8a;border:1px solid #93c5fd}
.week-hours-list{display:grid;gap:10px;margin-top:16px}
.week-hours-row{display:grid;grid-template-columns:140px 1fr 1fr;gap:14px;align-items:end;padding:12px 14px;border:1px solid var(--border);border-radius:12px;background:#fafafa}
.week-day-name{font-weight:800;padding-bottom:12px}
.week-hours-row label{margin-bottom:6px}
.location-modal-actions{display:flex;justify-content:flex-end;gap:10px;padding:14px 22px 20px;border-top:1px solid var(--border)}
@media(max-width:760px){
  .locations-page-head{align-items:stretch;flex-direction:column}
  .locations-page-head .btn{width:100%}
  .location-modal-card{max-height:calc(100% - 24px)}
  .week-hours-row{grid-template-columns:1fr 1fr}
  .week-day-name{grid-column:1/-1;padding-bottom:0}
  .location-modal-actions{display:grid;grid-template-columns:1fr 1fr}
}
@media(max-width:430px){
  .week-hours-row{grid-template-columns:1fr}
  .week-day-name{grid-column:auto}
  .location-modal-actions{grid-template-columns:1fr}
}

/* v12 approved Create/Edit Location modal */
body.modal-open{overflow:hidden}
body[data-page="locations"] .locations-page-card{padding:24px 26px}
.locations-page-head{align-items:center}
.locations-page-head .btn-primary{padding:11px 16px}
.location-modal{align-items:flex-start;justify-content:center;padding:70px 20px;background:rgba(17,24,39,.52);overflow:auto}
.location-modal-card{width:min(760px,100%);max-height:none;overflow:visible;padding:0;border-radius:16px;box-shadow:0 24px 70px rgba(15,23,42,.25)}
.location-modal-head{padding:20px 28px 16px;align-items:center;background:#fff;border-radius:16px 16px 0 0}
.location-modal-head h3{font-size:21px;margin:0 0 4px}
.location-modal-x{border:0;background:transparent;color:#374151;font-size:28px;line-height:1;cursor:pointer;padding:2px 6px;border-radius:8px}
.location-modal-x:hover{background:#f3f4f6}
.location-modal-body{padding:20px 28px 24px;background:#fff}
.location-name-field{max-width:460px;margin-bottom:18px}
.location-name-field label{font-size:13px;margin-bottom:8px}
.location-name-field input{min-height:42px;font-size:14px}
.location-hours-title{font-size:14px;font-weight:800;padding-top:14px;border-top:1px solid var(--border);margin-bottom:12px}
.location-hours-table{border:1px solid var(--border);border-radius:12px;overflow:hidden;background:#fff}
.location-hours-header,.location-hours-row{display:grid;grid-template-columns:140px 1fr 1fr 100px;gap:14px;align-items:center}
.location-hours-header{padding:11px 14px;background:#f7f8fa;color:#4b5563;font-size:12px;font-weight:800}
.location-hours-row{padding:9px 14px;border-top:1px solid var(--border);min-height:56px}
.location-hours-row:first-of-type{border-top:1px solid var(--border)}
.location-day-label{font-size:13px;font-weight:700;color:#111827}
.location-hours-row input[type="time"]{min-height:38px;padding:7px 10px;font-size:13px;border-radius:8px}
.closed-check{display:flex;align-items:center;gap:8px;margin:0;font-size:12px;font-weight:700;color:#374151;cursor:pointer}
.closed-check input{width:17px;height:17px;min-height:0;padding:0;margin:0}
.location-hours-row.is-closed{background:#fafafa}
.location-hours-row.is-closed input[type="time"]{opacity:.45}
.location-modal-message{margin:14px 28px 0}
.location-modal-actions{padding:14px 28px 18px;background:#fff;border-radius:0 0 16px 16px}
.location-modal-actions .btn{min-width:110px}
.closed-badge{display:inline-flex;padding:4px 8px;border-radius:999px;background:#f3f4f6;color:#6b7280;font-size:11px;font-weight:700}

@media(max-width:760px){
  .location-modal{padding:20px 12px}
  .location-modal-card{width:100%}
  .location-modal-head{padding:18px 18px 14px}
  .location-modal-body{padding:16px 18px 20px}
  .location-modal-message{margin:12px 18px 0}
  .location-hours-header{display:none}
  .location-hours-table{border:0;border-radius:0;overflow:visible}
  .location-hours-row{grid-template-columns:1fr 1fr;gap:10px;padding:14px 0;border-top:1px solid var(--border)}
  .location-day-label{grid-column:1/-1;font-size:14px}
  .closed-check{grid-column:1/-1}
  .location-modal-actions{padding:14px 18px 18px;grid-template-columns:1fr 1fr}
  .location-name-field{max-width:none}
}
@media(max-width:430px){
  .location-hours-row{grid-template-columns:1fr}
  .location-day-label,.closed-check{grid-column:auto}
  .location-modal-actions{grid-template-columns:1fr}
}

/* v13 — robust professional Locations modal (desktop + zoom + mobile) */
body[data-page="locations"] .locations-page-card{
  max-width:1040px;
  margin-left:auto;
  margin-right:auto;
  padding:26px 28px;
}
body[data-page="locations"] .locations-page-head{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:18px;
  margin-bottom:20px;
}
body[data-page="locations"] .locations-page-head h3{font-size:20px;margin:0 0 5px}
body[data-page="locations"] .locations-table-wrap{border-radius:14px;background:#fff}
body[data-page="locations"] .locations-table th{padding:13px 14px;font-size:11px;text-transform:uppercase;letter-spacing:.035em}
body[data-page="locations"] .locations-table td{padding:14px;font-size:12px}
body[data-page="locations"] .location-row-actions{gap:8px}
body[data-page="locations"] .location-row-actions .btn{min-height:36px;padding:8px 12px}

/* Modal outer layer */
body[data-page="locations"] .location-modal{
  position:fixed !important;
  inset:0 !important;
  z-index:2000 !important;
  display:none;
  align-items:center !important;
  justify-content:center !important;
  padding:20px !important;
  overflow:hidden !important;
  background:rgba(15,23,42,.58) !important;
}
body[data-page="locations"] .location-modal-card{
  width:min(860px,calc(100vw - 40px)) !important;
  max-width:860px !important;
  max-height:calc(100vh - 40px) !important;
  margin:0 !important;
  padding:0 !important;
  overflow:hidden !important;
  display:flex !important;
  flex-direction:column !important;
  background:#fff !important;
  border:1px solid #e5e7eb !important;
  border-radius:18px !important;
  box-shadow:0 28px 80px rgba(15,23,42,.30) !important;
}
body[data-page="locations"] .location-modal-head{
  flex:0 0 auto;
  padding:20px 24px 16px !important;
  border-bottom:1px solid var(--border) !important;
  background:#fff !important;
  border-radius:18px 18px 0 0 !important;
}
body[data-page="locations"] .location-modal-head h3{font-size:21px;margin:0 0 4px}
body[data-page="locations"] .location-modal-head .small{font-size:12px}
body[data-page="locations"] .location-modal-x{
  width:38px;height:38px;display:grid;place-items:center;
  flex:0 0 38px;font-size:25px;border-radius:10px;
}
body[data-page="locations"] .location-modal-message{
  flex:0 0 auto;
  margin:12px 24px 0 !important;
}
body[data-page="locations"] .location-modal-body{
  flex:1 1 auto;
  min-height:0;
  overflow-y:auto !important;
  overscroll-behavior:contain;
  padding:18px 24px 22px !important;
  background:#fff !important;
}
body[data-page="locations"] .location-name-field{
  max-width:460px !important;
  margin:0 0 18px !important;
}
body[data-page="locations"] .location-name-field input{
  height:42px;min-height:42px !important;
}
body[data-page="locations"] .location-hours-title{
  margin:0 0 10px !important;
  padding-top:16px !important;
}
body[data-page="locations"] .location-hours-table{
  border:1px solid #e5e7eb !important;
  border-radius:13px !important;
  overflow:hidden !important;
  background:#fff !important;
}
body[data-page="locations"] .location-hours-header,
body[data-page="locations"] .location-hours-row{
  display:grid !important;
  grid-template-columns:130px minmax(150px,1fr) minmax(150px,1fr) 105px !important;
  column-gap:16px !important;
  align-items:center !important;
}
body[data-page="locations"] .location-hours-header{
  padding:10px 14px !important;
  background:#f8fafc !important;
  color:#475569;
  font-size:11px !important;
  font-weight:800;
}
body[data-page="locations"] .location-hours-row{
  min-height:58px !important;
  padding:9px 14px !important;
  border-top:1px solid #edf0f3 !important;
  background:#fff;
}
body[data-page="locations"] .location-hours-row:hover{background:#fcfcfd}
body[data-page="locations"] .location-day-label{
  grid-column:auto !important;
  font-size:13px !important;
  font-weight:800 !important;
  padding:0 !important;
}
body[data-page="locations"] .location-time-cell{min-width:0}
body[data-page="locations"] .location-time-cell::before{display:none}
body[data-page="locations"] .location-hours-row input[type="time"]{
  width:100% !important;
  height:38px !important;
  min-height:38px !important;
  margin:0 !important;
  padding:6px 9px !important;
  font-size:13px !important;
  border-radius:8px !important;
}
body[data-page="locations"] .closed-check{
  grid-column:auto !important;
  display:inline-flex !important;
  align-items:center !important;
  gap:8px !important;
  margin:0 !important;
  white-space:nowrap;
}
body[data-page="locations"] .closed-check input{
  position:absolute;
  opacity:0;
  pointer-events:none;
}
body[data-page="locations"] .closed-box{
  width:18px;height:18px;border-radius:5px;border:1.5px solid #94a3b8;background:#fff;
  position:relative;display:inline-block;flex:0 0 18px;
}
body[data-page="locations"] .closed-check input:checked + .closed-box{
  background:var(--accent);border-color:var(--accent);
}
body[data-page="locations"] .closed-check input:checked + .closed-box::after{
  content:'✓';position:absolute;inset:0;display:grid;place-items:center;color:#fff;font-size:12px;font-weight:900;
}
body[data-page="locations"] .location-hours-row.is-closed{background:#fafafa}
body[data-page="locations"] .location-hours-row.is-closed .location-time-cell{opacity:.38}
body[data-page="locations"] .location-modal-actions{
  flex:0 0 auto;
  display:flex !important;
  justify-content:flex-end !important;
  gap:10px !important;
  padding:14px 24px 18px !important;
  border-top:1px solid var(--border) !important;
  background:#fff !important;
  border-radius:0 0 18px 18px !important;
}
body[data-page="locations"] .location-modal-actions .btn{
  width:auto !important;
  min-width:120px !important;
  min-height:40px !important;
}

/* Compact layout for narrow windows / high browser zoom. Keeps From + To side-by-side. */
@media(max-width:680px){
  body[data-page="locations"] .location-modal{padding:10px !important}
  body[data-page="locations"] .location-modal-card{
    width:calc(100vw - 20px) !important;
    max-height:calc(100vh - 20px) !important;
    border-radius:14px !important;
  }
  body[data-page="locations"] .location-modal-head{padding:16px 16px 13px !important}
  body[data-page="locations"] .location-modal-head h3{font-size:18px}
  body[data-page="locations"] .location-modal-message{margin:10px 16px 0 !important}
  body[data-page="locations"] .location-modal-body{padding:14px 16px 18px !important}
  body[data-page="locations"] .location-name-field{max-width:none !important;margin-bottom:14px !important}
  body[data-page="locations"] .location-hours-header{display:none !important}
  body[data-page="locations"] .location-hours-table{
    border:0 !important;border-radius:0 !important;overflow:visible !important;
    display:grid;gap:8px;background:transparent !important;
  }
  body[data-page="locations"] .location-hours-row{
    grid-template-columns:minmax(0,1fr) minmax(0,1fr) 88px !important;
    gap:8px 10px !important;
    padding:10px 11px !important;
    min-height:0 !important;
    border:1px solid #e5e7eb !important;
    border-radius:11px !important;
    background:#fff !important;
  }
  body[data-page="locations"] .location-day-label{
    grid-column:1 / -1 !important;
    font-size:13px !important;
    margin-bottom:1px;
  }
  body[data-page="locations"] .location-time-cell{position:relative;padding-top:16px}
  body[data-page="locations"] .location-time-cell::before{
    content:attr(data-label);display:block !important;position:absolute;top:0;left:1px;
    color:#64748b;font-size:10px;font-weight:800;text-transform:uppercase;letter-spacing:.04em;
  }
  body[data-page="locations"] .location-hours-row input[type="time"]{
    height:36px !important;min-height:36px !important;font-size:12px !important;padding:5px 7px !important;
  }
  body[data-page="locations"] .closed-check{
    grid-column:3 !important;
    align-self:end !important;
    min-height:36px;
    justify-content:center;
    font-size:11px !important;
  }
  body[data-page="locations"] .location-modal-actions{
    display:grid !important;grid-template-columns:1fr 1fr !important;
    padding:12px 16px 14px !important;
  }
  body[data-page="locations"] .location-modal-actions .btn{width:100% !important;min-width:0 !important}
  body[data-page="locations"] .locations-page-head{align-items:stretch;flex-direction:column}
  body[data-page="locations"] .locations-page-head .btn{width:100%}
}

/* Even very narrow phones keep time fields on one row instead of becoming a huge vertical form. */
@media(max-width:390px){
  body[data-page="locations"] .location-hours-row{
    grid-template-columns:minmax(0,1fr) minmax(0,1fr) 72px !important;
    gap:7px !important;
  }
  body[data-page="locations"] .closed-check{font-size:0 !important}
  body[data-page="locations"] .closed-check .closed-box{margin:auto}
}


/* v14 DB-backed Locations */
.locations-title-row{display:flex;justify-content:space-between;align-items:flex-start;gap:16px;flex-wrap:wrap;margin-bottom:18px}
.locations-title-row h3{margin:0 0 6px}.location-row-actions{display:flex;gap:8px}.locations-table td,.locations-table th{white-space:nowrap}
.location-db-modal{align-items:center;justify-content:center}.location-db-card{width:min(760px,calc(100% - 28px));max-height:calc(100vh - 40px);padding:0;overflow:hidden;display:flex;flex-direction:column}
.location-modal-head{display:flex;justify-content:space-between;align-items:flex-start;padding:20px 24px;border-bottom:1px solid var(--border)}.location-modal-head h3{margin:0 0 5px}.location-close{border:0;background:transparent;font-size:28px;line-height:1;color:#6b7280;padding:0 4px}.location-modal-body{padding:20px 24px;overflow:auto}.hours-section-title{font-weight:800;margin:18px 0 10px;padding-top:16px;border-top:1px solid var(--border)}
.location-hours-table{border:1px solid var(--border);border-radius:12px;overflow:hidden}.lh-head,.lh-row{display:grid;grid-template-columns:150px 1fr 1fr 120px;gap:14px;align-items:center}.lh-head{background:#f8fafc;padding:11px 14px;font-size:12px;font-weight:800;color:#4b5563}.lh-row{padding:9px 14px;border-top:1px solid var(--border)}.lh-row input[type=time]{min-height:40px}.closed-check{display:flex;align-items:center;gap:8px;margin:0;font-size:13px}.closed-check input{width:auto}.location-modal-actions{display:flex;justify-content:flex-end;gap:10px;padding:14px 24px;border-top:1px solid var(--border);background:#fff}.location-modal-body .top-message{margin:14px 0 0;max-width:none}
@media(max-width:700px){.lh-head{display:none}.lh-row{grid-template-columns:1fr 1fr;gap:9px 10px;padding:12px}.lh-row strong{grid-column:1/-1}.closed-check{grid-column:1/-1}.location-modal-actions .btn{flex:1}.locations-title-row .btn{width:100%}}
