:root{
  --navy: #1A2F72;        /* from logo */
  --navy-2: #243C86;
  --sky: #B3C5E6;
  --sky-2: #D9E5F7;
  --ink: #0F172A;
  --muted: #475569;
  --card: #ffffff;
  --border: rgba(15,23,42,.10);
  --shadow: 0 12px 30px rgba(15,23,42,.10);
  --radius: 14px;
}

*{ box-sizing:border-box; }
html,body{ height:100%; }
body{
  margin:0;
  font-family: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, "Apple Color Emoji","Segoe UI Emoji";
  color: var(--ink);
  background:
    radial-gradient(1200px 600px at 20% -10%, var(--sky) 0%, transparent 60%),
    radial-gradient(900px 500px at 90% 10%, var(--sky-2) 0%, transparent 55%),
    linear-gradient(180deg, #f7f9ff 0%, #eef4ff 100%);
}

a{ color:inherit; }

.site-header{
  position: sticky;
  top: 0;
  z-index: 20;
  background: rgba(255,255,255,.85);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}

.header-inner{
  max-width: 1100px;
  margin: 0 auto;
  padding: 14px 18px;
  display:flex;
  align-items:center;
  justify-content: space-between;
  gap: 12px;
}

.brand{
  display:flex;
  align-items:center;
  gap: 12px;
  min-width: 0;
}

.brand img{
  width: 64px;
  height: 64px;
  border-radius: 12px;
  object-fit: cover;
  object-position: center top;
  box-shadow: 0 8px 18px rgba(15,23,42,.12);
  border: 1px solid var(--border);
  background: #fff;
}

.brand-text{ min-width:0; }
.brand-name{
  font-weight: 800;
  font-size: 20px;
  letter-spacing: .2px;
  color: var(--navy);
  line-height: 1.1;
}
.brand-sub{
  font-size: 16px;
  color: var(--muted);
  margin-top: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

main.container{
  max-width: 1100px;
  margin: 22px auto 40px;
  padding: 0 18px;
}

.nav-select{
  min-width: 210px;
  max-width: 320px;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: rgba(255,255,255,.9);
  color: var(--ink);
  font-weight: 700;
}

.card{
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 18px;
}

h1{
  margin: 0 0 14px;
  font-size: 26px;
  letter-spacing: -0.3px;
}
h2{
  margin: 0 0 10px;
  font-size: 18px;
  color: var(--navy);
}

.toolbar{
  display:flex;
  flex-wrap:wrap;
  align-items:center;
  gap: 10px;
  margin: 12px 0 14px;
}

input, select, textarea{
  width: 100%;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: rgba(255,255,255,.9);
  outline: none;
  font-size: 16px;
}
textarea{ min-height: 90px; }
input:focus, select:focus, textarea:focus{
  border-color: rgba(26,47,114,.35);
  box-shadow: 0 0 0 4px rgba(26,47,114,.12);
}

button{
  appearance:none;
  border: 1px solid rgba(26,47,114,.18);
  background: #fff;
  color: var(--navy);
  padding: 10px 12px;
  border-radius: 12px;
  font-weight: 700;
  cursor: pointer;
  transition: transform .05s ease, box-shadow .15s ease, background .15s ease;
}
button:hover{
  background: rgba(26,47,114,.06);
  box-shadow: 0 8px 18px rgba(15,23,42,.08);
}
button:active{ transform: translateY(1px); }
button:disabled{ opacity:.6; cursor:not-allowed; }

button.primary{
  background: linear-gradient(180deg, var(--navy) 0%, var(--navy-2) 100%);
  color: #fff;
  border-color: rgba(255,255,255,.12);
}
button.primary:hover{ background: linear-gradient(180deg, #203a88 0%, #1b2f6f 100%); }

button.danger{
  color: #b42318;
  border-color: rgba(180,35,24,.18);
}
button.danger:hover{
  background: rgba(180,35,24,.06);
}

.small-muted{
  font-size: 12px;
  color: var(--muted);
}

.list{
  display:flex;
  flex-direction: column;
  gap: 10px;
}

.list a{
  text-decoration:none;
}

.list-card{
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 14px 14px;
  box-shadow: 0 10px 24px rgba(15,23,42,.08);
}
.list-title{
  font-weight: 800;
  color: var(--ink);
}
.list-meta{
  margin-top: 6px;
  font-size: 12px;
  color: var(--muted);
  display:flex;
  flex-wrap: wrap;
  gap: 8px;
}
.list-actions{
  margin-top: 10px;
  display:flex;
  gap: 8px;
  flex-wrap: wrap;
}

fieldset{
  border: 1px solid var(--border) !important;
  border-radius: 14px !important;
  padding: 14px !important;
  background: rgba(255,255,255,.9);
}
legend{
  padding: 0 8px !important;
}

#msg{
  margin-top: 10px;
  font-size: 13px;
  color: var(--muted);
}

.header-actions{
  display: flex;
  align-items: center;
  gap: 10px;
}

.home-btn{
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: rgba(255,255,255,.9);
  cursor: pointer;
  color: var(--navy);
}

.home-btn:hover{
  background: rgba(26,47,114,.08);
}

.home-btn svg{
  width: 20px;
  height: 20px;
}

.qasls-table{
  width: 100%;
  border-collapse: collapse;
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
  background: #fff;
}

.qasls-table th,
.qasls-table td{
  border: 1px solid rgba(15,23,42,.12);
  padding: 10px 10px;
  vertical-align: top;
}

.qasls-table thead th{
  background: rgba(26,47,114,.06);
  color: var(--ink);
  font-weight: 800;
  font-size: 13px;
}

.qasls-table .col-area{
  width: 22%;
  font-weight: 800;
}

.qasls-table .col-criteria{
  width: 56%;
  font-size: 13px;
  color: var(--ink);
}

.qasls-table .col-side{
  width: 11%;
  text-align: center;
}

.qasls-choice{
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
}

.qasls-choice label{
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--muted);
}

.qasls-total{
  font-weight: 800;
  text-align: right;
}
.fab-save{
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 9999;

  padding: 12px 14px;
  border-radius: 999px;
  font-weight: 800;

  background: linear-gradient(180deg, var(--navy) 0%, var(--navy-2) 100%);
  color: #fff;
  border: 1px solid rgba(255,255,255,.12);
  box-shadow: 0 14px 30px rgba(15,23,42,.22);

  display: none; /* shown only in edit mode via JS */
}

.fab-save:hover {
  background: linear-gradient(180deg, #16a34a 0%, #15803d 100%); /* green */
  box-shadow: 0 14px 30px rgba(22, 163, 74, 0.35);
  filter: none;
}


.fab-save:disabled{
  opacity: .6;
  cursor: not-allowed;
}

/* iPad/iOS safety */
html { -webkit-text-size-adjust: 100%; }

input, select, textarea { font-size: 16px; } /* prevent iOS zoom */

button, .home-btn { min-height: 44px; }     /* touch target */
.nav-select { min-height: 44px; }           /* touch target */

.list-card { padding: 16px; }               /* easier tapping */

.resisted-table{
  width: 100%;
  border-collapse: collapse;
  border: 1px solid rgba(15,23,42,.12);
  border-radius: 12px;
  overflow: hidden;
  background: #fff;
}

.resisted-table th,
.resisted-table td{
  border: 1px solid rgba(15,23,42,.12);
  padding: 10px;
  vertical-align: middle;
}

.resisted-table thead th{
  background: rgba(26,47,114,.06);
  font-weight: 800;
  font-size: 13px;
}

.resisted-table .col-test{
  width: 60%;
  font-weight: 700;
  font-size: 13px;
}

.resisted-table .col-side{
  text-align: center;
  vertical-align: middle;
}


/* Resisted Tests: keep input + unit perfectly aligned */
.resisted-cell{
  display: grid;
  grid-template-columns: 92px 38px; /* input width | unit width */
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.resisted-input{
  width: 92px;         /* must match grid col */
  height: 34px;
  box-sizing: border-box;
  text-align: center;
}

.resisted-unit{
  width: 38px;         /* must match grid col */
  text-align: left;
  white-space: nowrap;
  opacity: 0.85;
  font-size: 13px;
}

.lr-table, .matrix-table{
  width: 100%;
  border-collapse: collapse;
  border: 1px solid rgba(15,23,42,.12);
  border-radius: 12px;
  overflow: hidden;
  background: #fff;
}

.lr-table th, .lr-table td,
.matrix-table th, .matrix-table td{
  border: 1px solid rgba(15,23,42,.12);
  padding: 10px;
  vertical-align: middle;
}

.lr-table thead th,
.matrix-table thead th{
  background: rgba(26,47,114,.06);
  font-weight: 800;
  font-size: 13px;
}

.lr-table .col-test{ width: 60%; font-weight: 700; font-size: 13px; }
.lr-table .col-side{ width: 20%; text-align: center; }

.matrix-table td.col-side{ text-align: center; }

.unit-cell{
  display: grid;
  grid-template-columns: 92px 38px; /* input | unit */
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.unit-input{
  width: 92px;
  height: 34px;
  box-sizing: border-box;
  text-align: center;
}

.unit-suffix{
  width: 38px;
  text-align: left;
  white-space: nowrap;
  opacity: 0.85;
  font-size: 13px;
}

/* YES/NO table radios */
.yesno-pill{
  display: grid;
  place-items: center;
  height: 34px;
  border: 1px solid rgba(15,23,42,.25);
  border-radius: 8px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  user-select: none;
}

.yesno-pill input{
  display: none; /* hide the default circle */
}

/* highlight selected */
.yesno-pill input:checked + span{
  background: rgba(26,47,114,.10);
  border-radius: 7px;
  padding: 6px 0;
  width: 100%;
  text-align: center;
}


/* Link-style button (e.g. Forgot password) */
.link-btn{
  background: none;
  border: none;
  padding: 4px 0;
  font-size: 13px;
  font-weight: 600;
  color: var(--navy);
  text-align: center;
  cursor: pointer;
}

.link-btn:hover{
  text-decoration: underline;
  box-shadow: none;
  background: none;
}

.link-btn:disabled{
  opacity: .6;
  cursor: not-allowed;
}
/* -----------------------------
   Mobile header fixes
------------------------------*/
@media (max-width: 640px) {
  .site-header {
    height: auto;              /* ✅ allow header to grow */
    padding: 8px 10px;
  }

  .header-inner {
    flex-direction: column;    /* ✅ stack vertically */
    align-items: stretch;
    gap: 8px;
  }

  .brand {
    gap: 8px;
  }

  .brand img {
    height: 32px;              /* smaller logo on mobile */
    width: auto;
  }

  .brand-name {
    font-size: 16px;
    line-height: 1.1;
  }

  .brand-sub {
    font-size: 12px;
    line-height: 1.1;
  }

  .header-actions {
    width: 100%;
    justify-content: space-between;
    gap: 8px;
  }



  .home-btn {
    flex-shrink: 0;
  }
}


/* -----------------------------
   Hamburger navigation (mobile)
------------------------------*/

.hamburger-btn {
  display: none;
  font-size: 22px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 6px 8px;
}

/* Mobile menu panel */
.mobile-menu {
  background: #fff;
  border-top: 1px solid #ddd;
  box-shadow: 0 4px 10px rgba(0,0,0,.08);
}

.mobile-menu button {
  display: block;
  width: 100%;
  text-align: left;
  padding: 12px 14px;
  background: none;
  border: none;
  font-size: 15px;
  border-bottom: 1px solid #eee;
}

/* Mobile rules */
@media (max-width: 640px) {
  .nav-select { display: none !important; }
  .hamburger-btn { display: inline-block !important; }

  /* ✅ make the menu actually appear under the sticky header */
  .site-header { position: sticky; }
  .mobile-menu {
    position: absolute;
    left: 0;
    right: 0;
    top: 100%;
    z-index: 1000;
  }
}


