/* Portal hierarchy, responsive layout, and the public contact interaction. */
.staff-portal { background: linear-gradient(135deg, #eef5fa 0%, #e6f0f8 50%, #f8fbfd 100%); }
.portal-header { min-height: 78px; padding-inline: clamp(22px, 4vw, 82px); }
.portal-session { gap: 14px; }
.portal-language-toggle { display: inline-flex; align-items: center; gap: 6px; min-height: 34px; padding: 0 10px; border: 1px solid #cddce8; color: #1d5b92; text-decoration: none; font-size: .76rem; font-weight: 800; letter-spacing: .04em; }
.portal-language-toggle:hover { border-color: #237cc0; background: #edf7ff; }
.portal-language-toggle svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 1.8; }
.portal-sidebar { background: linear-gradient(180deg, #123e6d, #0a2d53); box-shadow: 8px 0 26px rgba(10, 43, 76, .08); }
.portal-main { display: flex; min-width: 0; padding: clamp(26px, 4.5vw, 72px); }
.portal-view { width: min(100%, 1480px); max-width: none; margin: 0 auto; }
.portal-title-row { position: relative; margin-bottom: 30px; padding: clamp(23px, 2.6vw, 34px); overflow: hidden; background: rgba(255, 255, 255, .82); border: 1px solid #dbe7ef; box-shadow: 0 12px 32px rgba(19, 63, 99, .07); }
.portal-title-row::after { position: absolute; top: 0; right: 0; width: 35%; height: 3px; content: ""; background: linear-gradient(90deg, transparent, #49a6e6); }
.portal-title-row h2 { letter-spacing: -.035em; }
.portal-view.active { animation: portal-view-in .34s cubic-bezier(.2,.8,.2,1); }
@keyframes portal-view-in { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }

.portal-nav.is-locked { position: relative; color: #9ec4e2; }
.portal-nav.is-locked::after { width: 15px; height: 15px; content: ""; background: center/contain no-repeat url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23a8cee9' stroke-width='2'%3E%3Crect x='5' y='10' width='14' height='10' rx='2'/%3E%3Cpath d='M8 10V7a4 4 0 0 1 8 0v3'/%3E%3C/svg%3E"); }
.portal-nav.is-locked:hover { color: #d8ebf8; background: rgba(91, 166, 221, .18); }
.portal-view[data-portal-panel='users'] { position: relative; min-height: 590px; }
.portal-access-lock { position: absolute; z-index: 5; inset: 0; display: grid; place-content: center; justify-items: center; min-height: 100%; padding: 42px; background: rgba(235, 244, 250, .82); border: 1px solid #cbdce9; text-align: center; backdrop-filter: blur(10px); }
.portal-access-lock[hidden] { display: none; }
.portal-access-lock-icon { display: grid; place-items: center; width: 76px; height: 76px; margin-bottom: 20px; border: 1px solid #83b6dc; border-radius: 50%; background: #fff; color: #1d6fae; box-shadow: 0 14px 28px rgba(36, 103, 153, .14); }
.portal-access-lock-icon svg { width: 40px; height: 40px; }
.portal-access-lock .eyebrow { margin: 0 0 8px; }
.portal-access-lock h3 { margin: 0; color: #163e68; font-size: clamp(1.4rem, 2.2vw, 2rem); }
.portal-access-lock-description { max-width: 470px; margin: 12px 0 0; color: #5d7891; line-height: 1.7; }
.portal-access-lock small { margin-top: 16px; color: #2378ba; font-weight: 700; }

.user-create-form { grid-template-columns: 1fr 1.35fr 1fr auto auto; border-top-width: 4px; box-shadow: 0 12px 30px rgba(19, 59, 94, .08); }
.user-list { margin-top: 18px; box-shadow: 0 12px 30px rgba(19, 59, 94, .06); }
.user-row { min-height: 58px; }
.inquiry-card { grid-template-columns: minmax(200px, .58fr) minmax(0, 1.5fr) 168px; transition: transform .2s ease, box-shadow .2s ease; }
.inquiry-card:hover { transform: translateY(-2px); box-shadow: 0 15px 27px rgba(19, 59, 94, .1); }
.dashboard-metrics { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin-bottom: 14px; }
.dashboard-metric { padding: 16px 18px; border-left: 3px solid #2780bf; background: rgba(255, 255, 255, .9); box-shadow: 0 6px 16px rgba(19, 59, 94, .05); }
.dashboard-metric:nth-child(2) { border-color: #df9f27; }
.dashboard-metric:nth-child(3) { border-color: #7892a6; }
.dashboard-metric span { display: block; color: #698298; font-size: .72rem; font-weight: 700; letter-spacing: .04em; }
.dashboard-metric strong { display: block; margin-top: 4px; color: #173f70; font-size: 1.65rem; }

.contact-section .contact-inner { min-height: 380px; justify-content: center; padding-block: clamp(70px, 10vw, 132px); text-align: center; }
.contact-section .contact-copy { display: grid; justify-items: center; max-width: 780px; }
.contact-section .contact-copy h2 { max-width: 690px; }
.contact-section .contact-copy > p:not(.eyebrow) { max-width: 650px; }
.contact-open { display: inline-flex; align-items: center; gap: 10px; margin-top: 27px; cursor: pointer; }
.contact-open svg { width: 17px; fill: none; stroke: currentColor; stroke-width: 1.8; }
.contact-shell { position: fixed; z-index: 2147483002; inset: 0; display: grid; place-items: center; padding: 20px; }
.contact-shell[hidden] { display: none; }
.contact-modal-open { overflow: hidden; }
.contact-backdrop { position: absolute; inset: 0; border: 0; background: rgba(4, 22, 42, .77); backdrop-filter: blur(9px); }
.contact-dialog { position: relative; display: grid; grid-template-columns: minmax(260px, .78fr) minmax(0, 1.22fr); width: min(100%, 1060px); max-height: min(860px, calc(100vh - 40px)); overflow: auto; border: 1px solid rgba(164, 211, 243, .34); background: #0f416f; box-shadow: 0 30px 85px rgba(0, 0, 0, .42); animation: contact-dialog-in .36s cubic-bezier(.2,.8,.2,1); }
@keyframes contact-dialog-in { from { opacity: 0; transform: translateY(24px) scale(.98); } to { opacity: 1; transform: none; } }
.contact-dialog-copy { padding: clamp(34px, 4vw, 62px); color: #e9f5ff; background: linear-gradient(155deg, #155e9e, #0a2f58); }
.contact-dialog-copy h2 { margin: 8px 0 17px; color: #fff; font-size: clamp(1.85rem, 3vw, 2.7rem); line-height: 1.22; }
.contact-dialog-copy > p:not(.eyebrow) { color: #bddcf3; line-height: 1.75; }
.contact-dialog-copy ul { display: grid; gap: 13px; margin: 34px 0 0; padding: 22px 0 0; border-top: 1px solid rgba(196, 229, 252, .28); color: #d9edfc; font-size: .86rem; list-style: none; }
.contact-dialog-copy li { position: relative; padding-left: 18px; }
.contact-dialog-copy li::before { position: absolute; top: .6em; left: 0; width: 7px; height: 7px; content: ""; border-radius: 50%; background: #73c5f7; box-shadow: 0 0 0 4px rgba(115, 197, 247, .13); }
.contact-dialog .contact-form { width: auto; padding: clamp(28px, 4vw, 50px); border: 0; background: #fff; box-shadow: none; backdrop-filter: none; }
.contact-dialog .contact-form label { color: #45627d; }
.contact-dialog .contact-form .consent-line { color: #5c748a; }
.contact-honeypot { position: absolute !important; left: -9999px !important; width: 1px !important; height: 1px !important; opacity: 0 !important; pointer-events: none !important; }
.contact-dialog .contact-security-note { display: none; }
.contact-dialog-close { position: absolute; z-index: 3; top: 12px; right: 14px; width: 36px; height: 36px; border: 0; background: rgba(255,255,255,.12); color: #fff; font-size: 26px; cursor: pointer; }
.contact-dialog-close:hover { background: rgba(255,255,255,.24); }
.contact-flight { position: absolute; z-index: 7; top: 52%; left: 51%; width: 80px; height: 80px; opacity: 0; pointer-events: none; transform: translate(-50%, -50%); }
.contact-flight svg { width: 100%; height: 100%; fill: #72c7fa; stroke: #e9f8ff; stroke-width: 3; filter: drop-shadow(0 14px 15px rgba(0, 22, 45, .38)); }
.contact-paper { position: absolute; inset: 9px 13px; background: #fff; box-shadow: 0 9px 20px rgba(0,0,0,.25); }
.contact-shell.is-sending .contact-dialog .contact-form { animation: contact-paper-fold 1.05s cubic-bezier(.6,0,.3,1) forwards; transform-origin: 50% 50%; }
.contact-shell.is-sending .contact-dialog-copy { animation: contact-copy-fade .45s ease forwards; }
.contact-shell.is-sending .contact-flight { animation: contact-plane-flight 1.15s .22s cubic-bezier(.16,.8,.2,1) forwards; }
@keyframes contact-paper-fold { 0% { opacity: 1; transform: perspective(800px) rotateY(0) scale(1); } 48% { opacity: 1; transform: perspective(800px) rotateY(-84deg) scale(.7); } 100% { opacity: 0; transform: perspective(800px) rotateY(-115deg) scale(.08); } }
@keyframes contact-copy-fade { to { opacity: .15; filter: blur(4px); } }
@keyframes contact-plane-flight { 0% { opacity: 0; transform: translate(-50%, -40%) rotate(-14deg) scale(.35); } 18% { opacity: 1; } 100% { opacity: 0; transform: translate(420px, -300px) rotate(20deg) scale(1.06); } }
.contact-success { position: absolute; z-index: 8; inset: 0; display: none; place-content: center; justify-items: center; padding: 35px; background: linear-gradient(145deg, rgba(8, 45, 82, .97), rgba(19, 105, 168, .96)); color: #eaf7ff; text-align: center; }
.contact-shell.is-sent .contact-success { display: grid; animation: contact-success-in .45s .08s both cubic-bezier(.2,.8,.2,1); }
@keyframes contact-success-in { from { opacity: 0; transform: scale(.94); } to { opacity: 1; transform: none; } }
.contact-success-check { display: grid; place-items: center; width: 64px; height: 64px; margin-bottom: 18px; border: 1px solid #9ed9ff; border-radius: 50%; color: #7ad0ff; font-size: 2rem; }
.contact-success h3 { margin: 0; font-size: 2rem; }
.contact-success p { max-width: 450px; color: #cae7fa; line-height: 1.7; }
.contact-success .button { margin-top: 15px; }

@media (max-width: 900px) {
  .portal-main { padding: 25px; }
  .dashboard-metrics { grid-template-columns: repeat(3, 1fr); }
  .contact-dialog { grid-template-columns: 1fr; max-width: 680px; }
  .contact-dialog-copy { padding: 34px; }
  .contact-dialog-copy ul { display: none; }
}
@media (max-width: 600px) {
  .portal-header { min-height: 65px; padding-inline: 16px; }
  .portal-brand strong { font-size: .9rem; }
  .portal-session > span { display: none; }
  .portal-language-toggle { padding: 0 8px; }
  .portal-main { padding: 16px; }
  .portal-title-row { padding: 22px 18px; }
  .dashboard-metrics { grid-template-columns: 1fr; }
  .contact-section .contact-inner { min-height: 330px; }
  .contact-shell { padding: 0; }
  .contact-dialog { width: 100%; max-height: 100vh; min-height: 100vh; border: 0; }
  .contact-dialog-copy { padding: 52px 26px 26px; }
  .contact-dialog .contact-form { padding: 26px 20px 34px; }
  .contact-flight { left: 45%; }
  @keyframes contact-plane-flight { 100% { opacity: 0; transform: translate(220px, -260px) rotate(20deg) scale(.9); } }
}

/* The desktop layout declares its grids later than the original mobile rules.
   Restate the portal controls here, at the end of the cascade, so a compact
   tablet or phone never inherits narrow desktop columns. */
@media (max-width: 760px) {
  .inquiry-card {
    grid-template-columns: minmax(0, 1fr);
    gap: 18px;
    padding: 22px 20px;
  }
  .inquiry-detail p { font-size: .94rem; }
  .inquiry-actions {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
  }
  .inquiry-actions select { min-width: 0; }
  .inquiry-actions button { width: auto; min-width: 92px; padding-inline: 16px; }

  .user-create-form {
    grid-template-columns: minmax(0, 1fr);
    gap: 16px;
    padding: 22px 20px;
  }
  .user-create-form label,
  .user-create-form input,
  .user-create-form .button,
  .user-create-form .portal-check { width: 100%; min-width: 0; box-sizing: border-box; }
  .user-create-form .portal-check { min-height: 24px; }
  .user-create-form .form-message { grid-column: auto; }

  .user-row { grid-template-columns: minmax(0, 1fr); gap: 10px; padding: 21px 20px; }
  .user-controls { grid-column: auto; grid-template-columns: minmax(0, 1fr); margin-top: 6px; }
}
