*{box-sizing:border-box}body{margin:0;background:#f3f6fb;color:#182338;font:15px Arial}header{background:#001b4f;color:white;padding:18px 22px;font-weight:bold}header span{float:right;font-weight:normal}header a{color:white}.layout{display:flex;min-height:90vh}nav{width:210px;background:white;padding:15px;flex-shrink:0}nav a{display:block;padding:11px;color:#17345f;text-decoration:none;border-radius:6px}nav a:hover{background:#eaf2fa}main{padding:24px;width:100%;max-width:1500px;margin:auto}h1{color:#001b4f;font-size:25px}.panel,.stat{background:white;border:1px solid #e0e6ef;border-radius:9px;padding:18px;margin-bottom:18px}.stats{display:grid;grid-template-columns:repeat(4,1fr);gap:14px}.stat small{display:block;color:#68778c}.stat strong{font-size:27px;color:#001b4f}label{display:block;font-weight:bold;margin:12px 0 5px}input,select,textarea{width:100%;padding:10px;border:1px solid #cbd5e1;border-radius:6px;font:inherit}button,.button{background:#001b4f;color:white;border:0;padding:10px 16px;border-radius:6px;margin-top:14px;cursor:pointer}table{width:100%;border-collapse:collapse}th,td{text-align:left;padding:10px;border-bottom:1px solid #e7ebf1}th{background:#f3f6fa}.alert{padding:12px;background:#e8f6ee;margin-bottom:14px;border-radius:6px}.warning{background:#fff2d0}.danger{background:#fde8e7}.auth{max-width:480px;margin:8vh auto;width:92%}.grid{display:grid;grid-template-columns:repeat(2,1fr);gap:12px}.line{display:grid;grid-template-columns:2fr 1fr auto;gap:10px;margin:12px 0}.muted{color:#63738a}@media(max-width:760px){.layout{display:block}nav{width:100%;display:flex;overflow:auto}nav a{white-space:nowrap}main{padding:14px}.stats{grid-template-columns:repeat(2,1fr)}.grid{grid-template-columns:1fr}.line{grid-template-columns:1fr 1fr}.line button{grid-column:1/-1}}@media print{header,nav,button{display:none}main{padding:0}}
.inline-form{display:inline;margin:0}.link-button{background:none;color:#1455a0;padding:0;margin:0;text-decoration:underline;border:0;font:inherit;cursor:pointer}.danger-text{color:#b42318}


/* UI refinement only: no PHP, form, database or workflow changes */
a{color:#1455a0}
a:hover{color:#001b4f}
button,.button{font-weight:600;transition:background-color .15s ease,box-shadow .15s ease}
button:hover,.button:hover{background:#123b79;box-shadow:0 2px 6px rgba(0,27,79,.16)}
button:focus-visible,.button:focus-visible,a:focus-visible,input:focus-visible,select:focus-visible,textarea:focus-visible{outline:3px solid #9ed1db;outline-offset:2px}
.link-button{display:inline-block;background:#eaf2fa;color:#1455a0;border:1px solid #cbd9e8;border-radius:5px;padding:5px 10px;margin:2px 3px 2px 0;font-size:13px;font-weight:600;text-decoration:none;line-height:1.35}
.link-button:hover{background:#dceaf7;color:#001b4f;box-shadow:none}
.link-button.danger-text{background:#fff0ef;color:#b42318;border-color:#f2c7c4}
.link-button.danger-text:hover{background:#fde2df;color:#8f1d16}
.inline-form{vertical-align:middle}
.inline-form button{margin-top:0}
td a:not(.button){display:inline-block;margin:2px 3px 2px 0;padding:5px 9px;border:1px solid #cbd9e8;border-radius:5px;background:#f7faff;text-decoration:none;font-size:13px;font-weight:600}
td a:not(.button):hover{background:#eaf2fa;text-decoration:none}
.panel>p a:not(.button){display:inline-block;padding:7px 11px;margin:2px 4px 6px 0;border:1px solid #d5dfeb;border-radius:6px;background:#f7faff;text-decoration:none;font-weight:600}
.panel>p a:not(.button):hover{background:#eaf2fa}
table{font-size:14px}
th{color:#17345f;font-weight:700;white-space:nowrap}
tbody tr:hover,table tr:hover td{background:#f8fbff}
.stat{display:block;text-decoration:none;color:inherit;transition:transform .15s ease,box-shadow .15s ease}
.stat:hover{transform:translateY(-2px);box-shadow:0 4px 12px rgba(0,27,79,.08)}
@media(max-width:760px){
  table{min-width:620px}
  .panel{overflow-x:auto}
  button,.button{max-width:100%}
}

/* Reports page refinement: style its report tabs and Clear action */
main>p:has(a[href*="type=stock"]),
main>p:has(a[href*="type=in"]),
main>p:has(a[href*="type=out"]){display:flex;flex-wrap:wrap;align-items:center;gap:8px;margin:0 0 14px}
main>p:has(a[href*="type=stock"]) a,
main>p:has(a[href*="type=in"]) a,
main>p:has(a[href*="type=out"]) a{display:inline-block;padding:8px 13px;margin:0;border:1px solid #cbd9e8;border-radius:6px;background:#fff;color:#1455a0;font-weight:600;text-decoration:none}
main>p:has(a[href*="type=stock"]) a:hover,
main>p:has(a[href*="type=in"]) a:hover,
main>p:has(a[href*="type=out"]) a:hover{background:#eaf2fa;color:#001b4f}
form.search-form{display:flex;flex-wrap:wrap;align-items:center;gap:8px}
form.search-form input:not([type="hidden"]),form.search-form select{flex:1 1 220px;min-width:180px}
form.search-form button{margin:0;min-height:38px}
form.search-form a{display:inline-flex;align-items:center;justify-content:center;min-height:38px;padding:8px 13px;border:1px solid #cbd9e8;border-radius:6px;background:#f7faff;color:#1455a0;font-weight:600;text-decoration:none}
form.search-form a:hover{background:#eaf2fa;color:#001b4f}
.panel h2{margin-top:0;margin-bottom:16px}
@media(max-width:760px){
  form.search-form{align-items:stretch}
  form.search-form input:not([type="hidden"]),form.search-form select{flex-basis:100%;min-width:0}
  form.search-form button,form.search-form a{flex:1 1 auto}
}


/* Login page visual refinement only */
body:has(main.auth){
  min-height:100vh;
  background:
    radial-gradient(circle at 14% 18%,rgba(158,209,219,.34),transparent 28%),
    radial-gradient(circle at 88% 82%,rgba(0,27,79,.12),transparent 30%),
    linear-gradient(135deg,#eef4fb 0%,#f7f9fc 48%,#e8f1f8 100%);
}
main.auth{
  width:min(460px,calc(100% - 32px));
  max-width:460px;
  margin:clamp(42px,10vh,100px) auto 48px;
  padding:0;
}
main.auth h1{
  text-align:center;
  font-size:30px;
  letter-spacing:.2px;
  margin:0 0 22px;
  color:#001b4f;
}
main.auth h1::before{
  content:"MRI";
  display:flex;
  align-items:center;
  justify-content:center;
  width:66px;
  height:66px;
  margin:0 auto 16px;
  border-radius:20px;
  background:linear-gradient(145deg,#001b4f,#164b82);
  color:#fff;
  font-size:21px;
  font-weight:800;
  letter-spacing:1px;
  box-shadow:0 10px 24px rgba(0,27,79,.2);
}
main.auth .panel{
  padding:28px;
  border:1px solid rgba(203,217,232,.95);
  border-radius:16px;
  box-shadow:0 16px 42px rgba(0,27,79,.10);
}
main.auth label{margin:14px 0 7px;color:#17345f;font-size:14px}
main.auth input{
  min-height:46px;
  padding:12px 14px;
  border:1px solid #c7d5e5;
  border-radius:8px;
  background:#fbfdff;
  transition:border-color .15s ease,box-shadow .15s ease,background .15s ease;
}
main.auth input:focus{
  border-color:#267da1;
  background:#fff;
  box-shadow:0 0 0 3px rgba(158,209,219,.35);
  outline:0;
}
main.auth button{
  width:100%;
  min-height:46px;
  margin-top:22px;
  border-radius:8px;
  background:linear-gradient(100deg,#001b4f,#164b82);
  font-size:15px;
  font-weight:700;
  box-shadow:0 6px 14px rgba(0,27,79,.16);
}
main.auth button:hover{
  background:linear-gradient(100deg,#123b79,#1a638a);
  transform:translateY(-1px);
}
main.auth .alert{border-radius:9px;margin-bottom:14px}
@media(max-width:520px){
  main.auth{margin:42px auto 28px}
  main.auth h1{font-size:27px}
  main.auth .panel{padding:22px}
}


/* Dashboard visual refinement only */
main h1{color:#001b4f;letter-spacing:.15px}
main .stats,.stats-grid,.dashboard-stats{gap:16px}
.stat{
  position:relative;
  overflow:hidden;
  border:1px solid #d7e2ef;
  border-radius:12px;
  background:linear-gradient(145deg,#ffffff 0%,#f5f9ff 100%);
  box-shadow:0 3px 12px rgba(0,27,79,.045);
  padding:20px 18px;
}
.stat::before{
  content:"";
  position:absolute;
  left:0;top:0;bottom:0;
  width:4px;
  background:#9ed1db;
}
.stat strong,.stat b,.stat .value{
  display:block;
  margin-top:5px;
  color:#001b4f;
  font-size:28px;
  line-height:1.15;
  font-weight:800;
}
.stat a{font-weight:600;text-decoration:none}
.stat a:hover{text-decoration:underline}
.stat:nth-child(2)::before{background:#4b91c7}
.stat:nth-child(3)::before{background:#e4b64b}
.stat:nth-child(4)::before{background:#d97878}
main .panel{
  border-radius:12px;
  border-color:#d7e2ef;
  box-shadow:0 3px 14px rgba(0,27,79,.035);
}
main .panel h2{color:#17345f}
main table{border-collapse:separate;border-spacing:0}
main table th:first-child{border-top-left-radius:6px}
main table th:last-child{border-top-right-radius:6px}
@media(max-width:760px){
  .stat{padding:16px 14px}
  .stat strong,.stat b,.stat .value{font-size:24px}
}


/* Sidebar navigation refinement only */
.layout{align-items:stretch}
nav{
  width:220px;
  flex:0 0 220px;
  padding:20px 14px;
  background:linear-gradient(180deg,#ffffff 0%,#f7faff 100%);
  border-right:1px solid #e1e9f2;
}
nav a{
  position:relative;
  display:flex;
  align-items:center;
  min-height:42px;
  margin:3px 0;
  padding:11px 13px 11px 16px;
  border:1px solid transparent;
  border-radius:8px;
  color:#17345f;
  font-size:14px;
  font-weight:600;
  letter-spacing:.05px;
  transition:background .16s ease,border-color .16s ease,color .16s ease,transform .16s ease;
}
nav a::before{
  content:"";
  position:absolute;
  left:0;
  top:9px;
  bottom:9px;
  width:3px;
  border-radius:0 4px 4px 0;
  background:transparent;
}
nav a:hover{
  background:#edf5fc;
  border-color:#dce8f4;
  color:#001b4f;
  transform:translateX(2px);
}
nav a:hover::before{background:#4b91c7}
nav a:focus-visible{
  outline:3px solid rgba(158,209,219,.7);
  outline-offset:2px;
}
@media(min-width:761px){
  nav{min-height:calc(100vh - 46px)}
}
@media(max-width:760px){
  nav{
    width:100%;
    padding:10px 12px;
    gap:5px;
    border-right:0;
    border-bottom:1px solid #e1e9f2;
    background:#fff;
  }
  nav a{
    flex:0 0 auto;
    min-height:38px;
    margin:0;
    padding:9px 12px;
    border:1px solid #e1e9f2;
    background:#f8fbff;
  }
  nav a:hover{transform:none}
  nav a::before{display:none}
}
