:root{font-family:'Be Vietnam Pro',sans-serif;color:#20323f;background:#f2f5f7;--blue:#126d96;--dark:#163647;--line:#dce4e8;--green:#14956f;--red:#c44343;--amber:#c17a14}
*{box-sizing:border-box}
body{margin:0}
button,input,select{font:inherit}
button{cursor:pointer}
.hidden{display:none!important}
.auth{min-height:100dvh;display:flex;flex-direction:column;align-items:center;justify-content:center;padding:24px;background:linear-gradient(145deg,#0e5879,#183d51);color:white;text-align:center}
.auth-mark,.brand i{display:grid;place-items:center;width:58px;height:58px;border-radius:18px;background:#fff;color:var(--blue);font-size:32px;font-weight:800;font-style:italic}
.auth p{font-size:11px;letter-spacing:.15em;margin:18px 0 0}
.auth h1{font-size:38px;margin:6px 0 24px}
.auth form{width:min(380px,100%);padding:24px;background:white;color:var(--dark);border-radius:14px;text-align:left;box-shadow:0 20px 60px #082a3b88}
.auth label,.toolbar label,.form-grid label{display:flex;flex-direction:column;gap:7px;font-size:12px;font-weight:700}
.auth input,.toolbar input,.toolbar select,.form-grid input,.form-grid select{height:43px;border:1px solid #ccd8de;border-radius:7px;padding:0 11px;background:#fff}
.auth button,.primary{border:0;background:var(--blue);color:white;font-weight:700}
.auth form button{width:100%;height:45px;border-radius:7px;margin-top:16px}
.auth small{display:block;min-height:20px;margin-top:10px;color:var(--red)}
.auth>a{color:#d8eff9;margin-top:22px}
.shell{display:grid;grid-template-columns:228px minmax(0,1fr);min-height:100dvh}
.shell>aside{position:sticky;top:0;height:100dvh;background:#14384a;color:#dbeaf0;padding:20px 14px;display:flex;flex-direction:column}
.brand{display:flex;gap:10px;align-items:center;color:white;text-decoration:none;padding:4px 7px 24px}
.brand i{width:40px;height:40px;border-radius:12px;font-size:22px}
.brand span{display:grid}
.brand small{font-size:10px;color:#a9c2cd}
.shell nav{display:grid;gap:5px}
.shell nav button{border:0;background:transparent;color:#c5d6dc;text-align:left;padding:12px;border-radius:7px}
.shell nav button.active{background:#eef7fb;color:#0d668e;font-weight:700}
.aside-foot{margin-top:auto;display:grid;gap:8px}
.aside-foot a,.aside-foot button{border:1px solid #54707e;background:transparent;color:white;border-radius:7px;padding:10px;text-align:center;text-decoration:none;font-size:12px}
.shell main{min-width:0;padding:0 24px 40px}
.shell header{height:78px;display:flex;align-items:center;justify-content:space-between;border-bottom:1px solid var(--line);margin-bottom:22px}
.shell header span,.section-head span{font-size:10px;letter-spacing:.12em;color:#6c7e87;font-weight:700}
.shell header h1{font-size:24px;margin:3px 0}
.sync{display:flex;align-items:center;gap:8px;font-size:12px}
.sync i{width:8px;height:8px;border-radius:50%;background:#22a57d}
.sync button,#mobileNav{border:0;background:#fff;border-radius:50%;width:36px;height:36px}
.view{display:none}
.view.active{display:block}
.metrics{display:grid;grid-template-columns:repeat(6,minmax(0,1fr));gap:12px;margin-bottom:16px}
.metrics>div,article{background:#fff;border:1px solid var(--line);border-radius:9px}
.metrics>div{padding:16px}
.metrics span{display:block;font-size:11px;color:#70808a}
.metrics strong{display:block;font-size:23px;margin-top:7px;color:var(--dark)}
.metrics .alert strong{color:var(--red)}
.metrics.compact{grid-template-columns:repeat(4,minmax(0,1fr));margin-top:16px}
.dashboard-grid,.device-grid{display:grid;grid-template-columns:1.35fr 1fr;gap:16px;margin-bottom:16px}
.dashboard-grid article,.device-grid article,article:not(.table-card){padding:18px}
.section-head{display:flex;align-items:center;justify-content:space-between;margin-bottom:14px}
.section-head h2{font-size:17px;margin:3px 0}
.queue-row,.device-row,.event-row{display:flex;align-items:center;gap:12px;border-top:1px solid #edf1f3;padding:11px 0;font-size:12px}
.queue-row:first-child,.device-row:first-child{border-top:0}
.queue-row b,.device-row div,.event-row div{flex:1}
.badge{display:inline-block;padding:4px 8px;border-radius:99px;background:#eaf1f4;color:#4d6672;font-size:10px;font-weight:700}
.badge.red{background:#fdecec;color:#b03b3b}
.badge.green{background:#e4f6ef;color:#13775d}
.badge.amber{background:#fff2d8;color:#9b620e}
.flow{display:flex;align-items:center;justify-content:space-between;gap:10px;overflow:auto}
.flow b{white-space:nowrap;padding:10px 12px;background:#eff7fa;color:#126b91;border-radius:7px;font-size:12px}
.flow i{color:#9aabb3}
.toolbar{display:flex;gap:10px;align-items:end;flex-wrap:wrap;margin-bottom:15px}
.toolbar label{min-width:180px}
.toolbar button,.device-row button,.request-action button,.table-card button{height:43px;padding:0 13px;border:1px solid #c8d6dd;border-radius:7px;background:#fff;color:#254552;font-weight:600}
.profile-private-button{width:100%;min-height:44px;margin:14px 0 2px;border:1px solid #91b4c3;border-radius:9px;background:#eef7fa;color:#0d668e;font-weight:700}
.private-profile-content{min-width:min(760px,80vw);padding-top:8px}.private-data{display:grid;grid-template-columns:130px 1fr;gap:10px 16px;padding:14px;border:1px solid #dce7eb;border-radius:10px;background:#f8fbfc}.private-data span{color:#6c818a}.cccd-images{display:grid;grid-template-columns:1fr 1fr;gap:14px;margin-top:16px}.cccd-images figure{margin:0}.cccd-images figcaption{font-weight:700;margin-bottom:8px}.cccd-images img{display:block;width:100%;max-height:320px;object-fit:contain;border:1px solid #d9e3e7;border-radius:10px;background:#eef3f5}
.toolbar .primary,.table-card .primary{background:var(--blue);color:#fff;border-color:var(--blue)}
.table-card{overflow:auto}
.table-card table{width:100%;border-collapse:collapse;min-width:900px}
th,td{text-align:left;padding:12px 11px;border-bottom:1px solid #e8edef;font-size:12px;vertical-align:middle}
th{background:#f7f9fa;color:#667983;font-size:10px;text-transform:uppercase;letter-spacing:.04em}
.employee-cell{display:grid}
.employee-cell small{color:#778891}
.money{font-weight:700;color:#17495d}
.schedule-card{overflow:auto;padding:0}
.schedule-grid{min-width:1050px}
.schedule-head,.schedule-row{display:grid;grid-template-columns:190px repeat(7,minmax(118px,1fr));border-bottom:1px solid var(--line)}
.schedule-head>div,.schedule-row>div{padding:10px;border-right:1px solid var(--line);min-height:64px}
.schedule-head{background:#f8fafb;text-align:center;font-size:11px}
.schedule-row .person{display:flex;flex-direction:column;gap:5px;background:#fbfcfc}
.schedule-row select{width:100%;height:34px;border:1px solid #ccd9df;border-radius:6px;background:white}
.availability{display:block;color:#168166;font-size:9px;margin-top:4px}
.published-cell{background:#e7f6ef}
.draft-cell{background:#eef7fb}
.warning-box{padding:11px 14px;margin-bottom:12px;border:1px solid #f0ce8d;background:#fff7e7;color:#8a5708;border-radius:7px;font-size:12px}
.legend{display:flex;gap:18px;padding:12px 0;font-size:11px}
.legend i{display:inline-block;width:9px;height:9px;border-radius:2px;margin-right:5px}
.legend .available{background:#1b9a74}
.legend .draft{background:#b9dfef}
.legend .published{background:#9edabf}
.request-card{display:flex;align-items:center;gap:12px;border-top:1px solid var(--line);padding:10px}
.request-card div{flex:1}
.request-action{display:flex;gap:6px}
dialog{width:min(680px,calc(100% - 24px));border:0;border-radius:12px;padding:22px;color:var(--dark);box-shadow:0 25px 90px #102f3f55}
dialog::backdrop{background:#102d3d99}
.dialog-head{display:flex;justify-content:space-between;align-items:start;margin-bottom:16px}
.dialog-head h2{margin:3px 0}
.dialog-head span{font-size:10px;color:#657985;letter-spacing:.1em}
.dialog-head button{border:0;background:#edf2f4;border-radius:50%;width:35px;height:35px;font-size:20px}
.form-grid{display:grid;grid-template-columns:1fr 1fr;gap:14px}
.form-grid .check{flex-direction:row;align-items:center;margin-top:22px}
.form-grid .check input{height:auto}
.wide{width:100%;height:44px;border-radius:7px}
.hint{font-size:11px;color:#738690;line-height:1.5}
.station-link{display:block;border:1px solid #d7e2e7;border-radius:7px;padding:10px;margin:8px 0;color:#126d96;text-decoration:none;font-size:12px}
#qrDialog{text-align:center;max-width:430px}
#salaryQr{width:min(300px,100%);display:block;margin:auto}
#qrAmount{display:block;font-size:26px;color:var(--blue)}
#qrDialog small{display:block;margin-top:10px;color:#7c8c94}
#toast{position:fixed;right:20px;bottom:20px;z-index:99;background:#173d4f;color:#fff;padding:12px 16px;border-radius:8px;opacity:0;transform:translateY(15px);transition:.2s;pointer-events:none;font-size:12px}
#toast.show{opacity:1;transform:none}
@media(max-width:1100px){.metrics{grid-template-columns:repeat(3,1fr)}
.dashboard-grid,.device-grid{grid-template-columns:1fr}
}
@media(max-width:720px){.shell{grid-template-columns:1fr}
.shell>aside{position:fixed;z-index:20;width:230px;transform:translateX(-100%);transition:.2s}
.shell>aside.open{transform:none}
.shell main{padding:0 12px 28px}
.metrics{grid-template-columns:repeat(2,1fr)}
.form-grid{grid-template-columns:1fr}
.flow{justify-content:flex-start}
.shell header{height:68px}
.shell header h1{font-size:19px}
.sync span{display:none}
.toolbar>*{flex:1}
.toolbar label{min-width:140px}
th,td{padding:10px 8px}
#mobileNav{display:inline-grid}
}
@media(min-width:721px){#mobileNav{display:none}
}
.nav-count{float:right;background:#c44343;color:#fff;border-radius:99px;padding:1px 6px;font-size:10px}
.policy-note{font-size:12px;color:#506a76;margin:-5px 0 12px}
.before-box,.preview-box{padding:12px;background:#f4f7f8;border:1px solid var(--line);border-radius:8px;margin-bottom:14px;font-size:12px;line-height:1.7}
.preview-box{margin-top:14px;background:#eef8f4;border-color:#c4e3d6}
.form-grid textarea{border:1px solid #ccd8de;border-radius:7px;padding:10px;resize:vertical;font:inherit}
.full-field{grid-column:1/-1}
.approval-item{display:grid;grid-template-columns:minmax(0,1fr) auto;gap:14px;align-items:center;border-top:1px solid #edf1f3;padding:13px 0}
.approval-item:first-child{border-top:0}
.approval-item p{margin:4px 0 0;color:#6a7c85;font-size:11px}
.approval-actions{display:flex;gap:7px;flex-wrap:wrap}
.approval-actions button{height:36px;border:1px solid #c8d6dd;border-radius:7px;background:#fff}
.approval-actions .primary{background:var(--blue);color:#fff}
.matrix-card{background:#fff;border:1px solid var(--line);border-radius:9px;padding:14px;margin-bottom:15px;overflow:auto}
.matrix{display:grid;gap:3px;min-width:760px}
.matrix-row{display:grid;grid-template-columns:160px repeat(var(--days),minmax(24px,1fr));gap:3px;align-items:center}
.matrix-name{position:sticky;left:0;background:#fff;z-index:1;font-size:11px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.matrix-cell{height:29px;border-radius:5px;background:#eef2f4;display:grid;place-items:center;font-size:9px}
.matrix-cell.approved{background:#dff3ea;color:#16765b}
.matrix-cell.pending_review{background:#fde6e6;color:#a73535}
.matrix-cell.open{background:#fff0cf;color:#99600b}
.matrix-head .matrix-cell{background:transparent;color:#6d7f88;font-weight:700}
.table-card input[type=checkbox]{width:17px;height:17px}
@media(max-width:720px){.approval-item{grid-template-columns:1fr}.full-field{grid-column:auto}}

/* UI alignment pass — clearer hierarchy, denser data views, reliable tablet/mobile layout */
:root{--surface:#fff;--surface-soft:#f7fafb;--text-muted:#647983;--shadow:0 1px 2px rgba(20,54,71,.05),0 8px 24px rgba(20,54,71,.04);font-size:14px}
body{min-width:320px;background:#f3f6f8;color:#203642;line-height:1.45;-webkit-font-smoothing:antialiased}
button,input,select,textarea{font-size:13px}
button{min-height:40px;transition:border-color .15s,background .15s,color .15s,box-shadow .15s,transform .1s}
button:not(:disabled):active{transform:translateY(1px)}
button:disabled{cursor:not-allowed;opacity:.55}
button:focus-visible,input:focus-visible,select:focus-visible,textarea:focus-visible{outline:3px solid rgba(18,109,150,.16);outline-offset:1px;border-color:var(--blue)}
.shell{grid-template-columns:244px minmax(0,1fr)}
.shell>aside{padding:18px 14px;background:linear-gradient(180deg,#153b4e 0%,#102f40 100%);box-shadow:8px 0 28px rgba(15,48,65,.07)}
.brand{padding:6px 8px 26px;gap:12px}.brand i{width:42px;height:42px;border-radius:13px}.brand b{font-size:15px}.brand small{font-size:10px;margin-top:2px}
.shell nav{gap:4px}.shell nav button{display:flex;align-items:center;width:100%;min-height:44px;padding:11px 13px;border-radius:10px;font-size:13px;line-height:1.2}.shell nav button.active{background:#fff;color:#0d668e;box-shadow:0 5px 15px rgba(5,30,44,.14)}
.nav-count{margin-left:auto;float:none}.aside-foot{gap:10px}.aside-foot a,.aside-foot button{min-height:40px;border-radius:9px;font-size:12px}
.shell main{padding:0 28px 48px}.shell main>header{position:sticky;top:0;z-index:12;height:76px;margin-bottom:24px;background:rgba(243,246,248,.94);backdrop-filter:blur(12px)}
.shell header span,.section-head span{font-size:10px}.shell header h1{font-size:25px;line-height:1.15;margin-top:4px}
.sync{padding:6px 6px 6px 11px;border:1px solid var(--line);border-radius:999px;background:#fff;box-shadow:0 1px 2px rgba(20,54,71,.05)}.sync button{width:34px;height:34px;min-height:34px;font-size:18px}
.view{max-width:1600px;margin:0 auto}
.metrics{gap:14px;margin-bottom:18px}.metrics>div,article,.matrix-card{border-radius:13px;border-color:#dfe7eb;box-shadow:var(--shadow)}
.metrics>div{min-height:100px;padding:17px 18px;display:flex;flex-direction:column;justify-content:center}.metrics span{font-size:11px;line-height:1.35}.metrics strong{font-size:24px;line-height:1.15;margin-top:8px;letter-spacing:-.02em}
.metrics.compact{gap:12px}.metrics.compact>div{min-height:86px;padding:14px 16px}.metrics.compact strong{font-size:21px}
.dashboard-grid,.device-grid{gap:18px;margin-bottom:18px}.dashboard-grid article,.device-grid article,article:not(.table-card){padding:20px}.section-head{gap:16px;margin-bottom:16px}.section-head h2{font-size:18px;line-height:1.3;margin:4px 0 0}
.queue-row,.device-row,.event-row{min-height:54px;gap:14px;padding:12px 0;font-size:13px}.queue-row em,.device-row em,.event-row em{font-style:normal}.badge{padding:5px 9px;font-size:10px;line-height:1.25}
.flow{justify-content:flex-start;gap:8px;padding:2px 0 4px}.flow b{padding:11px 14px;border-radius:9px;font-size:12px}.flow i{font-style:normal}
.toolbar{gap:10px;margin-bottom:18px;padding:14px;background:#fff;border:1px solid var(--line);border-radius:13px;box-shadow:var(--shadow)}.toolbar label{min-width:176px;gap:6px;font-size:11px;color:#526b77}
.toolbar input,.toolbar select,.form-grid input,.form-grid select{height:42px;border-radius:9px;border-color:#cad7dd;font-size:13px;color:#243f4c}
.toolbar button,.device-row button,.request-action button,.table-card button,.approval-actions button{min-height:42px;height:42px;padding:0 14px;border-radius:9px;font-size:12px;white-space:nowrap}
.toolbar button:hover,.device-row button:hover,.request-action button:hover,.table-card button:hover,.approval-actions button:hover{border-color:#8eabb8;background:#f8fbfc}.toolbar .primary:hover,.table-card .primary:hover,.approval-actions .primary:hover{background:#0e6288;border-color:#0e6288}
.table-card{border-radius:13px;background:#fff;box-shadow:var(--shadow);scrollbar-width:thin;scrollbar-color:#bdcbd2 transparent}.table-card table{min-width:940px}.table-card th,.table-card td{padding:13px 14px;font-size:12px;line-height:1.45}
.table-card th{position:sticky;top:0;z-index:2;height:45px;background:#f6f9fa;color:#607681;font-size:10px}.table-card tbody tr:hover td{background:#f9fbfc}.table-card tbody tr:last-child td{border-bottom:0}
.employee-cell{gap:3px}.employee-cell b{font-size:13px}.employee-cell small{font-size:10px}
.schedule-card{border-radius:13px;box-shadow:var(--shadow);scrollbar-width:thin}.schedule-grid{min-width:1120px}.schedule-head,.schedule-row{grid-template-columns:210px repeat(7,minmax(128px,1fr))}
.schedule-head{position:sticky;top:0;z-index:4;color:#536b77;font-size:11px}.schedule-head>div,.schedule-row>div{min-height:68px;padding:11px 10px}.schedule-head>div:first-child,.schedule-row .person{position:sticky;left:0;z-index:3;box-shadow:1px 0 0 var(--line)}
.schedule-head>div:first-child{z-index:5;background:#f7fafb;display:flex;align-items:center;justify-content:flex-start;font-weight:700}.schedule-row .person{justify-content:center;padding-left:14px;background:#fff}.schedule-row .person b{font-size:12px}.schedule-row .person small{font-size:10px;color:#70838c}
.schedule-row select{height:38px;border-radius:8px}.availability{font-size:9px;line-height:1.35;margin-top:5px}.published-cell{background:#ecf8f3}.draft-cell{background:#eef8fc}
.warning-box{padding:13px 15px;margin-bottom:14px;border-radius:10px;font-size:12px;line-height:1.55}.legend{gap:20px;padding:13px 2px 18px;font-size:11px;flex-wrap:wrap}
.request-card{min-height:62px;padding:12px 15px;gap:14px}.request-card small{font-size:11px;color:#6f828b}
dialog{width:min(720px,calc(100% - 32px));max-height:min(88dvh,820px);overflow:auto;border-radius:16px;padding:24px;box-shadow:0 30px 100px rgba(10,40,55,.34)}.dialog-head{position:sticky;top:-24px;z-index:2;margin:-24px -24px 18px;padding:22px 24px 14px;background:#fff;border-bottom:1px solid #edf1f3}.dialog-head h2{font-size:21px;line-height:1.25}.dialog-head button{min-height:38px;width:38px;height:38px}
.form-grid{gap:15px}.form-grid label{gap:7px;font-size:12px;color:#4c6672}.form-grid textarea{min-height:90px;border-radius:9px}.wide{margin-top:18px;height:46px;border-radius:9px}.hint{font-size:12px}.station-link{min-height:42px;padding:11px 12px;border-radius:9px;font-size:12px}
#toast{right:24px;bottom:24px;max-width:min(420px,calc(100% - 32px));padding:13px 17px;border-radius:10px;font-size:12px;box-shadow:0 12px 35px rgba(12,44,59,.22)}
.approval-item{min-height:68px;padding:14px 0;gap:18px}.approval-item b{font-size:13px}.approval-item p{font-size:11px;line-height:1.45}.matrix-card{padding:16px;margin-bottom:18px}.matrix{gap:4px}.matrix-row{grid-template-columns:180px repeat(var(--days),minmax(29px,1fr));gap:4px}.matrix-name{padding:0 8px;font-size:11px}.matrix-cell{height:32px;border-radius:6px;font-size:9px}
@media(max-width:1280px){.shell{grid-template-columns:224px minmax(0,1fr)}.shell main{padding-left:22px;padding-right:22px}.metrics{grid-template-columns:repeat(3,minmax(0,1fr))}.toolbar label{min-width:158px}}
@media(max-width:900px){.shell{grid-template-columns:210px minmax(0,1fr)}.shell>aside{padding-left:10px;padding-right:10px}.dashboard-grid,.device-grid{grid-template-columns:1fr}.toolbar{align-items:stretch}.toolbar label{flex:1 1 180px}.toolbar button{flex:0 1 auto}}
@media(max-width:700px){.private-profile-content{min-width:0}.private-data{grid-template-columns:1fr}.cccd-images{grid-template-columns:1fr}}
@media(max-width:720px){
.shell{display:block}.shell>aside{width:min(286px,84vw);padding:18px 14px;box-shadow:18px 0 50px rgba(8,35,49,.28)}.shell main{padding:0 14px 34px}.shell main>header{height:68px;margin-bottom:18px}
.shell header>div:first-child{display:grid;grid-template-columns:38px 1fr;column-gap:9px;align-items:center}.shell header>div:first-child>span{grid-column:2}.shell header h1{grid-column:2;font-size:20px;margin-top:-2px}#mobileNav{grid-row:1/3;width:38px;height:38px;min-height:38px;border-radius:10px}
.sync{padding:4px;background:transparent;border:0;box-shadow:none}.sync i,.sync span{display:none}.metrics,.metrics.compact{grid-template-columns:repeat(2,minmax(0,1fr));gap:10px}.metrics>div,.metrics.compact>div{min-height:88px;padding:14px}.metrics strong,.metrics.compact strong{font-size:20px}.metrics span{font-size:10px}
.dashboard-grid,.device-grid{gap:12px}.dashboard-grid article,.device-grid article,article:not(.table-card){padding:16px}.section-head h2{font-size:17px}.toolbar{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));padding:12px;gap:9px}.toolbar>*{width:100%;min-width:0!important;flex:none}.toolbar label{grid-column:span 1}.toolbar button{padding:0 10px;white-space:normal;line-height:1.2}.toolbar .primary{grid-column:span 2}
.table-card{margin-left:-14px;margin-right:-14px;border-left:0;border-right:0;border-radius:0}.table-card table{min-width:840px}.table-card th,.table-card td{padding:11px 10px}.schedule-card{margin-left:-14px;margin-right:-14px;border-radius:0;border-left:0;border-right:0}.schedule-grid{min-width:1050px}.schedule-head,.schedule-row{grid-template-columns:170px repeat(7,minmax(125px,1fr))}.schedule-head>div,.schedule-row>div{min-height:66px}
.legend{gap:12px}.flow{padding-bottom:8px}.flow b{padding:10px 12px}.request-card{align-items:flex-start;flex-wrap:wrap}.request-card>div{min-width:calc(100% - 92px)}.request-action{width:100%;justify-content:flex-end}.approval-actions{justify-content:flex-start}
dialog{width:calc(100% - 20px);max-height:92dvh;padding:18px;border-radius:14px}.dialog-head{top:-18px;margin:-18px -18px 16px;padding:18px 18px 13px}.dialog-head h2{font-size:19px}.form-grid{grid-template-columns:1fr}.full-field{grid-column:auto}.matrix-card{margin-left:-14px;margin-right:-14px;border-radius:0;border-left:0;border-right:0}#toast{left:16px;right:16px;bottom:18px;max-width:none;text-align:center}}
@media(max-width:420px){.toolbar{grid-template-columns:1fr}.toolbar label,.toolbar .primary{grid-column:auto}.metrics,.metrics.compact{gap:8px}.metrics>div,.metrics.compact>div{padding:12px;min-height:82px}.request-card>div{min-width:100%}.approval-actions{width:100%}.approval-actions button{flex:1}}
