/* Shared PC, tablet and phone browser layout. Native mobile app is separate. */
main,.panel,.demo-card,.creation-section,.app-shell,.home-form-copy{min-width:0}
img,svg,video{max-width:100%}
input,select,textarea{max-width:100%;min-width:0}
.table-responsive,.demo-table-scroll,.real-leave-table{max-width:100%;overflow-x:auto;overscroll-behavior-x:contain}
dialog{box-sizing:border-box;max-height:calc(100dvh - 32px);overflow-y:auto;overscroll-behavior:contain;white-space:normal;overflow-wrap:anywhere}
dialog form,dialog label{min-width:0;max-width:100%;white-space:normal;overflow-wrap:anywhere}
dialog .decision-actions{min-width:0;max-width:100%;white-space:normal}
dialog .decision-actions>*{max-width:100%;white-space:normal}
dialog label>input[type=checkbox],dialog label>input[type=radio]{display:inline-block;width:20px;height:20px;margin-right:8px;vertical-align:middle}
.quick-actions,.demo-staff-actions{flex-wrap:wrap}
.employee-card input[type=checkbox],.employee-card input[type=radio]{width:auto;min-height:auto}
@media(max-width:1024px){
 .sidebar{width:min(290px,85vw);transform:translateX(-100%);transition:transform .18s ease}
 .app-shell{margin-left:0}
 .mobile-menu{display:flex;flex-shrink:0;min-width:44px;min-height:44px}
 .menu-open .sidebar{transform:translateX(0)}
 .menu-open .sidebar-overlay{display:block;position:fixed;inset:0;background:#101b3666;z-index:35}
 .menu-open{overflow:hidden}
 .topbar{padding:12px 18px;height:auto;min-height:72px;gap:12px}
 .global-search{flex:1;width:auto;max-width:510px;min-width:0}
 .topbar .environment,.global-search kbd{display:none}
 .side-nav>a,.side-nav>button{min-height:46px;font-size:14px}
 .institution-dashboard-grid,.aligned-demo .demo-grid{grid-template-columns:minmax(0,1fr)}
 .employee-header{gap:16px;flex-wrap:wrap}
 .employee-header nav{flex-wrap:wrap}
 .marketing-header{flex-wrap:wrap}
 .marketing-header nav{flex-wrap:wrap}
}
@media(max-width:600px){
 .main-content,.aligned-demo .main-content{padding:20px 14px 0}
 .institution-app .institution-content-card,.employee-card,.employee-card.narrow{margin:16px 12px;padding:20px;max-width:none}
 .page-heading,.demo-heading,.employee-heading,.panel-heading,.demo-section-title{flex-wrap:wrap;gap:14px}
 .page-heading h1,.demo-heading h1,.employee-card h1{font-size:26px;overflow-wrap:anywhere}
 .topbar .account-copy{display:none}
 .topbar .account-menu{padding-left:8px}
 .topbar .account-menu summary{min-height:44px}
 .topbar .account-popover{max-width:calc(100vw - 24px)}
 .global-search input{font-size:16px}
 .home-form-link{flex-direction:column;align-items:stretch;gap:20px;padding:20px}
 .home-form-qr{text-align:center}
 .creation-grid,.creation-help,.demo-membership{grid-template-columns:minmax(0,1fr)}
 .creation-field,.report-filters label,.history-report-page .quick-actions>div{min-width:0;width:100%}
 .quick-actions>.primary-button,.quick-actions>.secondary-button,.demo-staff-actions>a,.demo-staff-actions>button{flex:1 1 160px;justify-content:center;white-space:normal}
 .primary-button,.secondary-button,.text-button,button[data-close]{min-height:44px;font-size:14px}
 input:not([type=checkbox]):not([type=radio]):not([type=hidden]),select,textarea{font-size:16px!important;min-height:44px}
 input[type=checkbox],input[type=radio]{width:20px;height:20px;flex-shrink:0}
 dialog,.demo-body dialog,.demo-body dialog#leave-detail-dialog{width:calc(100vw - 24px);max-width:calc(100vw - 24px);padding:20px}
 .leave-detail-fields,.leave-record dl{grid-template-columns:minmax(0,1fr);gap:6px}
 .leave-detail-fields dd,.leave-record dd{margin-bottom:12px}
 .employee-card p,.employee-card li{overflow-wrap:anywhere}
 .its-table,.real-leave-table table,.demo-table-scroll table{font-size:13px}
 .its-table th,.its-table td,.real-leave-table th,.real-leave-table td{font-size:12px;padding:12px}
 .marketing-header{padding:16px;gap:14px}
 .marketing-header nav{width:100%;gap:10px;justify-content:space-between}
 .marketing-header nav a{display:inline-flex;align-items:center;min-height:44px}
 .marketing-header nav a[href^='#']{display:none}
 .hero-actions{flex-wrap:wrap}
 .login-header{height:auto;min-height:72px;flex-wrap:wrap;gap:12px;padding:16px}
 .login-header .public-nav{flex-wrap:wrap;gap:14px}
 .login-header .public-nav a{min-height:44px;display:inline-flex;align-items:center}
}
@media(prefers-reduced-motion:reduce){.sidebar{transition:none}}

/* Approved leave list: current, upcoming and completed periods. */
:is(.real-leave-table,.demo-table-scroll) tr:is(.leave-current,.leave-upcoming) > td {background:#f4effd;}
:is(.real-leave-table,.demo-table-scroll) tr:is(.leave-ended,.roster-working) > td {background:#e8f6ec;}
:is(.real-leave-table,.demo-table-scroll) tr.roster-inactive > td {background:#f2f4f8;}
:is(.real-leave-table,.demo-table-scroll) tr.roster-pending > td {background:#fff5e7;}
#bugun #today-count {background:#f4effd;color:#6842a3;}
#bugun:has(#working-today[aria-pressed="true"]) #today-count {background:#e8f6ec;color:#16663e;}
.leave-period-note {display:block;margin-top:6px;font-size:0.82rem;font-weight:600;color:#375269;}

/* Compact approved personnel rows; retain touch targets on small screens. */
.compact-approved-leaves > table > tbody > tr > td,
#today-rows > tr > td {padding:4px 12px;line-height:1.2;vertical-align:middle;}
.compact-approved-leaves .leave-period-note,
#today-rows .leave-period-note {margin:2px 0 0;line-height:1.15;font-size:11px;}
/* Compact personnel list controls. */
.personnel-table > tbody > tr > td, #staff-rows > tr > td {
 padding:5px 12px;line-height:1.25;vertical-align:middle;
}
.personnel-status-inline {display:flex;align-items:center;gap:8px;white-space:nowrap;}
#staff-rows .personnel-status-inline {margin-top:3px;}
.personnel-status-inline .personnel-status-button {
 display:inline-flex;align-items:center;margin:0;padding:4px 8px;min-height:26px;font-size:12px;line-height:1.2;
}
.personnel-table td small {margin-top:2px;}
.personnel-table td:last-child a {display:inline-block;margin-right:8px;white-space:nowrap;}
@media(max-width:600px){.personnel-status-inline .personnel-status-button{min-height:44px;}}

.health-document-confirmation[hidden]{display:none!important}.employee-card .health-document-confirmation input{display:inline-block;width:18px;height:18px;margin-right:8px;vertical-align:middle}.health-document-confirmation{padding:12px;background:#fff8d6;border-radius:8px;line-height:1.6;}

/* Personnel and supervisor pages must shrink around long names and addresses. */
.employee-card{width:calc(100% - 48px);margin-left:auto;margin-right:auto}
.employee-heading>*,.employee-header>*,.demo-section-title>*,.credential-row>*,.demo-membership>*{min-width:0;max-width:100%}
.employee-card :is(h1,h2,h3,p,label,small),.employee-card>a,
.supervisor-accounts-panel>p,.demo-membership strong,.demo-account-result,.demo-account-state{overflow-wrap:anywhere}
.employee-card label{line-height:1.6}
.employee-header nav{min-width:0}
.supervisor-accounts-table{min-width:0;max-width:100%;overflow-x:auto;overscroll-behavior-x:contain}
.supervisor-accounts-table table{min-width:720px}
.supervisor-accounts-table td{overflow-wrap:anywhere}
.supervisor-accounts-table td:first-child{max-width:280px}
.supervisor-accounts-table details{max-width:360px;white-space:normal}
.supervisor-accounts-panel .creation-field select{display:block;width:100%;min-width:0;padding:11px 12px;border:1px solid #d7dfed;border-radius:9px;background:#fff;color:#172445;font:inherit;min-height:43px}
.supervisor-accounts-panel .creation-field select:focus{outline:3px solid #e1e9ff;border-color:#3455ed}
.demo-card :is(h2,h3,p,label),.demo-body dialog :is(h2,h3,p,label){overflow-wrap:anywhere}
.employee-body dialog,.institution-app dialog,.demo-body dialog{max-height:calc(100dvh - 32px);overscroll-behavior:contain}
.demo-body dialog label:has(>input[type=checkbox]),.supervisor-accounts-table form>label:has(>input[type=checkbox]){display:block;line-height:1.7;text-align:start}
.demo-body dialog label>input[type=checkbox],.supervisor-accounts-table form>label>input[type=checkbox]{width:20px;height:20px;margin-right:8px;vertical-align:middle}
.temporary-password-controls>[hidden]{display:none!important}
.demo-body #demo-first-login-dialog [hidden]{display:none!important}
.temporary-password-table td:nth-child(2),.temporary-password-account-table td:nth-child(2){max-width:280px;white-space:normal;overflow-wrap:anywhere}
.demo-body .temporary-password-table{width:calc(100% - 32px)}
.demo-body [data-demo-account-table] td:nth-child(2){min-width:190px}
.demo-body [data-demo-account-table] .quick-actions{margin:0;gap:6px}
@media(min-width:1025px){
 .demo-body [data-demo-account-table] .secondary-button{min-height:32px;margin:0;padding:6px 9px;font-size:12px;line-height:1.4}
}

/* Touch controls grow on tablets and phones; desktop personnel rows stay compact. */
@media(max-width:1024px){
 .employee-header nav{gap:4px 14px}
 .employee-header nav a{display:inline-flex;align-items:center;min-height:44px;overflow-wrap:anywhere}
 .employee-card .decision-actions>a,.employee-card .decision-actions>button,
 .employee-card form>.primary-button,.employee-card form>.secondary-button,
 .app-body .temporary-password-cell .temporary-password-form .secondary-button,
 .app-body .temporary-password-cell .temporary-password-controls>.secondary-button,
 .demo-body .demo-card td button,.demo-body .demo-card td a.secondary-button{min-height:44px;min-width:44px}
 .app-body .temporary-password-cell .temporary-password-form .secondary-button,
 .app-body .temporary-password-cell .temporary-password-controls>.secondary-button{font-size:13px}
 .demo-body .demo-card td button,.demo-body .demo-card td a.secondary-button{font-size:13px}
 .supervisor-accounts-table summary{min-height:44px;padding:10px 0;line-height:1.7}
 .employee-card .leave-record summary{min-height:44px;padding:4px 0}
 .demo-body dialog .demo-section-title>button,.app-body dialog .icon-button{min-width:44px;min-height:44px;flex-shrink:0}
 .employee-body dialog form,.institution-app dialog form,.demo-body dialog form{text-align:start}
}

@media(max-width:600px){
 .employee-card,.employee-card.narrow{width:auto;margin-left:12px;margin-right:12px}
 .employee-header{padding:14px 18px;gap:10px}
 .employee-header nav{width:100%;gap:0 16px;font-size:14px}
 .employee-card form .decision-actions>*,.employee-card>nav.decision-actions>a{flex:1 1 130px;min-width:0;max-width:100%;white-space:normal;text-align:center;justify-content:center}
 .employee-card form>.primary-button,.employee-card form>.secondary-button{max-width:100%;white-space:normal}
 .employee-card .employee-heading>.primary-button{width:100%;white-space:normal}
 .employee-card .leave-record>a{display:inline-flex;align-items:center;min-height:44px;overflow-wrap:anywhere}
 .supervisor-accounts-panel{padding:18px}
 .supervisor-accounts-panel :is(label,p,small){overflow-wrap:anywhere}
 .demo-body dialog .demo-section-title,.app-body dialog .dialog-heading{align-items:flex-start}
}

/* Keep standard list rows at 40 px across desktop and mobile layouts. */
:is(.app-body,.employee-body) table > tbody > tr { height:40px; }
:is(.app-body,.employee-body) :is(table,.its-table) > tbody > tr > :is(td,th) {
 padding-block:2.5px;
 line-height:1.15;
 vertical-align:middle;
}
:is(.app-body,.employee-body) table tbody td .leave-period-note {
 margin-block:2px 0;
 font-size:11px;
 line-height:1.15;
}
:is(.app-body,.employee-body) table tbody td :is(.tag,.demo-badge) {
 padding-block:3px;
 line-height:1.15;
 white-space:nowrap;
}
:is(.app-body,.employee-body) :is(.table-responsive,.demo-table-scroll,.real-leave-table)
 > table > tbody > tr > td { white-space:nowrap; }
:is(.app-body,.employee-body) table tbody td .decision-actions { flex-wrap:nowrap; }
:is(.app-body,.employee-body) table tbody td :is(.decision-action,.personnel-status-button,.secondary-button,.primary-button) {
 min-height:30px;
 padding-block:4px;
 line-height:1.2;
 white-space:nowrap;
}
.app-body #staff-rows > tr > td { padding-block:2.5px; }
.app-body .demo-card #staff-rows td:first-child { white-space:nowrap; }
.app-body #staff-rows .personnel-status-inline {
 display:inline-flex;
 margin:0 0 0 8px;
 vertical-align:middle;
}
.app-body #staff-rows .personnel-status-inline .personnel-status-button { min-height:26px; }
.app-body .personnel-table td:last-child { white-space:nowrap; }
