:root{--green:#246d51;--dark:#174f3a;--soft:#e7f3ed;--navy:#17212d;--ink:#18221f;--muted:#748078;--line:#dce2df;--canvas:#f7f8fb;--cream:#f3f1e9;--red:#d43b35;--orange:#db7a14;--shadow:0 2px 8px #1a2d2418;font-family:'Sarabun','Noto Sans Thai',system-ui,sans-serif}
*{box-sizing:border-box}html,body{width:100%;min-height:100%;background:#e6f1fa;overflow-x:hidden}body{margin:0;color:var(--ink);font-family:'Sarabun','Noto Sans Thai',Tahoma,system-ui,sans-serif;font-size:16px;font-weight:400;line-height:1.55;-webkit-font-smoothing:antialiased;text-rendering:optimizeLegibility}button,input,select,textarea{font:inherit}.hidden{display:none!important}
.auth-screen{min-height:100vh;min-height:100dvh;width:100%;max-width:440px;margin:0 auto;background:var(--cream);box-shadow:0 0 30px #13251d24}.auth-top{background:var(--navy);color:#fff;padding:calc(12px + env(safe-area-inset-top)) 16px 12px}.auth-top p{margin:0;color:#cbd3dc;font-size:13px}.auth-content{width:100%;margin:auto;padding:20px 24px 40px;text-align:center}.auth-logo{width:104px;height:104px;border-radius:50%;background:#fff;padding:8px;object-fit:cover}.auth-content h1{color:var(--green);margin:5px 0 12px}.auth-card{background:#fff;border:1px solid #e7e5dc;border-radius:8px;padding:20px;text-align:left;box-shadow:var(--shadow)}.auth-card h2{margin:0 0 14px}.overline{font-size:13px;letter-spacing:.12em;color:var(--muted);margin:0}.auth-card label,.field{display:grid;gap:6px;margin-top:14px;font-size:14px;font-weight:600}.auth-card input,input,select,textarea{width:100%;min-height:44px;border:1px solid #cbd3cf;border-radius:6px;padding:10px 12px;background:#fff;outline:none}input:focus,select:focus,textarea:focus{border-color:var(--green);box-shadow:0 0 0 3px #d9eee4}.button{min-height:42px;border:0;border-radius:6px;padding:10px 16px;font-weight:700;cursor:pointer}.button.primary{color:#fff;background:var(--green)}.button.secondary{color:var(--green);background:#fff;border:1px solid var(--line)}.button.danger{color:var(--red);background:#ffe8e6;border:1px solid #f07c75}.wide{width:100%;margin-top:20px}.demo{font-size:13px;color:var(--muted)}
.app{width:100%;max-width:440px;min-height:100vh;min-height:100dvh;margin:0 auto;background:var(--canvas);box-shadow:0 0 30px #13251d24;padding-bottom:calc(74px + env(safe-area-inset-bottom))}.app-header{min-height:54px;padding:calc(7px + env(safe-area-inset-top)) 14px 7px;background:#faf9ff;border-bottom:1px solid var(--line);display:flex;align-items:center;gap:8px;position:sticky;top:0;z-index:10}.app-header img{width:28px;height:28px}.app-header strong{font-size:14px;flex:1;text-align:center}.install{border:0;border-radius:99px;background:var(--soft);color:var(--green);font-size:13px;padding:5px 8px}main{width:100%;margin:0;padding:18px 14px 30px}.page-title{color:var(--green);font-size:24px;line-height:1.2;margin:0}.subtitle{color:var(--muted);font-size:13px;margin:3px 0 15px}.section-title{font-size:15px;margin:20px 0 9px;display:flex;align-items:center;justify-content:space-between}.section-title a{font-size:13px;color:var(--green)}
.stats{display:grid;grid-template-columns:1fr 1fr;gap:10px}.stat{background:#fff;border:1px solid #edf0ee;border-left:3px solid #7892ad;border-radius:8px;padding:13px;box-shadow:var(--shadow)}.stat.green{border-left-color:var(--green)}.stat.orange{border-left-color:var(--orange)}.stat.red{border-left-color:var(--red)}.stat strong{font-size:25px;line-height:1.1;display:block}.stat span{font-size:13px;color:var(--muted)}.search{position:relative;margin:10px 0}.search input{padding-left:38px}.search:before{content:'⌕';position:absolute;left:12px;top:8px;font-size:20px;color:var(--green)}
.card{background:#fff;border:1px solid var(--line);border-left:3px solid var(--green);border-radius:8px;padding:12px;margin:10px 0;box-shadow:var(--shadow)}.equipment-card{display:grid;grid-template-columns:58px 1fr;gap:10px}.device-art{width:58px;height:65px;border:1px solid var(--line);border-radius:6px;background:linear-gradient(145deg,#f3f6f4,#fff);display:grid;place-items:center;color:var(--green);font-size:26px}.card h3{margin:0;font-size:15px}.code{font-size:13px;color:var(--muted);letter-spacing:.06em}.meta{font-size:13px;color:var(--muted);margin:3px 0}.card-action{grid-column:1/-1;display:flex;gap:8px}.card-action .button{min-height:34px;padding:6px;font-size:13px;flex:1}.badge{display:inline-flex;padding:3px 7px;border-radius:99px;font-size:13px;font-weight:700}.badge.available,.badge.returned,.badge.normal{color:var(--green);background:var(--soft)}.badge.borrowed{color:var(--orange);background:#fff0d9}.badge.outOfStock,.badge.maintenance,.badge.damaged,.badge.abnormal,.badge.lost{color:var(--red);background:#ffe9e7}
.device-image{width:100%;height:100%;display:block;object-fit:cover;border-radius:5px}
.image-upload{display:grid;grid-template-columns:110px 1fr;gap:14px;align-items:center;margin-top:14px}.image-preview{width:110px;height:100px;border:1px dashed #aab8b1;border-radius:9px;background:#fff;display:grid;place-items:center;overflow:hidden;color:var(--muted);font-size:13px;text-align:center}.image-preview img{width:100%;height:100%;object-fit:cover}.image-upload input[type=file]{padding:8px;background:#fff}.image-help{font-size:13px;color:var(--muted);margin:5px 0 0}
.filter-row{display:flex;gap:6px;overflow:auto;padding-bottom:4px}.chip{border:0;background:#edf0f7;color:#67706d;border-radius:99px;padding:6px 12px;font-size:13px;white-space:nowrap}.chip.active{background:var(--green);color:#fff}.loan-card{display:grid;grid-template-columns:40px 1fr auto;gap:9px;align-items:start}.loan-card .device-art{width:40px;height:48px;font-size:19px}.loan-card footer{grid-column:2/-1;border-top:1px solid #edf0ee;margin-top:7px;padding-top:7px;display:flex;justify-content:space-between;align-items:center;gap:10px;font-size:13px}.cart-bar{position:fixed;z-index:9;bottom:calc(68px + env(safe-area-inset-bottom));left:16px;right:16px;max-width:728px;margin:auto;background:var(--navy);color:#fff;padding:9px;border-radius:9px;display:flex;align-items:center;gap:10px;box-shadow:0 7px 18px #0004}.cart-bar span{flex:1;font-size:13px}.cart-list .card{display:grid;grid-template-columns:50px 1fr auto;gap:10px;align-items:center}.counter{display:flex;align-items:center;background:#edf0f7;border-radius:5px}.counter button{border:0;background:none;padding:8px 10px}.counter span{padding:0 4px}.summary{background:#eef1ff;border-radius:8px;padding:14px;margin:14px 0}.summary div{display:flex;justify-content:space-between;margin:7px 0}
.success{text-align:center;padding-top:12px}.success-icon{width:76px;height:76px;margin:auto;background:var(--green);color:#fff;border-radius:50%;display:grid;place-items:center;font-size:40px;border:8px solid #deece5}.profile{text-align:center}.profile-avatar{width:108px;height:108px;border-radius:50%;background:var(--soft);display:grid;place-items:center;margin:20px auto 8px;font-size:45px;overflow:hidden;border:4px solid #fff;box-shadow:0 3px 14px #183b2c22}.profile-avatar img{width:100%;height:100%;object-fit:cover}.profile-image-input{position:absolute;width:1px;height:1px;overflow:hidden;clip-path:inset(50%)}.profile-image-button{display:inline-flex;width:auto;min-height:36px;padding:7px 14px;background:var(--soft);color:var(--green);cursor:pointer}.info-card{text-align:left;background:#fff;border:1px solid var(--line);border-left:3px solid var(--green);border-radius:7px;padding:14px;margin:18px 0}.admin-stock{background:#202a36;color:#fff;border-radius:8px;padding:16px;display:flex;justify-content:space-between}.admin-stock strong{font-size:28px;display:block}

.success{width:min(100%,600px);margin:clamp(20px,5vh,64px) auto 0;padding:0 0 24px}
.success .success-icon{margin:0 auto 20px}
.success .page-title{margin:0 0 12px}
.success .subtitle{max-width:100%;margin:0 auto 28px;text-align:center}
.success .card{margin:0 0 24px;padding:24px 20px;text-align:center}
.success .card:hover{transform:none;box-shadow:var(--shadow-sm)}
.success .card .meta{margin:8px 0 0}
.return-date-input{position:relative}
.return-date-input>input{padding-right:60px}
.return-date-picker{position:absolute;right:4px;top:0;bottom:0;width:48px;display:grid;place-items:center;color:var(--green)}
.return-date-picker svg{width:22px;height:22px;fill:none;stroke:currentColor;stroke-width:1.8;pointer-events:none}
.return-date-picker input{position:absolute;inset:0;width:100%;height:100%;opacity:0;cursor:pointer;padding:0}
.return-date-picker input::-webkit-calendar-picker-indicator{position:absolute;inset:0;width:auto;height:auto;cursor:pointer}
.return-date-picker:focus-within{outline:2px solid var(--green);border-radius:6px}
#dueDateHint{display:block;margin-top:6px;color:var(--muted);font-size:13px}
.success-actions{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px;width:min(100%,380px);margin:0 auto}
.success-actions .button{width:100%;min-height:48px;display:flex;align-items:center;justify-content:center}
@media(max-width:380px){.success-actions{grid-template-columns:1fr}.success .card{padding:20px 16px}}
.bottom-nav{position:fixed;bottom:0;left:50%;transform:translateX(-50%);width:min(100%,440px);background:#fffffff7;backdrop-filter:blur(12px);border-top:1px solid var(--line);padding:6px 4px calc(6px + env(safe-area-inset-bottom));display:grid;grid-template-columns:repeat(5,1fr);z-index:10}.bottom-nav a{min-height:46px;display:grid;place-items:center;color:#a8b1ac;text-decoration:none;text-align:center;font-size:13px}.bottom-nav a b{display:block;font-size:17px;line-height:17px}.bottom-nav a.active{color:var(--green);font-weight:700}.toast{position:fixed;top:calc(16px + env(safe-area-inset-top));left:50%;transform:translate(-50%,-20px);z-index:100;background:var(--navy);color:#fff;padding:10px 16px;border-radius:7px;opacity:0;transition:.2s}.toast.show{opacity:1;transform:translate(-50%,0)}.toast.error{background:var(--red)}dialog{border:0;background:transparent;padding:0}dialog::backdrop{background:#09140f80}.modal-sheet{background:#fff;border-radius:15px 15px 0 0;padding:24px 20px calc(24px + env(safe-area-inset-bottom));width:min(440px,100vw);position:fixed;left:50%;bottom:0;transform:translateX(-50%)}.close{position:absolute;right:14px;top:10px;border:0;background:none;font-size:24px}
@media(max-width:359px){main{padding-left:12px;padding-right:12px}.auth-content{padding-left:16px;padding-right:16px}.card{padding:10px}.equipment-card{grid-template-columns:50px 1fr}.device-art{width:50px;height:58px}.bottom-nav a{font-size:13px}.bottom-nav a b{font-size:16px}.cart-bar{left:10px;right:10px}}
@media(orientation:landscape) and (max-height:600px){.auth-content{padding-top:12px}.auth-logo{width:72px;height:72px}.app-header{position:relative}.bottom-nav a{min-height:40px}}
.bottom-nav a b svg{width:18px;height:18px;display:block;margin:auto;fill:none;stroke:currentColor;stroke-width:1.7;stroke-linecap:round;stroke-linejoin:round}.admin-add{position:absolute;right:14px;top:16px;min-height:32px;padding:5px 12px;font-size:13px}.empty-state{text-align:center;padding:28px 16px;border-left-color:var(--line)}
.admin-page-head{display:flex;align-items:flex-start;justify-content:space-between;gap:12px}.button.compact{min-height:32px;padding:5px 13px;font-size:13px}.admin-equipment-card{display:grid;grid-template-columns:50px minmax(0,1fr) 76px;gap:10px;align-items:center}.admin-equipment-card .device-art{width:50px;height:58px}.admin-card-tools{display:grid;gap:6px}.equipment-image-input{position:absolute;width:1px;height:1px;overflow:hidden;clip-path:inset(50%);white-space:nowrap}.icon-delete,.icon-image{width:76px;min-height:34px;border:0;border-radius:6px;display:flex;align-items:center;justify-content:center;gap:5px;font-size:13px;font-weight:700;cursor:pointer;transition:background .15s,transform .15s}.icon-delete svg,.icon-image svg{width:16px;height:16px;fill:none;stroke:currentColor;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round}.icon-delete{background:#fff0ef;color:var(--red)}.icon-delete:hover{background:#ffdeda}.icon-image{background:var(--soft);color:var(--green)}.icon-image:hover{background:#d4eadf}.icon-delete:active,.icon-image:active{transform:scale(.97)}
.auth-link{margin:14px auto 0;border:0;background:transparent;color:var(--ink);font-size:13px;font-weight:600;text-decoration:underline;cursor:pointer}.form-hint{margin:-8px 0 4px;color:var(--muted);font-size:13px}.auth-card button:disabled{opacity:.65;cursor:wait}#signupView .auth-content{padding-top:12px}#signupView .auth-logo{width:76px;height:76px}#signupView .auth-content h1{font-size:23px;margin-top:2px}#signupView .auth-card{padding-top:18px}#signupView .auth-card label{margin-top:10px}
.auth-card input{transition:border-color .18s ease,box-shadow .18s ease,background .18s ease}.auth-card input:hover{border-color:#9eb4aa}.auth-card .button.primary{transition:transform .18s ease,box-shadow .18s ease,background .18s ease}.auth-card .button.primary:hover{background:#1c6047;box-shadow:0 10px 22px rgba(36,109,81,.24);transform:translateY(-1px)}.auth-card .button.primary:active{transform:translateY(0)}
.password-field{position:relative}.password-field input{padding-right:48px}.password-toggle{position:absolute;right:5px;top:50%;width:38px;height:38px;padding:0;display:grid;place-items:center;transform:translateY(-50%);border:0;border-radius:7px;background:transparent;color:#75847d;cursor:pointer;transition:background .15s,color .15s}.password-toggle:hover,.password-toggle[aria-pressed="true"]{background:var(--soft);color:var(--green)}.password-toggle svg{width:20px;height:20px;fill:none;stroke:currentColor;stroke-width:1.7;stroke-linecap:round;stroke-linejoin:round}.forgot-row{display:flex;justify-content:flex-end;margin-top:9px}.forgot-row button{padding:3px 0;border:0;background:transparent;color:var(--green);font-size:13px;font-weight:600;cursor:pointer;text-decoration:underline;text-underline-offset:3px}.forgot-dialog-icon{width:48px;height:48px;margin-bottom:14px;display:grid;place-items:center;border-radius:50%;background:var(--soft);color:var(--green);font-size:23px}.forgot-help{display:grid;gap:6px;margin-top:14px;padding:14px;border-left:3px solid var(--green);border-radius:7px;background:#f2f7f4}.forgot-help span,.forgot-help small{color:var(--muted);font-size:13px;line-height:1.65}
.admin-loan-card{padding:12px}.admin-loan-top{display:grid;grid-template-columns:42px 1fr auto;gap:9px;align-items:start}.admin-loan-top .device-art{width:42px;height:50px;font-size:19px}.borrower-row{display:flex;align-items:center;gap:9px;margin:10px 0 4px;padding:9px;background:#f4f7f5;border-radius:7px}.borrower-avatar{width:34px;height:34px;flex:0 0 34px;border-radius:50%;display:grid;place-items:center;overflow:hidden;background:var(--green);color:#fff;font-weight:700}.borrower-avatar img{width:100%;height:100%;display:block;object-fit:cover}.borrower-row div{display:grid;flex:1}.borrower-row small,.borrower-row span{font-size:13px;color:var(--muted)}.borrower-row b{font-size:14px}.admin-loan-card footer,.maintenance-card footer{display:flex;justify-content:space-between;gap:8px;padding-top:8px;border-top:1px solid #edf0ee;font-size:13px}.maintenance-card.remark{border-left-color:var(--orange)}.issue-note{margin:9px 0;padding:9px;background:#fff8eb;border-radius:6px}.issue-note small{color:var(--muted);font-size:13px}.issue-note p{margin:2px 0 0;font-size:13px;white-space:pre-wrap}

/* Responsive tablet layout */
@media (min-width:600px) and (max-width:899px){
  .auth-screen,.app{max-width:760px}
  .auth-content{max-width:520px}
  .bottom-nav{width:min(100%,760px)}
  main{padding:24px;max-width:720px}
  .stats{grid-template-columns:repeat(4,1fr)}
  #eqList,#adminEquipmentList,#adminLoanList,#maintenanceList{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px}
  #eqList>.card,#adminEquipmentList>.card,#adminLoanList>.card,#maintenanceList>.card{margin:0}
  .cart-bar{left:24px;right:24px;max-width:712px}
}

/* Responsive desktop layout */
@media (min-width:900px){
  html,body{height:100%;background:#edf2f5;overflow:hidden}
  .auth-screen{position:relative;width:100%;height:100dvh;max-width:none;display:grid;grid-template-columns:minmax(380px,46%) minmax(500px,54%);grid-template-rows:1fr;overflow:hidden;background:#f5f7f5;box-shadow:none}
  .auth-top{position:relative;display:flex;flex-direction:column;justify-content:center;align-items:flex-start;min-height:100%;padding:90px clamp(52px,6vw,112px);overflow:hidden;background:linear-gradient(150deg,#075b43 0%,#087353 62%,#04513c 100%);border-right:6px solid #d5b35a}
  .auth-top::before{content:'KU';position:absolute;right:-36px;bottom:-105px;color:rgba(255,255,255,.055);font-family:inherit;font-size:330px;font-weight:700;line-height:1}
  .auth-top::after{content:var(--language-campus);position:absolute;top:56px;left:clamp(52px,6vw,112px);padding-bottom:16px;border-bottom:1px solid rgba(255,255,255,.28);color:#fff;font-size:15px;font-weight:600;letter-spacing:.02em}
  .auth-top p,.auth-top strong{position:relative;z-index:1}.auth-top p{max-width:420px;margin:0 0 16px;color:#e8d79e;font-size:17px;font-weight:600}.auth-top strong{display:block;max-width:520px;font-size:clamp(34px,3.25vw,54px);line-height:1.25;letter-spacing:-.04em}.auth-top strong::before{content:'';display:block;width:54px;height:4px;margin-bottom:24px;border-radius:10px;background:#d5b35a}.auth-top strong::after{content:var(--language-description);display:block;max-width:430px;margin-top:24px;color:rgba(255,255,255,.78);font-size:15px;font-weight:400;line-height:1.9;letter-spacing:0}
  .auth-content{position:relative;align-self:stretch;width:100%;height:100dvh;max-height:none;margin:0;padding:40px clamp(42px,5vw,88px) 52px;display:flex;flex-direction:column;align-items:center;justify-content:center;overflow-x:hidden;overflow-y:auto;scrollbar-gutter:stable;background:linear-gradient(135deg,#f8faf8 0%,#f1f5f2 100%)}
  .auth-content>*{width:min(100%,560px);flex:0 0 auto}
  .auth-content::before{content:'INFORMATION TECHNOLOGY';display:block;margin:0 0 12px;color:#6c7c74;font-size:13px;font-weight:700;letter-spacing:.2em}
  .auth-logo{width:92px;height:92px;padding:7px;border:1px solid #e4e8e5;box-shadow:0 12px 30px rgba(31,61,48,.12)}
  .auth-content h1{margin:12px 0 22px;font-size:34px;letter-spacing:-.04em}
  .auth-card{position:relative;padding:30px 32px 32px;border:1px solid #dce4df;border-top:4px solid #087353;border-radius:12px;box-shadow:0 18px 48px rgba(17,70,51,.1)}
  .auth-card h2{font-size:23px;letter-spacing:-.025em}.auth-card label{margin-top:18px;font-size:15px}.auth-card input{min-height:52px;border-radius:9px;padding:13px 15px;background:#fbfcfb}.auth-card .button{min-height:52px;border-radius:9px;font-size:16px}.auth-link{margin-top:20px;padding:8px 12px;color:var(--green);font-size:14px;text-underline-offset:4px}
  #signupView .auth-content{padding:24px clamp(42px,5vw,88px) 34px;justify-content:flex-start}#signupView .auth-logo{width:64px;height:64px}#signupView .auth-content h1{font-size:27px;margin:5px 0 12px}#signupView .auth-card{padding:22px 28px 25px}#signupView .auth-card label{margin-top:9px}#signupView .auth-card input{min-height:44px}#signupView .auth-card .button{min-height:46px}
  .app{width:100%;height:100dvh;max-width:1440px;display:grid;grid-template-columns:220px minmax(0,1fr);grid-template-rows:64px minmax(0,1fr);padding-bottom:0;overflow:hidden;box-shadow:0 0 35px #13251d18}
  .app-header{grid-column:1/-1;grid-row:1;min-height:64px;padding:10px 24px;z-index:20}
  .app-header img{width:34px;height:34px;border-radius:50%;object-fit:cover}
  .app-header strong{font-size:15px;text-align:left}
  main{grid-column:2;grid-row:2;width:100%;height:100%;max-width:1120px;padding:32px 36px 48px;overflow-x:hidden;overflow-y:auto;overscroll-behavior:contain;scrollbar-gutter:stable}
  .page-title{font-size:30px}.subtitle{font-size:15px;margin-top:5px;margin-bottom:20px}.section-title{font-size:16px}
  .bottom-nav{grid-column:1;grid-row:2;position:relative;left:auto;bottom:auto;top:auto;transform:none;width:100%;height:100%;min-height:0;display:flex;flex-direction:column;gap:6px;padding:22px 12px;background:#fff;border-top:0;border-right:1px solid var(--line);overflow-y:auto;overscroll-behavior:contain;backdrop-filter:none}
  .bottom-nav a{min-height:50px;display:flex;justify-content:flex-start;gap:13px;padding:0 16px;border-radius:8px;font-size:15px;text-align:left}
  .bottom-nav a b{display:grid;place-items:center;width:24px;font-size:20px;line-height:20px}
  .bottom-nav a.active{background:var(--soft)}.bottom-nav a:hover{background:#f1f5f3;color:var(--green)}
  .stats{grid-template-columns:repeat(4,minmax(0,1fr));gap:14px}
  .stat{padding:18px}.stat strong{font-size:30px}.stat span{font-size:14px}
  .card{padding:16px;margin:12px 0;border-radius:10px}
  #eqList,#adminEquipmentList,#adminLoanList,#maintenanceList{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:14px}
  #eqList>.card,#adminEquipmentList>.card,#adminLoanList>.card,#maintenanceList>.card{margin:0}
  .profile,#cartForm,#addForm{max-width:680px;margin-left:auto;margin-right:auto}
  .info-card{padding:18px}.admin-stock{margin-top:18px;padding:20px}
  .cart-bar{left:calc((100vw - min(100vw,1440px))/2 + 244px);right:calc((100vw - min(100vw,1440px))/2 + 24px);max-width:none;bottom:20px}
  .modal-sheet{position:relative;left:auto;bottom:auto;transform:none;width:min(560px,calc(100vw - 40px));border-radius:15px;margin:auto}
  dialog{position:fixed;inset:0;margin:auto}
}

@media (min-width:1300px){
  #eqList,#adminEquipmentList,#adminLoanList,#maintenanceList{grid-template-columns:repeat(3,minmax(0,1fr))}
}

/* Management and visual refinement */
:root{--shadow:0 4px 16px rgba(24,54,42,.08)}
main{line-height:1.55}.page-title{letter-spacing:-.025em}.subtitle{line-height:1.65}.card{transition:transform .18s ease,box-shadow .18s ease,border-color .18s ease}.card:hover{transform:translateY(-2px);box-shadow:0 10px 26px rgba(24,54,42,.12)}
.device-art{width:68px;height:72px;border-radius:10px;overflow:hidden}.equipment-card{grid-template-columns:68px 1fr}.admin-equipment-card{grid-template-columns:68px minmax(0,1fr) 82px;min-height:130px}.admin-equipment-card .device-art{width:68px;height:76px}.admin-equipment-card h3,.equipment-card h3{font-size:16px;margin-top:4px}.admin-card-tools{width:82px}.icon-delete,.icon-image,.icon-edit{width:82px;min-height:34px;border:0;border-radius:7px;display:flex;align-items:center;justify-content:center;gap:5px;font-size:13px;font-weight:700;cursor:pointer}.icon-edit{background:#edf1ff;color:#3c579c}.icon-edit:hover{background:#dfe6ff}
.overdue-alert{display:flex;align-items:center;justify-content:space-between;gap:14px;margin-bottom:20px;padding:15px 17px;border-radius:10px;background:#fff1ef;border:1px solid #f5c2bd;color:#a72c27;text-decoration:none;box-shadow:0 5px 16px rgba(170,45,39,.08)}.overdue-alert span{font-size:13px}.overdue-card{border-left-color:var(--red)!important;background:linear-gradient(135deg,#fff 75%,#fff1ef)}.badge.overdue{background:#ffe4e1;color:#b42924}.red-text{color:var(--red)}
.count-pill{background:var(--soft);color:var(--green);font-weight:700;border-radius:999px;padding:8px 13px;font-size:14px;white-space:nowrap}.account-grid{display:grid;gap:12px}.account-card{display:grid;grid-template-columns:52px minmax(0,1fr);gap:12px;align-items:center}.account-card.inactive{opacity:.68;filter:saturate(.6)}.account-avatar{width:52px;height:52px;border-radius:50%;display:grid;place-items:center;overflow:hidden;background:var(--soft);color:var(--green);font-size:21px;font-weight:700}.account-avatar img{width:100%;height:100%;object-fit:cover}.account-card h3{margin:4px 0 0}.account-stats{font-size:13px;margin:7px 0 0}.account-actions{grid-column:1/-1;display:grid;grid-template-columns:repeat(3,1fr);gap:7px;padding-top:10px;border-top:1px solid var(--line)}.account-actions .button{width:100%;padding-left:5px;padding-right:5px}.back-link{border:0;background:transparent;color:var(--green);font:inherit;font-size:14px;font-weight:700;padding:0 0 8px;cursor:pointer}.toggle-row{display:flex;align-items:center;gap:10px;margin:14px 0;padding:12px;background:#f4f7f5;border-radius:8px}.toggle-row input{width:19px;height:19px}select{width:100%;min-height:44px;border:1px solid var(--line);border-radius:6px;background:#fff;padding:9px 11px;font:inherit}
.bottom-nav{grid-template-columns:repeat(6,1fr)}
@media(max-width:599px){main{padding:18px 16px 104px}.page-title{font-size:25px}.card{padding:14px}.admin-equipment-card{grid-template-columns:62px minmax(0,1fr);align-items:start}.admin-equipment-card .device-art{width:62px;height:70px}.admin-card-tools{grid-column:1/-1;width:100%;grid-template-columns:repeat(3,1fr)}.icon-delete,.icon-image,.icon-edit{width:100%;min-height:38px}.bottom-nav a{font-size:13px}.account-card{grid-template-columns:46px minmax(0,1fr)}.account-avatar{width:46px;height:46px}.account-card>.button{grid-column:1/-1;width:100%}.overdue-alert{align-items:flex-start;flex-direction:column}}
@media(min-width:600px){.account-grid{grid-template-columns:repeat(2,minmax(0,1fr))}}
@media(min-width:1200px){.account-grid{grid-template-columns:repeat(3,minmax(0,1fr))}main{max-width:1240px}.device-art{width:76px;height:82px}.equipment-card{grid-template-columns:76px 1fr}}
.cart-list .card {
  grid-template-columns: 76px minmax(0, 1fr) auto;
  column-gap: 16px;
  min-height: 112px;
}

.cart-list .card .device-art {
  width: 76px;
  height: 82px;
}

.cart-list .card > div:nth-child(2) {
  min-width: 0;
}

.cart-list .card h3 {
  overflow-wrap: anywhere;
  line-height: 1.35;
}

.cart-list .counter {
  flex-shrink: 0;
  align-self: center;
}

.loan-page-head{align-items:flex-start}.export-button{white-space:nowrap}.export-range{display:grid;grid-template-columns:1fr 1fr;gap:12px}.export-note{margin:12px 0 16px;padding:12px;border-radius:8px;background:var(--soft);color:var(--muted);font-size:13px;line-height:1.7}
@media(max-width:599px){.loan-page-head{align-items:stretch;flex-direction:column}.export-button{width:100%}.export-range{grid-template-columns:1fr}}

@media (max-width: 599px) {
  .cart-list .card {
    grid-template-columns: 62px minmax(0, 1fr);
    gap: 10px;
  }

  .cart-list .card .device-art {
    width: 62px;
    height: 70px;
  }

  .cart-list .counter {
    grid-column: 1 / -1;
    width: 100%;
    justify-content: space-between;
  }
}

/* Polished institutional sidebar */
@media(min-width:900px){
  .app-header{padding-inline:25px;background:#fff;border-bottom:1px solid #dfe6e2;box-shadow:0 1px 0 rgba(14,75,54,.03)}
  .app-header::after{content:var(--language-department);margin-left:auto;color:#7c8983;font-size:13px;font-weight:500}
  .app-header img{width:38px;height:38px;padding:2px;border:1px solid #d9e2dd;background:#fff}
  .app-header strong{font-size:16px;color:#123c2f;letter-spacing:-.01em}
  .bottom-nav{gap:5px;padding:25px 16px 18px;background:linear-gradient(180deg,#fff 0%,#fbfdfc 100%);border-right:1px solid #dce5e0}
  .bottom-nav::before{content:var(--language-menu);display:block;margin:0 12px 12px;color:#8b9791;font-size:13px;font-weight:700;letter-spacing:.08em}
  .bottom-nav a{position:relative;min-height:52px;gap:13px;padding:0 14px;border:1px solid transparent;border-radius:10px;color:#64736c;font-size:15px;font-weight:500;transition:background .16s ease,color .16s ease,border-color .16s ease,transform .16s ease}
  .bottom-nav a b{width:25px;height:25px}.bottom-nav a b svg{width:21px;height:21px;stroke-width:1.75}
  .bottom-nav a:hover{background:#f1f7f4;border-color:#e1ebe6;color:#086849;transform:translateX(2px)}
  .bottom-nav a.active{background:#e7f3ed;border-color:#d2e7dd;color:#076849;font-weight:700;box-shadow:inset 3px 0 #087353}
  .bottom-nav a.active b{color:#087353}
  .bottom-nav a[data-p="profile"]{margin-top:auto;border-top:1px solid #e4ebe7;border-radius:0;padding-top:12px;min-height:64px}
  .bottom-nav a[data-p="profile"]:hover,.bottom-nav a[data-p="profile"].active{border-radius:10px;border-top-color:transparent}
  .bottom-nav a:focus-visible{outline:3px solid rgba(8,115,83,.2);outline-offset:2px}
}

/* Unified typography */
.app,.auth-screen,.modal-sheet,.toast,.bottom-nav,.button,.chip,.badge,input,select,textarea,h1,h2,h3,h4,p,span,strong,small,label,a{font-family:'Sarabun','Noto Sans Thai',Tahoma,system-ui,sans-serif}.page-title,.auth-content h1{font-weight:700;line-height:1.22}.section-title,.card h3,.auth-card h2{font-weight:600;line-height:1.35}.subtitle,.meta{font-weight:400;line-height:1.65}.button,.bottom-nav a{font-weight:600;letter-spacing:0}.code{font-family:'Sarabun','Noto Sans Thai',Tahoma,system-ui,sans-serif;font-variant-numeric:tabular-nums;letter-spacing:.02em}input::placeholder,textarea::placeholder{font-family:inherit;color:#89958f;opacity:1}

/* User preferences and themes */
.settings-button{display:grid;grid-template-columns:32px 1fr auto;align-items:center;gap:10px;text-align:left}.settings-button>span:first-child{width:32px;height:32px;display:grid;place-items:center;border-radius:50%;background:var(--soft);font-size:17px}.settings-button>span:nth-child(2){display:grid}.settings-button small{margin-top:2px;color:var(--muted);font-size:13px;font-weight:400}.settings-button>span:last-child{font-size:22px}.settings-heading{display:flex;align-items:flex-start;gap:12px}.settings-heading h2{margin:0}.settings-icon{width:42px;height:42px;flex:0 0 auto;display:grid;place-items:center;border-radius:10px;background:var(--soft);color:var(--green);font-size:21px}.settings-group{margin:16px 0 0;padding:0;border:0}.settings-group legend{width:100%;padding:0 0 9px;border-bottom:1px solid var(--line);font-size:14px;font-weight:700;color:var(--ink)}.theme-options{display:grid;grid-template-columns:repeat(3,1fr);gap:9px;margin-top:11px}.theme-option{position:relative;display:grid;gap:6px;margin:0;text-align:center;cursor:pointer}.theme-option input{position:absolute;width:1px!important;height:1px!important;min-height:0!important;opacity:0}.theme-option b{font-size:13px}.theme-preview{height:64px;display:block;overflow:hidden;border:2px solid var(--line);border-radius:8px;background:#f6f8f7;box-shadow:inset 20px 0 #fff}.theme-preview::before,.theme-preview::after,.theme-preview i{content:'';display:block;height:5px;margin:9px 8px 0 28px;border-radius:5px;background:#dbe4df}.theme-preview::after{width:35%;background:#087353}.dark-preview{background:#18231f;box-shadow:inset 20px 0 #101915}.dark-preview::before,.dark-preview i{background:#34453e}.system-preview{background:linear-gradient(90deg,#f6f8f7 50%,#18231f 50%);box-shadow:inset 10px 0 #fff,inset -10px 0 #101915}.theme-option input:checked+.theme-preview{border-color:#087353;box-shadow:0 0 0 3px rgba(8,115,83,.13),inset 20px 0 #fff}.theme-option input:checked+.dark-preview{box-shadow:0 0 0 3px rgba(8,115,83,.13),inset 20px 0 #101915}.theme-option input:checked+.system-preview{box-shadow:0 0 0 3px rgba(8,115,83,.13),inset 10px 0 #fff,inset -10px 0 #101915}.setting-switch{display:flex;align-items:center;justify-content:space-between;gap:15px;margin:0;padding:13px 2px;border-bottom:1px solid var(--line);cursor:pointer}.setting-switch span{display:grid;gap:3px}.setting-switch b{font-size:14px}.setting-switch small{color:var(--muted);font-size:13px;font-weight:400}.setting-switch input{width:42px!important;height:23px!important;min-height:23px!important;flex:0 0 auto;appearance:none;border:0;border-radius:20px;background:#c8d1cc;padding:0;cursor:pointer;transition:.18s}.setting-switch input::after{content:'';display:block;width:17px;height:17px;margin:3px;border-radius:50%;background:#fff;box-shadow:0 1px 4px #0003;transition:.18s}.setting-switch input:checked{background:var(--green)}.setting-switch input:checked::after{transform:translateX(19px)}
.settings-language{margin:16px 0 4px}.settings-language select{font-weight:600}
html[data-reduce-motion="true"] *,html[data-reduce-motion="true"] *::before,html[data-reduce-motion="true"] *::after{scroll-behavior:auto!important;animation:none!important;transition:none!important}
html[data-theme="dark"]{--ink:#e8efeb;--muted:#9caaa3;--line:#34443d;--canvas:#101915;--cream:#101915;--soft:#183b2e;--navy:#09110e;color-scheme:dark}
html[data-theme="dark"] body{background:#09110e;color:var(--ink)}html[data-theme="dark"] .app,html[data-theme="dark"] main{background:var(--canvas)}html[data-theme="dark"] .app-header,html[data-theme="dark"] .bottom-nav,html[data-theme="dark"] .card,html[data-theme="dark"] .info-card,html[data-theme="dark"] .auth-card,html[data-theme="dark"] .modal-sheet{background:#17231e;color:var(--ink);border-color:var(--line)}html[data-theme="dark"] .app-header strong,html[data-theme="dark"] .page-title,html[data-theme="dark"] .auth-content h1{color:#75c9a7}html[data-theme="dark"] .bottom-nav{background:linear-gradient(180deg,#131e19,#101915)}html[data-theme="dark"] .bottom-nav a:hover{background:#1c2e26;border-color:#2e493d}html[data-theme="dark"] .bottom-nav a.active{background:#183b2e;border-color:#285643;color:#79d1ae}html[data-theme="dark"] input,html[data-theme="dark"] select,html[data-theme="dark"] textarea{background:#111b17;color:var(--ink);border-color:#3b4c44}html[data-theme="dark"] .auth-content{background:linear-gradient(135deg,#101915,#13201a)}html[data-theme="dark"] .stat,html[data-theme="dark"] .borrower-row,html[data-theme="dark"] .forgot-help,html[data-theme="dark"] .export-note{background:#192720;border-color:var(--line)}html[data-theme="dark"] .device-art{background:linear-gradient(145deg,#17261f,#1c2c25)}html[data-theme="dark"] .settings-button>span:first-child,html[data-theme="dark"] .settings-icon{background:#1c4233}html[data-theme="dark"] dialog::backdrop{background:#020604b8}html[data-theme="dark"] .button.secondary{background:#17231e;color:#8bd5b8;border-color:#3a4c44}html[data-theme="dark"] .button.danger{background:#3b201f;border-color:#75403d}
@media(max-width:420px){.theme-options{grid-template-columns:1fr}.theme-option{grid-template-columns:80px 1fr;align-items:center;text-align:left}.theme-preview{height:45px}}

/* Professional application design system */
:root{--surface:#fff;--surface-subtle:#f3f6f4;--surface-raised:#fff;--sidebar:#fff;--header:#fff;--primary:#086b4f;--primary-hover:#05553e;--primary-soft:#e8f2ed;--accent:#b99a4a;--text:#17231e;--text-secondary:#697871;--border:#dce4df;--focus:rgba(8,107,79,.18);--shadow-sm:0 1px 2px rgba(15,45,34,.05);--shadow-md:0 8px 24px rgba(15,45,34,.07)}
body{background:#e9efec;color:var(--text)}
.app{background:var(--surface-subtle)}
.app-header{background:var(--header)}
main{background:var(--surface-subtle)}
.page-title{color:var(--primary);font-size:28px;letter-spacing:-.025em}.subtitle{max-width:720px;margin-top:6px;color:var(--text-secondary);font-size:15px}.section-title{margin-top:28px;color:var(--text);font-size:15px}
.card{border:1px solid var(--border);border-left:1px solid var(--border);border-radius:10px;background:var(--surface);box-shadow:var(--shadow-sm);transition:border-color .15s ease,box-shadow .15s ease}.card:hover{transform:none;border-color:#c8d7cf;box-shadow:var(--shadow-md)}
.button{border-radius:8px;transition:background .15s ease,border-color .15s ease,box-shadow .15s ease}.button.primary{background:var(--primary)}.button.primary:hover{background:var(--primary-hover);box-shadow:0 4px 12px rgba(8,107,79,.18)}.button.secondary{background:var(--surface);border-color:var(--border);color:var(--primary)}
input,select,textarea{border-color:var(--border);border-radius:8px;background:var(--surface);color:var(--text)}input:focus,select:focus,textarea:focus{border-color:var(--primary);box-shadow:0 0 0 3px var(--focus)}
.search{margin:18px 0 13px}.search input{min-height:48px;background:var(--surface);box-shadow:var(--shadow-sm)}.filter-row{gap:8px}.chip{padding:8px 14px;border:1px solid transparent;background:#edf1ef;color:var(--text-secondary);font-size:13px;font-weight:600;cursor:pointer}.chip.active{border-color:var(--primary);background:var(--primary);color:#fff}
.stat{min-height:104px;padding:18px;border:1px solid var(--border);border-left:1px solid var(--border);border-radius:10px;background:var(--surface);box-shadow:var(--shadow-sm)}.stat::before{content:'';display:block;width:30px;height:3px;margin-bottom:13px;border-radius:5px;background:#82958c}.stat.green::before{background:var(--primary)}.stat.orange::before{background:var(--orange)}.stat.red::before{background:var(--red)}.stat strong{color:var(--text);font-size:30px;font-variant-numeric:tabular-nums}.stat span{margin-top:4px;color:var(--text-secondary);font-size:13px}
.badge{padding:4px 9px;border-radius:6px;font-size:13px;letter-spacing:.01em}.badge.pending_return{color:#806016;background:#fff0d9}.device-art{border-color:var(--border);background:var(--surface-subtle)}
.admin-stock{border:1px solid #25483b;border-radius:10px;background:#153d30}.info-card{border:1px solid var(--border);border-left:3px solid var(--primary);border-radius:10px;background:var(--surface);box-shadow:var(--shadow-sm)}
.modal-sheet{border:1px solid var(--border);background:var(--surface);box-shadow:0 24px 70px rgba(4,25,17,.2)}dialog::backdrop{background:rgba(10,25,19,.58);backdrop-filter:blur(2px)}
.toast{border-radius:8px;box-shadow:0 10px 30px rgba(7,24,17,.24)}
dialog.notification-dialog{position:fixed;inset:0;margin:auto;width:min(420px,calc(100vw - 32px));max-height:calc(100dvh - 40px);box-sizing:border-box;overflow:auto;padding:28px;border:1px solid var(--border);border-radius:20px;background:var(--surface,#fff);color:var(--text,#173c2d);box-shadow:0 24px 80px #04191140;font-family:'Sarabun',Tahoma,sans-serif;text-align:center}
.notification-icon{display:grid;place-items:center;width:56px;height:56px;margin:0 auto 16px;border-radius:50%;background:var(--soft,#eaf5ee);color:var(--green,#14734e);font-size:28px;font-weight:700}
.notification-dialog[data-error="true"] .notification-icon{background:#fce8e8;color:#b63131}
.notification-dialog h2{margin:0 0 10px;font-size:22px;line-height:1.5}
.notification-dialog p{margin:0;color:var(--text-secondary,#61736a);line-height:1.7;white-space:pre-wrap;overflow-wrap:anywhere}
.notification-actions{display:flex;justify-content:center;gap:12px;margin-top:24px}
.notification-actions .button{flex:1;min-height:46px}
.notification-actions [hidden]{display:none}
.notification-actions .button:focus-visible{outline:3px solid var(--green,#14734e);outline-offset:3px}
.return-history-note{grid-column:1/-1;display:grid;gap:14px;margin-top:14px;padding-top:16px;border-top:1px solid var(--border);font-size:14px;line-height:1.6;color:var(--text-secondary)}
.loan-card>.return-summary{grid-column:1/-1;min-width:0;margin:8px 0 0;overflow-wrap:anywhere}.loan-card>.return-summary p{margin:4px 0 0;font-weight:400}
.return-reference{display:flex;flex-wrap:wrap;align-items:center;justify-content:space-between;gap:8px}.return-reference strong{color:var(--text);font-size:14px;font-variant-numeric:tabular-nums}
.return-stats{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px}.return-stat{padding:12px 16px;border:1px solid var(--border);border-radius:10px;background:var(--surface-subtle)}.return-stat>span{display:block;font-size:13px}.return-stat>div{display:flex;align-items:baseline;gap:8px;margin-top:4px}.return-stat strong{font-size:26px;font-weight:700;line-height:1.3;color:var(--text);font-variant-numeric:tabular-nums}.return-stat.outstanding{background:var(--primary-soft);border-color:var(--primary-soft)}.return-stat.outstanding strong{color:var(--primary)}
.return-history-note .return-record-button{width:100%;min-height:44px;display:flex;align-items:center;justify-content:center;gap:12px;margin:0}.return-record-button>span{font-size:20px;line-height:1}
.return-receipt{display:grid;gap:8px}.return-receipt>strong{color:var(--text)}.return-receipt>div{display:flex;flex-wrap:wrap;justify-content:space-between;gap:4px 16px}.return-receipt b{color:var(--text);overflow-wrap:anywhere}
.audit-readable{padding:22px!important;margin-bottom:16px}.audit-event-header{align-items:center;gap:10px 20px!important}.audit-event-kind{padding:5px 10px;background:var(--primary-soft);color:var(--primary);font-size:13px;font-weight:600;border-radius:7px}.audit-readable .audit-event-header time{font-size:14px;line-height:1.6}.audit-subject{margin:16px 0 3px;font-size:22px;line-height:1.5;color:var(--text);overflow-wrap:anywhere}.audit-reference{margin:0 0 16px;font-size:13px;color:var(--text-secondary)}
.audit-people{display:flex;flex-wrap:wrap;gap:14px 40px;padding:14px 16px;border-radius:10px;background:var(--surface-subtle)}.audit-people>div{display:grid;gap:4px}.audit-people span{font-size:13px;color:var(--text-secondary)}.audit-people strong{font-size:16px;color:var(--text);overflow-wrap:anywhere}.audit-description{margin:16px 0 0;color:var(--text);font-size:15px;line-height:1.7}.audit-description p{margin:3px 0}.audit-change-list{display:grid;grid-template-columns:repeat(auto-fit,minmax(220px,1fr));gap:10px;margin-top:16px}.audit-change{padding:12px 14px;border:1px solid var(--border);border-radius:10px}.audit-change>span{font-size:13px;color:var(--text-secondary)}.audit-change>div{display:flex;flex-wrap:wrap;align-items:baseline;gap:10px;margin-top:6px;font-size:17px;overflow-wrap:anywhere}.audit-before{color:var(--text-secondary)}.audit-change strong{color:var(--primary);font-weight:700}.audit-change-arrow{color:var(--text-secondary)}.audit-readable details{border-top:1px solid var(--border);margin-top:18px;padding-top:8px}.audit-readable summary{font-size:14px;padding:8px 0}.audit-readable summary:focus-visible{outline:2px solid var(--primary);outline-offset:4px;border-radius:4px}
@media(max-width:599px){.audit-readable{padding:16px!important}.audit-change-list{grid-template-columns:1fr}.audit-subject{font-size:20px}.audit-event-header{align-items:flex-start!important;flex-direction:column}.audit-people{gap:14px 24px}.audit-filters .field{min-width:100%}.audit-filters>button{width:100%}}
.return-form{display:block}.return-total-field{max-width:360px;margin-bottom:16px}.return-total-field input{font-size:22px;font-weight:700}.return-quantity-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px}.return-quantity-grid input{width:100%;box-sizing:border-box}.return-summary{padding:12px;border-radius:8px;background:var(--surface-subtle);font-weight:600}
.audit-filters{display:flex;flex-wrap:wrap;align-items:end;gap:12px;margin-bottom:20px}.audit-filters .field{flex:1;min-width:180px}.audit-card{display:block}.audit-card header{display:flex;flex-wrap:wrap;justify-content:space-between;gap:8px}.audit-card time{font-size:13px;color:var(--text-secondary)}.audit-card summary{cursor:pointer;color:var(--green);padding:8px 0}.audit-table-wrap{overflow:auto}.audit-table{border-collapse:collapse;width:100%;font-size:13px}.audit-table td,.audit-table th{padding:10px;border:1px solid var(--border);text-align:left;vertical-align:top;overflow-wrap:anywhere;min-width:100px;max-width:300px;white-space:pre-wrap}
.profile{width:min(100%,760px);margin:0 auto;padding:34px;border:1px solid var(--border);border-radius:12px;background:var(--surface);box-shadow:var(--shadow-sm)}.profile .page-title{font-size:26px}.profile-avatar{margin-top:18px;border:5px solid var(--surface);box-shadow:0 0 0 1px var(--border),0 8px 22px rgba(20,53,40,.12)}.profile-image-button{border:1px solid #d5e7de;border-radius:7px}.profile .info-card{margin:22px 0 8px}.profile>.button.wide{margin-top:12px}
.account-card,.admin-equipment-card,.admin-loan-card,.maintenance-card{padding:16px}.account-actions{border-color:var(--border)}

@media(min-width:900px){
  .app{max-width:none;grid-template-columns:248px minmax(0,1fr);grid-template-rows:72px minmax(0,1fr);box-shadow:none}
  .app-header{min-height:72px;padding:0 28px;border-bottom:1px solid var(--border);box-shadow:var(--shadow-sm)}
  .app-header img{width:40px;height:40px}.app-header strong{color:var(--text);font-size:16px}
  .bottom-nav{padding:27px 16px 18px;background:var(--sidebar);border-color:var(--border)}
  .bottom-nav::before{margin-bottom:14px;color:var(--text-secondary)}
  .bottom-nav a{min-height:50px;color:var(--text-secondary)}.bottom-nav a:hover{transform:none;background:var(--surface-subtle);border-color:var(--border);color:var(--primary)}.bottom-nav a.active{background:var(--primary-soft);border-color:#d3e6dd;color:var(--primary);box-shadow:inset 3px 0 var(--primary)}
  main{max-width:none;padding:38px clamp(30px,3vw,52px) 56px}
  .stats{gap:16px}.card{margin:14px 0}
  #eqList,#adminEquipmentList,#adminLoanList,#maintenanceList{gap:16px}
  .admin-page-head{min-height:58px;align-items:flex-start}.button.compact{min-height:38px;padding:7px 15px;font-size:13px}
}
@media(min-width:1500px){#eqList,#adminEquipmentList,#adminLoanList,#maintenanceList{grid-template-columns:repeat(3,minmax(0,1fr))}}
@media(max-width:899px){.profile{padding:22px 16px}.page-title{font-size:25px}.stat{min-height:92px;padding:14px}}

html[data-theme="dark"]{--surface:#16231d;--surface-subtle:#0f1915;--surface-raised:#1b2923;--sidebar:#121e19;--header:#16231d;--primary:#75c9a7;--primary-hover:#8bd6b7;--primary-soft:#193c2f;--text:#e8efeb;--text-secondary:#9caaa3;--border:#34443d;--focus:rgba(117,201,167,.2);--shadow-sm:0 1px 2px rgba(0,0,0,.18);--shadow-md:0 8px 24px rgba(0,0,0,.2)}
html[data-theme="dark"] body,html[data-theme="dark"] .app,html[data-theme="dark"] main{background:var(--surface-subtle);color:var(--text)}html[data-theme="dark"] .app-header,html[data-theme="dark"] .bottom-nav,html[data-theme="dark"] .card,html[data-theme="dark"] .info-card,html[data-theme="dark"] .profile,html[data-theme="dark"] .modal-sheet{background:var(--surface);border-color:var(--border);color:var(--text)}html[data-theme="dark"] .bottom-nav{background:var(--sidebar)}html[data-theme="dark"] .button.secondary,html[data-theme="dark"] input,html[data-theme="dark"] select,html[data-theme="dark"] textarea,html[data-theme="dark"] .search input,html[data-theme="dark"] .stat{background:var(--surface-raised);border-color:var(--border);color:var(--text)}html[data-theme="dark"] .device-art{background:#1a2922}html[data-theme="dark"] .chip{background:#23312b;color:var(--text-secondary)}html[data-theme="dark"] .chip.active{background:var(--primary);color:#092017}

/* Professional account profile */
.profile-page{width:min(100%,980px);margin:0 auto}.profile-page-head{display:flex;align-items:flex-end;justify-content:space-between;gap:24px;margin-bottom:22px}.profile-page-head .subtitle{margin-bottom:0}.profile-overline{margin:0 0 5px;color:var(--accent);font-size:13px;font-weight:700;letter-spacing:.14em}.profile-status{display:inline-flex;align-items:center;gap:7px;flex:0 0 auto;padding:7px 11px;border:1px solid #cfe6db;border-radius:7px;background:var(--primary-soft);color:var(--primary);font-size:13px;font-weight:600}.profile-status i{width:7px;height:7px;border-radius:50%;background:#1a9a6e;box-shadow:0 0 0 3px rgba(26,154,110,.12)}.profile-panel{overflow:hidden;border:1px solid var(--border);border-radius:12px;background:var(--surface);box-shadow:var(--shadow-sm)}.profile-identity{display:grid;grid-template-columns:104px minmax(0,1fr) auto;align-items:center;gap:22px;padding:28px}.profile-avatar-large{width:104px;height:104px;overflow:hidden;display:grid;place-items:center;border:4px solid var(--surface);border-radius:50%;background:var(--primary-soft);color:var(--primary);font-size:38px;font-weight:700;box-shadow:0 0 0 1px var(--border),0 8px 22px rgba(20,53,40,.12)}.profile-avatar-large img{width:100%;height:100%;object-fit:cover}.profile-primary h2{margin:5px 0 2px;color:var(--text);font-size:24px;line-height:1.3}.profile-primary p{margin:0;color:var(--text-secondary);font-size:14px}.profile-role{color:var(--primary);font-size:13px;font-weight:700;letter-spacing:.04em}.profile-upload .button{display:inline-flex;align-items:center;gap:8px;white-space:nowrap;cursor:pointer}.profile-upload svg{width:17px;height:17px;fill:none;stroke:currentColor;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round}.profile-divider{height:1px;margin:0 28px;background:var(--border)}.profile-details{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));padding:8px 28px 24px}.profile-detail{display:grid;gap:5px;padding:17px 18px 15px;border-bottom:1px solid var(--border)}.profile-detail:nth-child(odd){border-right:1px solid var(--border)}.profile-detail:nth-last-child(-n+2){border-bottom:0}.profile-detail small{color:var(--text-secondary);font-size:13px}.profile-detail b{overflow-wrap:anywhere;color:var(--text);font-size:15px;font-weight:600}.profile-actions{display:grid;grid-template-columns:1fr 1fr;gap:12px;margin-top:14px}.profile-action-card{min-height:76px;padding:14px 16px;display:grid;grid-template-columns:38px 1fr auto;align-items:center;gap:12px;border:1px solid var(--border);border-radius:10px;background:var(--surface);color:var(--text);text-align:left;cursor:pointer;box-shadow:var(--shadow-sm);transition:border-color .15s ease,box-shadow .15s ease}.profile-action-card:hover{border-color:#b9cec4;box-shadow:var(--shadow-md)}.profile-action-icon{width:38px;height:38px;display:grid;place-items:center;border-radius:8px;background:var(--primary-soft);color:var(--primary);font-size:18px}.profile-action-card>span:nth-child(2){display:grid;gap:3px}.profile-action-card b{font-size:14px}.profile-action-card small{color:var(--text-secondary);font-size:13px}.profile-action-arrow{color:var(--text-secondary);font-size:22px}.profile-action-card.danger{color:#a9342f}.profile-action-card.danger .profile-action-icon{background:#fff0ef;color:#c13d36}
html[data-theme="dark"] .profile-panel,html[data-theme="dark"] .profile-action-card{background:var(--surface);border-color:var(--border)}html[data-theme="dark"] .profile-avatar-large{border-color:var(--surface)}html[data-theme="dark"] .profile-status{border-color:#285642}html[data-theme="dark"] .profile-action-card.danger .profile-action-icon{background:#3b201f;color:#f18d87}
@media(max-width:700px){.profile-page-head{align-items:flex-start;flex-direction:column;gap:10px}.profile-identity{grid-template-columns:76px minmax(0,1fr);gap:15px;padding:20px}.profile-avatar-large{width:76px;height:76px;font-size:28px}.profile-primary h2{font-size:19px}.profile-upload{grid-column:1/-1}.profile-upload .button{width:100%;justify-content:center}.profile-divider{margin:0 20px}.profile-details{grid-template-columns:1fr;padding:6px 20px 18px}.profile-detail{padding:14px 2px;border-right:0!important}.profile-detail:nth-last-child(2){border-bottom:1px solid var(--border)}.profile-actions{grid-template-columns:1fr}.profile-action-card{min-height:70px}}

/* Institutional header: one confident green band with restrained detail. */
.app-header.modern-header{gap:24px;justify-content:space-between;min-height:92px;padding:15px clamp(22px,2.6vw,50px);padding-top:calc(15px + env(safe-area-inset-top));background:linear-gradient(110deg,#073f31 0%,#0c5943 35%,#147057 68%,#0b5542 100%);border-bottom:0;box-shadow:0 5px 18px #052d2117}
.app-header.modern-header::after{content:'';position:absolute;left:0;right:0;bottom:0;height:4px;background:linear-gradient(90deg,#35886e 0%,#73c5a3 28%,#a1dcc2 50%,#69ba99 73%,#2d8168 100%);pointer-events:none}
.app-header.modern-header::before{content:none}
.header-brand{display:flex;align-items:center;gap:20px;min-width:0}
.header-logo{display:grid;place-items:center;flex:0 0 58px;width:58px;height:58px;border:1px solid #ffffff80;border-radius:15px;background:#fff;box-shadow:0 8px 22px #02271d42}
.app-header.modern-header .header-logo img{width:48px;height:48px;object-fit:contain;border:0;padding:0;border-radius:50%;background:#fff}
.header-title{display:grid;gap:4px;min-width:0;padding-left:20px;border-left:1px solid #ffffff3d}
.app-header.modern-header strong{display:block;flex:initial;text-align:left;font-size:clamp(17px,1.3vw,22px);font-weight:600;color:#fff;letter-spacing:-.015em;line-height:1.45}
.header-eyebrow{color:#a9d8c5;font-size:13px;font-weight:500;letter-spacing:.16em;line-height:1.5}
.header-actions{display:flex;align-items:center;gap:24px;flex-shrink:0}
.header-department{display:grid;gap:4px;text-align:right;line-height:1.5}
.department-name{color:#f2faf6;font-size:14px;font-weight:500}
.department-caption{color:#a9d8c5;font-size:13px;letter-spacing:.14em;font-weight:500}
.modern-header .install{padding:9px 14px;border:1px solid #ffffff73;border-radius:8px;background:#ffffff14;color:#fff;font-weight:600;cursor:pointer}
.modern-header .install:hover{background:#ffffff26}.modern-header .install:focus-visible{outline:3px solid #8bddbc;outline-offset:3px}
html[data-theme="dark"] .app-header.modern-header{background:linear-gradient(110deg,#032c22 0%,#084534 35%,#105a44 68%,#073f30 100%)}
html[data-theme="dark"] .app-header.modern-header strong{color:#fff}
html[data-theme="dark"] .header-title{border-color:#ffffff3d}
html[data-theme="dark"] .header-logo{border-color:#ffffff80;background:#fff;box-shadow:0 8px 22px #0005}
html[data-theme="dark"] .header-eyebrow,html[data-theme="dark"] .department-caption{color:#addac8}
html[data-theme="dark"] .department-name{color:#f2faf6}
html[data-theme="dark"] .modern-header .install{background:#ffffff14;color:#fff;border-color:#ffffff73}
@media(max-width:899px){.app-header.modern-header{min-height:82px;padding:12px 20px;padding-top:calc(12px + env(safe-area-inset-top));gap:16px}.header-brand{gap:14px}.header-logo{width:50px;height:50px;flex-basis:50px;border-radius:13px}.app-header.modern-header .header-logo img{width:42px;height:42px}.header-title{padding-left:14px}.app-header.modern-header strong{font-size:17px}.department-name{font-size:13px}.department-caption{font-size:13px}}
@media(max-width:599px){.app-header.modern-header{min-height:78px;padding:12px 16px;padding-top:calc(12px + env(safe-area-inset-top));gap:10px}.app-header.modern-header::after{height:3px}.header-brand{gap:10px}.header-logo{width:43px;height:43px;flex-basis:43px;border-radius:11px}.app-header.modern-header .header-logo img{width:37px;height:37px}.header-title{padding-left:10px;gap:3px}.app-header.modern-header strong{font-size:15px}.header-eyebrow{font-size:13px;letter-spacing:.1em}.header-department{display:none}.header-actions{gap:6px}.modern-header .install{padding:7px 8px;font-size:13px}}
@media(max-width:359px){.app-header.modern-header{padding-inline:12px}.header-logo{width:36px;height:38px;flex-basis:36px}.app-header.modern-header .header-logo img{width:32px;height:32px}.app-header.modern-header strong{font-size:15px}.header-eyebrow{font-size:13px}}

/* Sidebar navigation: shared icons, clear selection, and quiet interaction. */
.bottom-nav.modern-nav{grid-template-columns:repeat(var(--nav-count,5),minmax(0,1fr))}
.modern-nav .nav-copy{min-width:0}.modern-nav .nav-label{display:block}
.modern-nav .nav-copy small,.modern-nav .nav-arrow{display:none}
.bottom-nav.modern-nav a:focus-visible{outline:3px solid #50bca0;outline-offset:2px}
@media(min-width:900px){
  .bottom-nav.modern-nav{padding:26px 14px 18px;gap:10px;background:radial-gradient(ellipse at 0 0,#dbf3e980,transparent 55%),linear-gradient(180deg,#fff,#f6faf8);border-right-color:#dce9e2}
  .bottom-nav.modern-nav::before{margin:20px 12px 9px;padding:0 0 15px;border-bottom:1px solid #dce9e2;color:#648477;font-size:13px;letter-spacing:.04em}
  .bottom-nav.modern-nav a{isolation:isolate;flex-shrink:0;min-height:72px;gap:12px;padding:12px;border:1px solid transparent;border-radius:16px;color:#526e63;transition:background .2s ease,box-shadow .2s ease,transform .2s ease,border-color .2s ease}
  .bottom-nav.modern-nav a b{flex:0 0 40px;width:40px;height:40px;border:1px solid #dfebe5;border-radius:12px;background:#fff;color:#49816d;box-shadow:0 3px 7px #174b3710;transition:transform .2s ease,background .2s ease,color .2s ease}
  .bottom-nav.modern-nav a b svg{width:21px;height:21px;stroke-width:1.8}
  .modern-nav .nav-copy{flex:1;display:grid;gap:3px}.modern-nav .nav-label{font-size:15px;line-height:1.4;font-weight:600}
  .modern-nav .nav-copy small{display:block;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;color:#809389;font-size:13px;font-weight:400;line-height:1.6}
  .modern-nav .nav-arrow{display:block;flex:0 0 8px;font-size:23px;line-height:1;opacity:0;transform:translateX(-4px);transition:opacity .2s ease,transform .2s ease}
  .bottom-nav.modern-nav a:hover{background:#ffffffd9;border-color:#d6e9df;transform:translateX(3px);box-shadow:0 5px 16px #164b3810;color:#08684c}
  .bottom-nav.modern-nav a:hover b{transform:translateY(-2px) rotate(-4deg)}
  .bottom-nav.modern-nav a:hover .nav-arrow,.bottom-nav.modern-nav a.active .nav-arrow{opacity:1;transform:translateX(0)}
  .bottom-nav.modern-nav a.active{background:linear-gradient(115deg,#087557,#105c4a);border-color:#0c6c51;color:#fff;box-shadow:0 7px 18px #0b6e5130,inset 0 1px 0 #ffffff25}
  .bottom-nav.modern-nav a.active b{background:#ffffff20;border-color:#ffffff35;color:#fff;box-shadow:none}
  .bottom-nav.modern-nav a.active .nav-copy small{color:#d1eee2}
  .bottom-nav.modern-nav a:active{transform:scale(.98);box-shadow:none}
  .bottom-nav.modern-nav a[data-p="profile"]{margin-top:auto;border:1px solid #dce9e2;border-radius:16px;background:#ffffffa6;padding:12px;min-height:72px}
  .bottom-nav.modern-nav a[data-p="profile"].active{background:linear-gradient(115deg,#087557,#105c4a);border-color:#0c6c51}
  html[data-theme="dark"] .bottom-nav.modern-nav{background:radial-gradient(ellipse at 0 0,#214a383d,transparent 60%),#111d18;border-color:#2b4337}
  html[data-theme="dark"] .bottom-nav.modern-nav::before{border-color:#2b4337;color:#9eb9ac}
  html[data-theme="dark"] .bottom-nav.modern-nav a{color:#bfd1c7}
  html[data-theme="dark"] .bottom-nav.modern-nav a b{background:#20382d;border-color:#345343;color:#9cd6bc}
  html[data-theme="dark"] .bottom-nav.modern-nav a:hover,html[data-theme="dark"] .bottom-nav.modern-nav a[data-p="profile"]{background:#20382d;border-color:#345343}
  html[data-theme="dark"] .bottom-nav.modern-nav a.active{background:linear-gradient(115deg,#176c50,#20513f);border-color:#428467;color:#fff}
  html[data-theme="dark"] .modern-nav .nav-copy small{color:#9eb9ac}
  html[data-theme="dark"] .modern-nav a.active .nav-copy small{color:#d1eee2}
}
@media(max-width:899px){
  .bottom-nav.modern-nav a{gap:3px;border-radius:12px;padding:5px 2px;min-width:0}
  .bottom-nav.modern-nav a b{padding:5px 13px;border-radius:10px;transition:background .2s ease,transform .2s ease}
  .bottom-nav.modern-nav a.active b{background:var(--primary-soft);color:var(--primary)}
  .bottom-nav.modern-nav a:active b{transform:scale(.92)}
}
@media(prefers-reduced-motion:reduce){.bottom-nav.modern-nav a,.bottom-nav.modern-nav a b,.modern-nav .nav-arrow{transition:none!important;transform:none!important}}
html[data-reduce-motion="true"] .bottom-nav.modern-nav a,html[data-reduce-motion="true"] .bottom-nav.modern-nav a b,html[data-reduce-motion="true"] .modern-nav .nav-arrow{transform:none!important}

/* Fluid responsive layout: fill the browser and adapt cards to available space. */
.app{max-width:none;margin:0;width:100%;min-width:0}
.app-header,main,.bottom-nav{min-width:0}
.bottom-nav{width:100%;max-width:none}
main{max-width:none;min-width:0}

@media (min-width:600px) and (max-width:899px){
  .app{max-width:none}
  main{max-width:none;width:100%;padding:24px clamp(20px,4vw,36px) 104px}
  .bottom-nav{width:100%}
  #eqList,#adminEquipmentList,#adminLoanList,#maintenanceList,.account-grid{
    grid-template-columns:repeat(auto-fit,minmax(min(280px,100%),1fr));
  }
}

@media (min-width:900px){
  html,body{width:100%;min-width:0}
  .app{width:100%;max-width:none;grid-template-columns:clamp(250px,19vw,300px) minmax(0,1fr)}
  main{width:100%;max-width:none;min-width:0;padding-inline:clamp(24px,3.2vw,58px)}
  .stats{grid-template-columns:repeat(auto-fit,minmax(170px,1fr))}
  #eqList,#adminEquipmentList,#adminLoanList,#maintenanceList{
    grid-template-columns:repeat(auto-fit,minmax(min(320px,100%),1fr));
  }
  .account-grid{grid-template-columns:repeat(auto-fit,minmax(min(330px,100%),1fr))}
  .cart-bar{left:calc(clamp(250px,19vw,300px) + clamp(24px,3.2vw,58px));right:clamp(24px,3.2vw,58px)}
}

@media (max-width:599px){
  .app{width:100%;max-width:none;box-shadow:none}
  .bottom-nav{width:100%;max-width:none}
}

/* Shared type scale: readable Thai text with room for vowels and tone marks. */
.google-sign-in{margin-top:24px}.auth-divider{display:flex;align-items:center;gap:14px;color:var(--text-secondary,var(--muted));font-size:14px;margin:0 0 18px}.auth-divider::before,.auth-divider::after{content:'';height:1px;flex:1;background:var(--border,var(--line))}.google-button{display:flex;justify-content:center;min-height:44px;max-width:100%}.google-button>.button{margin-top:0}.google-button button:disabled{cursor:not-allowed;opacity:.7}.google-status,.google-note{font-size:13px;line-height:1.7;text-align:center;color:var(--text-secondary,var(--muted));margin:10px 0 0}.google-status:empty{display:none}.google-link-form{margin-top:16px}.google-sign-in[aria-busy="true"] .google-button{pointer-events:none;opacity:.65}
:root{--type-caption:13px;--type-small:14px;--type-ui:15px;--type-body:16px;--type-heading:20px;--type-title:28px}
body{font-size:var(--type-body);line-height:1.7}
button,input,select,textarea{font-family:inherit;line-height:1.6}
.page-title,.profile .page-title,.auth-content h1{font-size:var(--type-title);font-weight:600;line-height:1.5}
.section-title,.auth-card h2,.modal-sheet h2{font-size:var(--type-heading);font-weight:600;line-height:1.5}
.card h3,.account-card h3{font-size:18px;font-weight:600;line-height:1.6;overflow-wrap:anywhere}
.subtitle,.meta,.form-hint,.profile-primary p,.profile-detail b{font-size:var(--type-small);line-height:1.75}
.code,.badge,.stat span,.loan-card footer,.image-help,.profile-detail small,.profile-action-card small{font-size:var(--type-caption);line-height:1.65}
.button,.button.compact,.card-action .button,.chip,.auth-card label,.field,.profile-action-card b{font-size:var(--type-ui);font-weight:500;line-height:1.6}
.button,.card-action .button,.chip{min-height:44px}
input,select,textarea,.auth-card input{font-size:var(--type-body);min-height:46px}
.app-header.modern-header strong{font-size:22px;font-weight:600;line-height:1.5}
.header-eyebrow,.department-caption{font-size:12px;letter-spacing:.06em;line-height:1.5}
.department-name{font-size:var(--type-ui)}
.modern-nav .nav-label{font-size:var(--type-ui);line-height:1.6}
.modern-nav .nav-copy small{font-size:var(--type-caption);line-height:1.6}
.equipment-card>div,.equipment-copy{min-width:0}
@media(min-width:900px){.bottom-nav.modern-nav a{min-height:78px}.modern-nav .nav-copy small{white-space:normal;overflow:visible}.bottom-nav.modern-nav::before{font-size:var(--type-caption)}}
@media(max-width:899px){.modern-nav .nav-label{font-size:12px;line-height:1.5}.bottom-nav.modern-nav a{min-height:60px}.app-header.modern-header strong{font-size:20px}}
@media(max-width:599px){:root{--type-title:24px}.app-header.modern-header strong{font-size:17px}.header-eyebrow{font-size:11px;letter-spacing:.025em}.header-title{padding-left:0;border-left:0}.header-brand{gap:10px}.header-actions:has(.install.hidden){display:none}.app-header.modern-header{flex-wrap:wrap}.modern-header .install{font-size:13px}.cart-bar{bottom:calc(86px + env(safe-area-inset-bottom))}}


/* Login layout polish */
@media (min-width:900px){
  .auth-screen{grid-template-columns:minmax(380px,45%) minmax(500px,55%)}
  .auth-top{background:radial-gradient(circle at 12% 88%,rgba(213,179,90,.13),transparent 28%),linear-gradient(145deg,#064f3d 0%,#087454 56%,#075e47 100%);border-right:1px solid rgba(213,179,90,.72)}
  .auth-content{padding:26px clamp(42px,5vw,88px) 34px;justify-content:flex-start;background:radial-gradient(circle at 88% 8%,rgba(8,115,83,.07),transparent 30%),linear-gradient(135deg,#fbfcfb 0%,#f1f5f2 100%)}
  .auth-content>*{width:min(100%,540px)}
  .auth-content::before{margin-bottom:8px;font-size:12px}
  .auth-logo{width:72px;height:72px;padding:6px;border-color:#e1e8e4;box-shadow:0 10px 26px rgba(31,61,48,.11)}
  .auth-content h1{margin:6px 0 14px;font-size:29px;letter-spacing:-.035em}
  .auth-card{padding:24px 28px 26px;border:1px solid #dce4df;border-radius:16px;box-shadow:0 20px 50px rgba(17,70,51,.09),0 2px 8px rgba(17,70,51,.04)}
  .auth-card::before{content:'';position:absolute;top:0;left:28px;right:28px;height:3px;border-radius:0 0 4px 4px;background:linear-gradient(90deg,#087353,#4aa683)}
  .auth-card h2{font-size:22px;letter-spacing:-.02em}
  .auth-card label{margin-top:14px}
  .auth-card input{min-height:48px;border-radius:10px;padding:11px 14px;background:#fcfdfc}
  .auth-card .button{min-height:48px;border-radius:10px}
  .auth-link{margin-top:12px;padding:7px 12px}
}
.google-sign-in{margin-top:18px}
.auth-divider{font-size:13px;margin-bottom:14px}
.google-button>div,.google-button iframe{max-width:100%!important}
.google-status,.google-note{font-size:12px;line-height:1.55;margin-top:7px}
.google-link-form{margin-top:14px}
@media (min-width:900px) and (max-height:760px){
  .auth-content{padding-top:16px;padding-bottom:20px}
  .auth-content::before{display:none}
  .auth-logo{width:56px;height:56px}
  .auth-content h1{margin:3px 0 9px;font-size:25px}
  .auth-card{padding:18px 24px 20px}
  .auth-card h2{font-size:20px}
  .auth-card label{margin-top:9px}
  .auth-card input,.auth-card .button{min-height:44px}
  .wide{margin-top:14px}
  .google-sign-in{margin-top:16px}
  .auth-divider{margin-bottom:12px}
  .google-status,.google-note{margin-top:6px;line-height:1.45}
  .auth-link{margin-top:6px}
}


/* Branded login experience for tablet and mobile */
@media (max-width:899px){
  html,body{background:#f3f7f5}
  #loginView.auth-screen{max-width:none;min-height:100dvh;background:linear-gradient(180deg,#075b43 0,#087453 232px,#f3f7f5 232px,#f3f7f5 100%);box-shadow:none;overflow:hidden}
  #loginView .auth-top{position:relative;min-height:222px;padding:36px 28px 72px;text-align:center;background:transparent;color:#fff;overflow:hidden}
  #loginView .auth-top:before{content:"";position:absolute;top:-230px;right:-100px;width:420px;height:420px;border:1px solid rgba(255,255,255,.14);border-radius:50%;box-shadow:0 0 0 52px rgba(255,255,255,.035),0 0 0 105px rgba(255,255,255,.025);pointer-events:none}
  #loginView .auth-top:after{content:var(--language-campus);position:relative;display:block;margin-top:12px;color:rgba(255,255,255,.78);font-size:14px;font-weight:500}
  #loginView .auth-top p{position:relative;margin:0 0 12px;color:#f1cf72;font-size:13px;font-weight:700;letter-spacing:.12em;text-transform:uppercase}
  #loginView .auth-top strong{position:relative;display:block;color:#fff;font-size:clamp(28px,5.2vw,38px);font-weight:700;line-height:1.2;letter-spacing:-.02em}
  #loginView .auth-content{position:relative;z-index:2;width:min(100%,620px);max-width:620px;margin:-72px auto 0;padding:0 24px 42px;text-align:center}
  #loginView .auth-logo{width:82px;height:82px;padding:6px;border:5px solid #fff;border-radius:50%;background:#fff;box-shadow:0 14px 32px rgba(2,53,40,.2)}
  #loginView .auth-content h1{margin:6px 0 16px;color:#fff;font-size:28px;font-weight:700;line-height:1.25;text-shadow:0 2px 12px rgba(0,45,33,.22)}
  #loginView .auth-card{position:relative;padding:26px 30px 28px;border:1px solid rgba(10,96,72,.12);border-radius:20px;background:#fff;box-shadow:0 22px 55px rgba(17,72,57,.14);overflow:hidden;text-align:left}
  #loginView .auth-card:before{content:"";position:absolute;inset:0 0 auto;height:4px;background:linear-gradient(90deg,#0a7658 0%,#55b994 64%,#e2bd57 100%)}
  #loginView .overline{display:inline-flex;margin:0;padding:5px 10px;border-radius:999px;background:#edf7f2;color:#126148;font-size:12px;font-weight:700;letter-spacing:.11em}
  #loginView .auth-card h2{margin:9px 0 6px;font-size:22px;line-height:1.3}
  #loginView .auth-card label{margin-top:12px;font-size:16px;font-weight:600}
  #loginView .auth-card input{min-height:52px;border-color:#cedbd6;border-radius:11px;background:#fbfdfc}
  #loginView .auth-card input:focus{border-color:#188362;box-shadow:0 0 0 4px rgba(24,131,98,.11);background:#fff}
  #loginView .forgot-row{margin:9px 0 12px}
  #loginView .button.primary{min-height:52px;border-radius:11px;background:linear-gradient(135deg,#087454,#0a664c);box-shadow:0 9px 20px rgba(8,116,84,.18)}
  #loginView .auth-divider{margin:20px 0 16px;color:#72827c}
  #loginView .google-sign-in{margin-top:0}
  #loginView .google-button{min-height:46px;border-radius:10px;overflow:hidden}
  #loginView .google-status{margin-top:8px;color:#7b8984}
  #loginView .auth-link{display:inline-flex;align-items:center;justify-content:center;margin-top:16px;padding:9px 18px;border:1px solid #d7e3de;border-radius:999px;background:rgba(255,255,255,.9);box-shadow:0 8px 22px rgba(20,70,56,.08);font-weight:600;text-decoration:none}
}
@media (max-width:599px){
  #loginView.auth-screen{background:linear-gradient(180deg,#075b43 0,#087453 205px,#f3f7f5 205px,#f3f7f5 100%)}
  #loginView .auth-top{min-height:198px;padding:28px 20px 64px}
  #loginView .auth-top p{margin-bottom:9px;font-size:11px}
  #loginView .auth-top strong{font-size:27px}
  #loginView .auth-top:after{margin-top:9px;font-size:12px}
  #loginView .auth-content{margin-top:-62px;padding:0 15px 30px}
  #loginView .auth-logo{width:70px;height:70px;border-width:4px}
  #loginView .auth-content h1{margin:5px 0 12px;font-size:24px}
  #loginView .auth-card{padding:23px 18px 24px;border-radius:17px}
  #loginView .auth-card h2{font-size:21px}
}

@media (max-width:899px){#loginView .auth-content h1{color:#075b43;text-shadow:none;margin:9px 0 16px}}

/* Larger login logo */
@media (min-width:900px){#loginView .auth-logo{width:88px;height:88px}}
@media (min-width:900px) and (max-height:760px){#loginView .auth-logo{width:72px;height:72px}}


/* Editable account details */
.profile-edit-form .profile-detail{margin:0}
.profile-edit-form label.profile-detail{cursor:text}
.profile-edit-form .profile-detail input{width:100%;min-height:38px;padding:7px 9px;border:1px solid transparent;border-radius:6px;background:transparent;color:var(--text);font:inherit;font-weight:600;outline:0}
.profile-edit-form .profile-detail input:focus{border-color:var(--primary);background:var(--surface);box-shadow:0 0 0 3px rgba(13,121,83,.12)}
.profile-save{display:grid;align-content:center;gap:7px;padding:17px 18px 15px}
.profile-save small{color:var(--text-secondary);font-size:12px;line-height:1.5}
@media(max-width:700px){.profile-save{padding:14px 2px}.profile-save .button{width:100%}}

/* Keep borrowing actions aligned when adjacent descriptions wrap differently. */
#eqList>.equipment-card{grid-template-rows:1fr auto;align-content:stretch}
#eqList .card-action{align-self:end;margin-top:8px}
#eqList .card-action .button{min-height:48px;padding:10px 12px;line-height:1.5}
#eqList .card-action .button.is-selected{background:var(--primary-soft,var(--soft));color:var(--green);box-shadow:inset 0 0 0 1px currentColor}
#eqList .card-action .button:disabled{cursor:default;opacity:.75}
#eqList .card-action .button:focus-visible{outline:3px solid var(--green);outline-offset:3px}

.profile-value-row{display:flex;align-items:center;justify-content:space-between;gap:16px;min-width:0}.profile-value-row b{min-width:0}.profile-pencil{display:grid;place-items:center;flex:0 0 36px;width:36px;height:36px;border:1px solid var(--border);border-radius:10px;background:var(--surface);color:var(--primary);cursor:pointer}.profile-pencil svg{width:18px;height:18px}.profile-pencil:hover{background:var(--primary-soft);border-color:var(--primary)}.profile-pencil:focus-visible{outline:3px solid var(--primary);outline-offset:3px}.profile-inline-form{margin:0;min-width:0}.profile-inline-form .field{margin:0}.profile-inline-actions{display:flex;gap:8px;margin-top:12px}.profile-edit-error{color:#b42318;font-size:14px;margin:6px 0}.profile-edit-error:empty{display:none}.profile-inline-form button:disabled{opacity:.6;cursor:wait}
:root{--language-campus:"มหาวิทยาลัยเกษตรศาสตร์ · วิทยาเขตกำแพงแสน";--language-description:"ระบบสำหรับจัดการ ตรวจสอบ และติดตามอุปกรณ์ของสาขาอย่างมีประสิทธิภาพ";--language-department:"สาขาเทคโนโลยีสารสนเทศ";--language-menu:"เมนูทั้งหมด"}
html:lang(en){--language-campus:"Kasetsart University · Kamphaeng Saen Campus";--language-description:"Manage, review and track department equipment efficiently";--language-department:"Information Technology";--language-menu:"ALL MENUS"}
.auth-language-bar{display:flex;justify-content:flex-end;margin-bottom:8px}
.auth-language-switch{display:inline-flex;gap:3px;padding:3px;border:1px solid #cbdcd5;border-radius:24px;background:#fff}
.auth-language-switch button{min-width:52px;min-height:40px;padding:6px 14px;border:0;border-radius:20px;background:transparent;color:#246d51;font-weight:700;cursor:pointer}
.auth-language-switch button[aria-pressed="true"]{background:#086b4f;color:#fff}
.auth-language-switch button:hover{box-shadow:inset 0 0 0 1px #086b4f}
.auth-language-switch button:focus-visible{outline:3px solid #68ac91;outline-offset:3px}

/* Keep the language control out of the login form's vertical rhythm. */
@media(min-width:900px){
  #loginView.auth-screen{grid-template-columns:minmax(340px,42%) minmax(0,58%)}
  #loginView .auth-top{padding:100px clamp(36px,5vw,88px) 80px}
  #loginView .auth-top::after{top:40px;left:clamp(36px,5vw,88px);right:36px;font-size:13px;line-height:1.6}
  #loginView .auth-top p{font-size:16px;margin-bottom:14px}
  #loginView .auth-top strong{font-size:clamp(32px,3vw,48px);line-height:1.35;letter-spacing:-.025em}
  #loginView .auth-top strong::after{margin-top:22px;font-size:14px;line-height:1.8}
  #loginView .auth-content{padding:72px 32px 24px;justify-content:flex-start}
  #loginView .auth-content>*{width:min(100%,480px)}
  #loginView .auth-content::before{display:none}
  #loginView .auth-language-bar{position:absolute;top:18px;right:28px;width:auto;margin:0}
  #loginView .auth-logo{width:64px;height:64px;margin-top:auto}
  #loginView .auth-content h1{font-size:25px;line-height:1.3;margin:8px 0 16px}
  #loginView .auth-card{padding:20px 24px 22px;border-radius:16px}
  #loginView .overline{font-size:11px;letter-spacing:.06em}
  #loginView .auth-card h2{font-size:20px;margin:3px 0 12px}
  #loginView .auth-card label{margin-top:12px;font-size:14px}
  #loginView .auth-card input{min-height:44px;padding:10px 12px}
  #loginView .auth-card .button{min-height:44px;padding:9px 14px;font-size:15px}
  #loginView .forgot-row{margin:8px 0 0}
  #loginView .wide{margin-top:16px}
  #loginView .google-sign-in{margin-top:16px}
  #loginView .auth-divider{margin:0 0 12px}
  #loginView .google-note{margin:8px 0 0;font-size:11px}
  #loginView .auth-link{margin:12px 0 auto;padding:6px 12px;font-size:13px}
}
@media(min-width:900px) and (max-height:800px){
  #loginView .auth-content{padding-top:60px;padding-bottom:16px}
  #loginView .auth-language-bar{top:12px;right:24px}
  #loginView .auth-logo{width:56px;height:56px}
  #loginView .auth-content h1{font-size:23px;margin:6px 0 12px}
  #loginView .auth-card{padding:18px 24px}
  #loginView .auth-card label{margin-top:10px}
  #loginView .auth-link{margin-top:8px}
}
@media(max-width:899px){
  #loginView.auth-screen{position:relative}
  #loginView .auth-content{position:static}
  #loginView .auth-language-bar{position:absolute;top:12px;right:16px;margin:0;z-index:3}
  #loginView .auth-top{padding-top:74px;min-height:250px}
  #loginView .auth-language-switch button{min-width:48px;min-height:38px;padding:5px 12px}
  #loginView .auth-card{padding:22px 22px 24px}
}
@media(max-width:599px){
  #loginView .auth-top{min-height:234px;padding:68px 20px 64px}
  #loginView .auth-top strong{font-size:25px;line-height:1.35}
  #loginView .auth-card{padding:20px 18px 22px}
}

/* Desktop icon rail: expand over the content without shifting the page. */
@media(min-width:900px) and (hover:hover) and (pointer:fine){
  .app{grid-template-columns:84px minmax(0,1fr)}
  .app-header.modern-header{padding-left:13px}
  .bottom-nav.modern-nav{width:84px;padding:18px 10px;overflow-x:hidden;scrollbar-width:none;z-index:15;transition:width .22s ease,box-shadow .22s ease}
  .bottom-nav.modern-nav::-webkit-scrollbar{width:0}
  .bottom-nav.modern-nav::before{height:0;min-height:0;padding:0;margin:0;border:0;opacity:0;overflow:hidden;white-space:nowrap;transition:opacity .15s ease}
  .bottom-nav.modern-nav a,.bottom-nav.modern-nav a[data-p="profile"]{min-height:64px;padding:11px;gap:14px;border-radius:13px;transform:none}
  .bottom-nav.modern-nav a b{flex:0 0 40px;width:40px;height:40px}
  .bottom-nav.modern-nav .nav-copy{flex:0 0 178px;width:178px;opacity:0;visibility:hidden;transition:opacity .15s ease;white-space:nowrap}
  .bottom-nav.modern-nav .nav-copy small{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
  .bottom-nav.modern-nav .nav-arrow{opacity:0;visibility:hidden}
  .bottom-nav.modern-nav:is(:hover,:has(a:focus-visible)){width:320px;box-shadow:12px 0 28px #102f2526}
  .bottom-nav.modern-nav:is(:hover,:has(a:focus-visible))::before{height:auto;min-height:32px;margin:20px 10px 6px;padding:0 0 10px;border-bottom:1px solid var(--border);opacity:1}
  .bottom-nav.modern-nav:is(:hover,:has(a:focus-visible)) .nav-copy{opacity:1;visibility:visible}
  .bottom-nav.modern-nav:is(:hover,:has(a:focus-visible)) .nav-arrow{visibility:visible}
  .bottom-nav.modern-nav:is(:hover,:has(a:focus-visible)) a.active .nav-arrow,.bottom-nav.modern-nav a:hover .nav-arrow{opacity:1}
}
@media(prefers-reduced-motion:reduce){.bottom-nav.modern-nav,.bottom-nav.modern-nav .nav-copy{transition:none!important}}
html[data-reduce-motion="true"] .bottom-nav.modern-nav,html[data-reduce-motion="true"] .bottom-nav.modern-nav .nav-copy{transition:none!important}
.bottom-nav.modern-nav a b.nav-profile-icon:has(.nav-profile-photo){position:relative;overflow:hidden;padding:0;border-radius:50%;width:40px;height:40px;flex:0 0 40px}
.nav-profile-icon .nav-profile-photo{display:block;width:100%;height:100%;object-fit:cover;border-radius:inherit}
.nav-profile-icon:has(.nav-profile-photo)>svg{display:none}

/* Compact loan summary, centered in the content rather than the sidebar layout. */
#content .cart-bar{
  left:var(--cart-center,50%);right:auto;
  width:min(460px,calc(var(--cart-area-width,100vw) - 32px));max-width:none;
  margin:0;transform:translateX(-50%);box-sizing:border-box;
  padding:8px 10px;gap:10px;border:1px solid #ffffff18;border-radius:16px;
  background:#172b29;box-shadow:0 8px 24px #102e2426;
}
#content .cart-bar>b{
  display:grid;place-items:center;flex:0 0 34px;width:34px;height:34px;
  border-radius:10px;background:#ffffff12;color:#bce8d8;font-size:18px;
}
#content .cart-bar>span{min-width:0;font-size:13px;line-height:1.5;font-weight:500}
#content .cart-bar>.button{
  flex:0 0 auto;min-height:40px;margin:0;padding:8px 14px;
  border-radius:11px;font-size:14px;line-height:1.5;white-space:nowrap;
}
@media(max-width:359px){
  #content .cart-bar{gap:7px;padding:8px;width:calc(var(--cart-area-width,100vw) - 20px)}
  #content .cart-bar>b{display:none}
  #content .cart-bar>.button{padding-inline:10px;font-size:13px}
}

/* Reserve scroll space for floating actions, including the chat launcher. */
.app main#content{padding-bottom:max(var(--floating-clearance,0px),calc(124px + env(safe-area-inset-bottom)))}

/* Inventory cards with readable stock counts and aligned actions. */
/* Compact navigation: equal icon boxes, aligned labels and controlled overflow. */
@media(max-width:899px){
  .app{display:grid;grid-template-columns:minmax(0,1fr);grid-template-rows:auto minmax(0,1fr);height:100dvh;min-height:0;padding-bottom:0;overflow:hidden}
  .app-header.modern-header{grid-column:1;grid-row:1;position:relative;top:0;z-index:20;flex-shrink:0}
  .app main{grid-column:1;grid-row:2;min-height:0;height:100%;overflow-y:auto;overflow-x:hidden;overscroll-behavior-y:contain;-webkit-overflow-scrolling:touch}
  .bottom-nav.modern-nav{display:grid;grid-template-columns:repeat(var(--nav-count,5),minmax(64px,1fr));gap:4px;left:0;right:0;bottom:0;transform:none;width:100%;height:auto;max-height:none;padding:10px 10px calc(10px + env(safe-area-inset-bottom));background:var(--surface);border-top:1px solid var(--border);box-shadow:0 -8px 28px rgba(15,45,34,.08);border-radius:18px 18px 0 0;overflow-x:auto;overflow-y:hidden;scrollbar-width:none;overscroll-behavior-x:contain;align-items:stretch}
  .bottom-nav.modern-nav::-webkit-scrollbar{display:none}
  .bottom-nav.modern-nav::before{display:none}
  .bottom-nav.modern-nav a,.bottom-nav.modern-nav a[data-p="profile"]{display:flex;flex-direction:column;justify-content:flex-start;align-items:center;gap:6px;min-height:78px;margin:0;padding:5px 2px;border:1px solid transparent;border-radius:12px;color:var(--text-secondary);text-align:center;box-shadow:none;transform:none}
  .bottom-nav.modern-nav a b,.bottom-nav.modern-nav a b.nav-profile-icon:has(.nav-profile-photo){display:grid;place-items:center;flex:0 0 32px;width:32px;height:32px;padding:0;margin:0;border:0;border-radius:10px;background:transparent;line-height:1;overflow:hidden;transform:none}
  .bottom-nav.modern-nav a b svg{width:20px;height:20px;margin:0}
  .bottom-nav.modern-nav a .nav-copy{display:block;width:100%;min-width:0}
  .bottom-nav.modern-nav .nav-label{font-size:11px;font-weight:600;line-height:1.45;min-height:32px;display:flex;align-items:flex-start;justify-content:center;overflow-wrap:normal;word-break:normal}
  .bottom-nav.modern-nav .nav-copy small,.bottom-nav.modern-nav .nav-arrow{display:none}
  .bottom-nav.modern-nav a.active{background:var(--primary-soft);color:var(--primary);border-color:var(--border);box-shadow:none}
  .bottom-nav.modern-nav a.active b{background:var(--primary);color:#fff}
  .bottom-nav.modern-nav a:hover{background:var(--primary-soft);color:var(--primary);transform:none}
  .bottom-nav.modern-nav a[data-p="profile"] b.nav-profile-icon:has(.nav-profile-photo){border-radius:50%;box-shadow:0 0 0 2px var(--border)}
  main{padding-bottom:calc(124px + env(safe-area-inset-bottom))}
  .cart-bar{bottom:calc(108px + env(safe-area-inset-bottom))}
}
.audit-role-picker{display:flex;flex-wrap:wrap;gap:6px;width:fit-content;margin-top:24px;padding:5px;border:1px solid var(--border);border-radius:13px;background:var(--surface)}
.audit-role-picker button{min-height:44px;padding:10px 22px;border:0;border-radius:9px;background:transparent;color:var(--text-secondary);font:inherit;font-size:14px;font-weight:600;cursor:pointer}
.audit-role-picker button[aria-pressed="true"]{background:var(--primary);color:#fff;box-shadow:var(--shadow-sm)}
.audit-role-picker button:focus-visible{outline:3px solid var(--primary);outline-offset:3px}
.audit-role-picker button:disabled{cursor:wait;opacity:.65}
.audit-role-picker{margin-bottom:20px}
.audit-load-error{padding:16px;border:1px solid var(--red);border-radius:12px;color:var(--red);background:var(--surface)}
.audit-filters{padding:18px;border:1px solid var(--border);border-radius:14px;background:var(--surface);margin-bottom:24px}
#auditList{display:grid;gap:16px}
#auditList .audit-card{margin:0;padding:24px;border:1px solid var(--border);border-left:4px solid var(--primary);border-radius:16px;background:var(--surface);box-shadow:var(--shadow-sm)}
#auditList .audit-subject{font-size:21px;margin:16px 0 4px;line-height:1.5}
.audit-explanation{margin:12px 0 18px;line-height:1.8;font-size:15px;color:var(--text)}
#auditList .audit-people{display:grid;grid-template-columns:repeat(auto-fit,minmax(180px,1fr));gap:16px;padding:16px;border:1px solid var(--border);border-radius:12px}
.audit-people small{font-size:12px;color:var(--text-secondary)}
#auditList .audit-change-list{grid-template-columns:repeat(auto-fit,minmax(220px,1fr))}
#auditList .audit-change{background:var(--surface-subtle);border-radius:12px}
#auditList .audit-change>div{font-size:18px;gap:12px}
#auditList .audit-event-header{gap:12px;flex-wrap:wrap}
#auditList .audit-event-header time{font-size:12px;color:var(--text-secondary)}
#auditList .audit-description{padding:12px 16px;border-left:3px solid var(--primary);background:var(--primary-soft);border-radius:0 10px 10px 0;font-size:14px}
@media(max-width:599px){.audit-role-picker{width:100%;flex-wrap:nowrap}.audit-role-picker button{flex:1;padding:10px 6px;font-size:12px}#auditList .audit-card{padding:18px}.audit-filters{padding:14px}#auditList .audit-change-list{grid-template-columns:1fr}}
#adminEquipmentList{display:grid;grid-template-columns:repeat(auto-fit,minmax(min(100%,300px),1fr));gap:20px}
#adminEquipmentList .empty-state{grid-column:1/-1}
#adminEquipmentList .admin-equipment-card{grid-template-columns:88px minmax(0,1fr);grid-template-rows:auto auto 1fr auto;gap:16px;align-items:start;margin:0;padding:22px;border:1px solid var(--border);border-radius:18px;background:var(--surface);box-shadow:var(--shadow-sm)}
#adminEquipmentList .admin-equipment-card:hover{border-color:#9fc5b5;box-shadow:var(--shadow-md)}
#adminEquipmentList .device-art{width:88px;height:88px;border-radius:14px;background:var(--surface-subtle)}
#adminEquipmentList .device-image{width:100%;height:100%;object-fit:contain;padding:6px}
#adminEquipmentList .equipment-copy{min-width:0;align-self:center}
#adminEquipmentList .equipment-category{display:block;font-size:12px;color:var(--text-secondary);margin-bottom:4px}
#adminEquipmentList h3{font-size:19px;line-height:1.5;margin:0 0 5px;overflow-wrap:anywhere;color:var(--text)}
#adminEquipmentList .code{font-size:12px;line-height:1.6}
#adminEquipmentList .equipment-status{grid-column:1/-1}
#adminEquipmentList .badge{border-radius:8px;font-size:12px;padding:5px 10px}
#adminEquipmentList .equipment-inventory{grid-column:1/-1;display:grid;grid-template-columns:1fr 1fr;align-self:end;padding:14px 0;border:1px solid var(--border);border-radius:12px;background:var(--surface-subtle)}
.equipment-inventory>div{display:grid;gap:4px;padding:0 18px}.equipment-inventory>div+div{border-left:1px solid var(--border)}
.equipment-inventory span,.equipment-inventory small{font-size:12px;font-weight:400;color:var(--text-secondary)}
.equipment-inventory strong{font-size:26px;line-height:1.3;font-variant-numeric:tabular-nums;color:var(--text)}
.equipment-inventory .inventory-available strong{color:var(--primary)}
#adminEquipmentList .admin-card-tools{grid-column:1/-1;width:100%;grid-template-columns:1fr 1.2fr .75fr;gap:8px;padding-top:16px;border-top:1px solid var(--border)}
#adminEquipmentList .admin-card-tools :is(button,label){width:100%;min-height:42px;font-size:12px;border-radius:9px}
#adminEquipmentList .icon-edit{background:var(--primary-soft);color:var(--primary)}
#adminEquipmentList .icon-image{background:var(--surface);color:var(--text-secondary);border:1px solid var(--border)}
#adminEquipmentList .icon-delete{background:var(--surface);color:var(--red)}
#adminEquipmentList .admin-card-tools :is(button,label):hover{box-shadow:inset 0 0 0 1px currentColor}
#adminEquipmentList .admin-card-tools button:focus-visible,#adminEquipmentList .equipment-image-input:focus-visible+label{outline:3px solid var(--primary);outline-offset:3px}
@media(max-width:599px){#adminEquipmentList{gap:14px}#adminEquipmentList .admin-equipment-card{padding:18px;gap:14px}}
