:root{
  --bg:#ffffff;
  --card:#ffffff;
  --text:#0f172a;
  --muted:#64748b;
  --line:#e5e7eb;

  --blue:#1f5fbf;
  --blue2:#2b6fe3;
  --blueSoft:#eef5ff;

  --radius:14px;
  --shadow: 0 10px 30px rgba(15, 23, 42, 0.06);
  --shadow2: 0 6px 18px rgba(15, 23, 42, 0.07);
}

*{box-sizing:border-box}
body{
  margin:0;
  background:var(--bg);
  color:var(--text);
  font-family: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Arial, "Apple Color Emoji","Segoe UI Emoji";
  line-height:1.45;
}

a{color:var(--blue); text-decoration:none;}
a:hover{text-decoration:underline;}

.container{
  max-width:1180px;
  margin:24px auto;
  padding:0 18px;
}

.topbar{
  position:sticky;
  top:0;
  z-index:10;
  background:rgba(255,255,255,0.92);
  backdrop-filter: blur(10px);
  border-bottom:1px solid var(--line);
}

.topbar-inner{
  max-width:1180px;
  margin:0 auto;
  padding:14px 18px;
  display:flex;
  justify-content:space-between;
  align-items:center;
  gap:12px;
}

.brand{
  display:flex;
  align-items:center;
  gap:10px;
  font-weight:800;
  letter-spacing:-0.2px;
}

.brand-badge{
  width:36px;height:36px;
  border-radius:12px;
  background:linear-gradient(135deg, var(--blue), var(--blue2));
  box-shadow: var(--shadow2);
}

.user-chip{
  display:flex;
  align-items:center;
  gap:10px;
  color:var(--muted);
  font-size:13px;
}

.pills{
  display:flex;
  gap:10px;
  flex-wrap:wrap;
  align-items:center;
}

.card{
  background:var(--card);
  border:1px solid var(--line);
  border-radius:var(--radius);
  box-shadow:var(--shadow);
  padding:18px;
}

.card-header{
  display:flex;
  justify-content:space-between;
  align-items:flex-start;
  gap:14px;
  margin-bottom:12px;
}

h1{font-size:26px;margin:0 0 14px 0; letter-spacing:-0.4px;}
h2{font-size:18px;margin:0 0 10px 0; letter-spacing:-0.2px;}
.small{color:var(--muted); font-size:13px;}

hr.sep{
  border:none;
  border-top:1px solid var(--line);
  margin:16px 0;
}

.btn{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  gap:8px;
  background:linear-gradient(135deg, var(--blue), var(--blue2));
  color:#fff;
  font-weight:800;
  padding:10px 14px;
  border:none;
  border-radius:12px;
  cursor:pointer;
  box-shadow: 0 10px 18px rgba(31,95,191,0.18);
  transition: transform .08s ease, box-shadow .12s ease, opacity .12s ease;
  text-decoration:none;
}
.btn:hover{ transform: translateY(-1px); box-shadow: 0 14px 24px rgba(31,95,191,0.22); text-decoration:none;}
.btn:active{ transform: translateY(0); opacity:0.95;}
.btn.secondary{
  background:#334155;
  box-shadow: 0 10px 18px rgba(51,65,85,0.18);
}
.btn.ghost{
  background:transparent;
  color:var(--blue);
  border:1px solid rgba(31,95,191,0.25);
  box-shadow:none;
}
.btn.ghost:hover{
  background:var(--blueSoft);
  transform:none;
  box-shadow:none;
}

.grid{
  display:grid;
  grid-template-columns: repeat(12, 1fr);
  gap:14px;
}
.col-4{grid-column: span 4;}
.col-6{grid-column: span 6;}
.col-12{grid-column: span 12;}

@media (max-width: 920px){
  .col-4,.col-6{grid-column: span 12;}
  .topbar-inner{flex-direction:column; align-items:flex-start;}
}

input,select,textarea{
  width:100%;
  padding:11px 12px;
  border:1px solid var(--line);
  border-radius:12px;
  outline:none;
  background:#fff;
  font-size:14px;
  transition:border-color .12s ease, box-shadow .12s ease;
}
textarea{min-height:110px; resize:vertical;}
label{display:block; margin:10px 0 6px; font-size:13px; color:#334155; font-weight:700;}
input:focus,select:focus,textarea:focus{
  border-color: rgba(31,95,191,0.55);
  box-shadow: 0 0 0 4px rgba(31,95,191,0.12);
}

.table{
  width:100%;
  border-collapse:separate;
  border-spacing:0;
  overflow:hidden;
  border-radius:14px;
  border:1px solid var(--line);
}
.table th{
  text-align:left;
  font-size:12px;
  color:#334155;
  letter-spacing:.02em;
  background:#f8fafc;
  padding:12px;
  border-bottom:1px solid var(--line);
}
.table td{
  padding:12px;
  border-bottom:1px solid var(--line);
  vertical-align:top;
  font-size:14px;
}
.table tr:last-child td{border-bottom:none;}

.badge{
  display:inline-flex;
  align-items:center;
  gap:6px;
  padding:6px 10px;
  border-radius:999px;
  border:1px solid var(--line);
  background:#fff;
  color:#334155;
  font-size:12px;
}

.action-card{
  border:1px solid var(--line);
  border-radius:var(--radius);
  padding:16px;
  background: #ffffff;
  box-shadow: var(--shadow2);
  transition: transform .10s ease, box-shadow .12s ease;
  display:flex;
  flex-direction:column;
  gap:10px;
  min-height:120px;
}
.action-card:hover{
  transform: translateY(-2px);
  box-shadow: var(--shadow);
}
.action-card .title{font-weight:900; letter-spacing:-0.2px;}
.action-card .desc{color:var(--muted); font-size:13px; margin-top:-4px;}
.action-card .row{display:flex; gap:10px; align-items:center; flex-wrap:wrap;}

pre{white-space:pre-wrap;margin:0;}
/* =========================
   Back button positioning fix (global)
   Works for both old and new header layouts
   ========================= */

/* If a page uses .topbar without .topbar-inner (older pages), force it into a flex row */
.topbar{
  display:flex;
  justify-content:center;
}

/* Always keep content within max width and padded, even if page uses simple .topbar */
.topbar > *{
  width:100%;
  max-width:1180px;
  padding:14px 18px;
}

/* If the page already has .topbar-inner, don't double-pad */
.topbar .topbar-inner{
  padding:0;
}

/* Ensure the last element in the topbar row (usually Back/Logout) sits to the right, but not at the edge */
.topbar > div:last-child,
.topbar-inner > div:last-child{
  margin-left:auto;
  display:flex;
  gap:10px;
  align-items:center;
  justify-content:flex-end;
}

/* If Back is a button/link directly inside topbar, make it look consistent */
.topbar a.btn,
.topbar button.btn{
  white-space:nowrap;
}

/* =========================
   Portal identity and responsive improvements
   ========================= */
.brand-badge{
  width:150px;
  height:48px;
  flex:0 0 150px;
  border-radius:0;
  background:transparent url("portal-logo.png") center/contain no-repeat;
  box-shadow:none;
}

/* Add the logo to legacy topbars that do not use the newer brand component. */
.topbar > div:first-child:not(.topbar-inner)::before{
  content:"";
  display:inline-block;
  width:132px;
  height:42px;
  flex:0 0 132px;
  margin-right:14px;
  background:url("portal-logo.png") left center/contain no-repeat;
}
.topbar > div:first-child:not(.topbar-inner){
  display:flex;
  align-items:center;
}

.table-responsive{
  width:100%;
  overflow-x:auto;
  -webkit-overflow-scrolling:touch;
}
img, video, canvas, svg{max-width:100%;height:auto;}

/* Repair the focus rule so uppercase styling is not trapped inside it. */
input[type="text"]{text-transform:uppercase;}
textarea{ text-transform:none; }

@media (max-width: 920px){
  .container{
    width:100%;
    margin:14px auto;
    padding:0 12px;
  }
  .topbar{
    position:relative;
  }
  .topbar-inner{
    width:100%;
    padding:12px;
    flex-direction:row;
    align-items:center;
    flex-wrap:wrap;
  }
  .brand{
    width:100%;
    min-width:0;
    gap:10px;
  }
  .brand-badge{
    width:112px;
    height:38px;
    flex-basis:112px;
  }
  .brand > div:last-child{
    min-width:0;
    flex:1;
  }
  .brand > div:last-child > div{
    overflow-wrap:anywhere;
  }
  .topbar-inner > .pills,
  .topbar > div:last-child:not(.topbar-inner){
    width:100%;
    margin-left:0;
    justify-content:flex-start;
  }
  .pills{
    gap:8px;
  }
  .card{
    padding:14px;
    border-radius:12px;
  }
  .card-header{
    flex-direction:column;
    align-items:stretch;
  }
  h1{font-size:22px;}
  h2{font-size:17px;}
  .grid{gap:10px;}
  .btn{
    min-height:42px;
    padding:10px 12px;
  }
  input, select, textarea{
    font-size:16px; /* prevents automatic zoom on iOS */
  }
  .table{
    display:block;
    width:100%;
    overflow-x:auto;
    white-space:nowrap;
    -webkit-overflow-scrolling:touch;
  }
  .table th,.table td{
    min-width:120px;
  }
  pre{
    overflow-x:auto;
  }
}

@media (max-width: 560px){
  .brand-badge{
    width:96px;
    height:34px;
    flex-basis:96px;
  }
  .topbar-inner .btn,
  .topbar > div:last-child:not(.topbar-inner) .btn{
    flex:1 1 auto;
  }
  .action-card{
    min-height:auto;
    padding:14px;
  }
  .action-card .row{
    align-items:stretch;
  }
  .action-card .row .btn{
    width:100%;
  }
}

/* =========================
   Processing Board
   ========================= */
.processing-container{max-width:1440px;}
.processing-card{overflow:hidden;}
.processing-heading{display:flex;align-items:flex-start;justify-content:space-between;gap:16px;margin-bottom:18px;}
.processing-heading h1{text-transform:uppercase;letter-spacing:.02em;margin-bottom:4px;}
.board-access{border-radius:999px;padding:7px 11px;font-size:12px;font-weight:800;white-space:nowrap;border:1px solid var(--line);}
.board-access.admin-access{background:#ecfdf5;color:#047857;border-color:#a7f3d0;}
.board-access.view-access{background:#f8fafc;color:#64748b;}
.new-issuance-panel{border:1px solid var(--line);border-radius:10px;margin-bottom:20px;background:#f8fafc;}
.new-issuance-panel summary{cursor:pointer;padding:11px 14px;font-weight:800;color:#2563eb;user-select:none;}
.board-form{display:grid;grid-template-columns:1.25fr 1.05fr .8fr 1.2fr 1fr;gap:12px;padding:0 14px 14px;align-items:end;}
.board-form label{display:flex;flex-direction:column;gap:6px;font-size:12px;font-weight:800;color:#475569;}
.board-form input,.board-form select,.board-form textarea{width:100%;box-sizing:border-box;border:1px solid #cbd5e1;border-radius:8px;background:#fff;padding:9px 10px;font:inherit;text-transform:none;}
.board-comments-field{grid-column:1 / -2;}.board-form-actions{align-self:end;}
.board-group-title{font-size:14px;font-weight:900;color:#5791f6;border-bottom:1px solid #b7c8e8;padding:0 8px 10px;margin-top:8px;letter-spacing:.01em;}
.group-chevron{font-size:20px;margin-right:8px;}.item-count{display:inline-flex;align-items:center;justify-content:center;min-width:20px;height:20px;padding:0 5px;border-radius:10px;background:#eef4ff;color:#3b82f6;font-size:11px;margin-left:6px;}
.processing-table-wrap{width:100%;overflow:auto;-webkit-overflow-scrolling:touch;}
.processing-table{width:100%;min-width:1060px;border-collapse:separate;border-spacing:0;table-layout:fixed;background:#fff;}
.processing-table th,.processing-table td{border-right:1px solid #cbd7ea;border-bottom:1px solid #cbd7ea;padding:0;text-align:center;vertical-align:middle;font-size:13px;}
.processing-table th{height:40px;background:#fff;color:#334155;font-size:12px;font-weight:700;text-transform:uppercase;letter-spacing:.01em;}
.processing-table th:first-child,.processing-table td:first-child{border-left:1px solid #cbd7ea;}
.processing-table th:nth-child(1){width:12px}.processing-table th:nth-child(2){width:220px}.processing-table th:nth-child(3){width:190px}.processing-table th:nth-child(4){width:130px}.processing-table th:nth-child(5){width:170px}.processing-table th:nth-child(6){width:260px}.processing-table .actions-column{width:176px;}
.processing-table td{height:48px;overflow:hidden;}
.processing-table input,.processing-table select,.processing-table textarea{display:block;width:100%;height:48px;box-sizing:border-box;border:0;border-radius:0;background:transparent;padding:10px;font:inherit;color:#334155;text-align:center;text-transform:none;outline:none;resize:none;}
.processing-table textarea{text-align:left;line-height:1.3;}
.processing-table input:focus,.processing-table select:focus,.processing-table textarea:focus{box-shadow:inset 0 0 0 2px #5791f6;background:#f8fbff;}
.row-marker{width:12px!important;background:#fff;}.row-marker span{display:block;width:5px;height:48px;background:#5791f6;}
.status-cell{font-weight:900;color:#fff;}.status-cell select{color:#fff;font-weight:900;text-align:center;text-align-last:center;cursor:pointer;}.status-cell select option{color:#111827;background:#fff;}.status-cell span{display:flex;height:48px;align-items:center;justify-content:center;padding:0 8px;}
.status-issued-copy{background:#ff9f1c!important}.status-hard-copy{background:#ed4ab3!important}.status-relay-copy{background:#e83e62!important}.status-pending-ack{background:#078b4f!important}.status-done{background:#00c875!important}.status-pending-reply{background:#579bfc!important}.status-reroute{background:#b8b8b8!important}.status-tracking{background:#684848!important}.status-yet{background:#0789bd!important}.status-not-credited{background:#333333!important}.status-pending-tracer{background:#a88bef!important}
.issuance-view{font-weight:700;background:#f8fbff;}.comments-view{text-align:left!important;padding:9px 11px!important;white-space:normal;overflow-wrap:anywhere;}.processing-table td:not(.status-cell):not(.board-actions):not(.row-marker):not(.comments-view){padding:0 8px;}
.processing-table td.editable-cell,.processing-table td.status-cell{padding:0!important;}
.board-actions{display:flex;align-items:center;justify-content:center;gap:4px;padding:5px!important;white-space:nowrap;}
.inline-form{display:inline-flex;margin:0}.board-icon-btn{border:1px solid #cbd5e1;background:#fff;color:#334155;border-radius:7px;min-width:30px;height:32px;padding:0 8px;font-weight:800;cursor:pointer;}.board-icon-btn:hover{background:#f1f5f9}.board-icon-btn.save{background:#2563eb;border-color:#2563eb;color:#fff}.board-icon-btn.delete{color:#dc2626;}
.board-empty{padding:30px!important;color:#64748b;text-align:center!important;}.muted-dash{color:#94a3b8}.board-footnote{font-size:12px;color:#64748b;margin-top:12px;}
@media(max-width:900px){.processing-heading{flex-direction:column}.board-form{grid-template-columns:1fr 1fr}.board-comments-field{grid-column:1 / -1}.board-form-actions{grid-column:1 / -1}.board-form-actions .btn{width:100%;}}
@media(max-width:560px){.board-form{grid-template-columns:1fr}.board-comments-field,.board-form-actions{grid-column:auto}.processing-card{padding:12px}.board-access{white-space:normal}}

/* Document Submissions Status board */
.document-submission-board{margin-top:34px;padding-top:28px;border-top:2px solid #e2e8f0;}
.submission-heading{margin-bottom:14px;}
.submission-heading h2{margin:0 0 4px;text-transform:uppercase;letter-spacing:.02em;font-size:22px;}
.submission-create-form{grid-template-columns:1.35fr 1fr .8fr 1fr 1fr 1fr;}
.submission-table{min-width:1360px;}
.submission-table th:nth-child(1){width:12px}.submission-table th:nth-child(2){width:230px}.submission-table th:nth-child(3){width:175px}.submission-table th:nth-child(4){width:120px}.submission-table th:nth-child(5){width:170px}.submission-table th:nth-child(6){width:250px}.submission-table th:nth-child(7){width:240px}.submission-table .actions-column{width:176px;}
.submission-pending-client{background:#ff9f1c!important}.submission-send-dn{background:#e83e62!important}.submission-release{background:#0789bd!important}.submission-payment{background:#00c875!important}.submission-return{background:#a84edb!important}.submission-consent{background:#078b4f!important}
.timeline-edit{display:grid!important;grid-template-columns:1fr 1fr;align-items:stretch;}
.timeline-edit input{min-width:0;font-size:11px;padding:8px 4px;}
.timeline-edit input+input{border-left:1px solid #cbd7ea;}
@media(max-width:900px){.submission-create-form{grid-template-columns:1fr 1fr}.submission-create-form .board-comments-field{grid-column:1 / -1}}
@media(max-width:560px){.submission-create-form{grid-template-columns:1fr}.submission-create-form .board-comments-field{grid-column:auto}}

/* =========================
   Dashboard layout refresh — existing portal functions only
   ========================= */
.portal-dashboard-page{background:#f5f8fd;color:#0f1b35;min-height:100vh;padding-bottom:0}
.portal-dashboard-page a:hover{text-decoration:none}
.portal-header{position:sticky;top:0;z-index:50;background:rgba(255,255,255,.96);border-bottom:1px solid #dfe7f3;backdrop-filter:blur(12px)}
.portal-header-inner{height:74px;max-width:1600px;margin:0 auto;padding:0 22px;display:flex;align-items:center;gap:18px}
.portal-brand{display:flex;align-items:center;gap:18px;color:#0f1b35;min-width:315px}
.portal-brand img{width:142px;height:52px;object-fit:contain}
.portal-brand-copy{border-left:1px solid #d9e2ef;padding-left:18px;display:flex;flex-direction:column;line-height:1.15}
.portal-brand-copy strong{font-size:18px;letter-spacing:-.25px}.portal-brand-copy small{font-size:11px;color:#64748b;font-weight:700;margin-top:4px}
.portal-header-actions{margin-left:auto;display:flex;align-items:center;gap:10px}
.portal-profile-chip{height:48px;display:flex;align-items:center;gap:10px;border:1px solid #d8e2f0;border-radius:14px;padding:5px 12px 5px 6px;background:#fff;min-width:220px}
.portal-profile-chip>span:last-child{display:flex;flex-direction:column;min-width:0}.portal-profile-chip strong{font-size:13px}.portal-profile-chip small{font-size:9px;color:#64748b;max-width:180px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;text-transform:uppercase}
.portal-avatar{width:36px;height:36px;border-radius:50%;display:grid;place-items:center;background:linear-gradient(135deg,#1f62c8,#3984f3);color:#fff;font-weight:900;flex:0 0 auto}
.portal-header-btn{height:46px;display:inline-flex;align-items:center;padding:0 16px;border:1px solid #bfd0e9;border-radius:12px;background:#fff;color:#1457b8;font-size:13px;font-weight:850;white-space:nowrap}.portal-header-btn:hover{background:#f0f6ff}
.portal-header-btn-dark{border-color:#334155;background:#334155;color:#fff;box-shadow:0 8px 18px rgba(15,23,42,.15)}.portal-header-btn-dark:hover{background:#263449}
.portal-menu-toggle{display:none;width:42px;height:42px;border:1px solid #d8e2f0;border-radius:10px;background:#fff;color:#23405f;padding:10px}.portal-menu-toggle svg{width:100%;height:100%}
.portal-shell{max-width:1600px;margin:0 auto;display:grid;grid-template-columns:248px minmax(0,1fr);gap:24px;padding:22px}
.portal-sidebar{position:sticky;top:96px;align-self:start;background:#fff;border:1px solid #dbe4f0;border-radius:16px;padding:14px 12px;box-shadow:0 12px 34px rgba(31,56,93,.06);max-height:calc(100vh - 118px);overflow:auto}
.portal-sidebar-head{padding:3px 8px 10px;color:#8a9bb1;font-size:10px;font-weight:900;text-transform:uppercase;letter-spacing:.12em}.portal-sidebar-head button{display:none}
.portal-nav{display:flex;flex-direction:column;gap:5px}.portal-nav-link{min-height:44px;padding:0 11px;display:flex;align-items:center;gap:10px;border-radius:10px;color:#32445d;font-size:12px;font-weight:800}.portal-nav-link svg{width:18px;height:18px;flex:0 0 18px}.portal-nav-link b{margin-left:auto;min-width:22px;height:22px;border-radius:11px;display:grid;place-items:center;background:#edf2f8;color:#6d7f96;font-size:10px}.portal-nav-link:hover{background:#f3f7fc;color:#145dc5}.portal-nav-link.is-active{background:linear-gradient(135deg,#1454b8,#2b78e6);color:#fff;box-shadow:0 8px 18px rgba(29,104,214,.22)}.portal-nav-link.is-active b{background:rgba(255,255,255,.17);color:#fff}
.portal-sidebar-user{margin-top:16px;padding:14px 10px 4px;border-top:1px solid #e4ebf4;display:flex;flex-direction:column}.portal-sidebar-user small{font-size:10px;color:#71839a}.portal-sidebar-user strong{font-size:14px;margin:3px 0}.portal-sidebar-user span{font-size:9px;line-height:1.5;color:#64748b;text-transform:uppercase;overflow-wrap:anywhere}
.portal-main{min-width:0;padding-bottom:40px}.portal-page-heading{display:flex;justify-content:space-between;align-items:flex-end;padding:4px 2px 18px}.portal-eyebrow{font-size:10px;font-weight:900;text-transform:uppercase;letter-spacing:.13em;color:#1763ca}.portal-page-heading h1{font-size:28px;margin:4px 0 2px;letter-spacing:-.75px}.portal-page-heading p{margin:0;color:#6b7d94;font-size:12px}
.portal-section{scroll-margin-top:96px;background:#fff;border:1px solid #dbe4f0;border-radius:16px;padding:18px;margin-bottom:18px;box-shadow:0 10px 30px rgba(31,56,93,.045)}
.portal-section-heading{display:flex;justify-content:space-between;gap:16px;align-items:flex-start;margin-bottom:14px}.portal-section-heading h2{font-size:18px;margin:0 0 3px;letter-spacing:-.3px}.portal-section-heading p{margin:0;color:#6b7d94;font-size:11px}.portal-section-heading>span{font-size:10px;color:#71839a;background:#f2f6fb;border-radius:999px;padding:6px 10px;white-space:nowrap}
.portal-action-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:12px}
.portal-action-card{position:relative;min-height:126px;border:1px solid #d8e3f1;border-radius:13px;padding:14px 14px 13px;display:grid;grid-template-columns:42px minmax(0,1fr);grid-template-rows:1fr auto;column-gap:12px;background:#fff;color:#0f1b35;transition:transform .14s ease,border-color .14s ease,box-shadow .14s ease}.portal-action-card:hover{transform:translateY(-2px);border-color:#a9c4ea;box-shadow:0 12px 25px rgba(34,73,127,.09)}
.portal-action-icon{width:42px;height:42px;border-radius:12px;display:grid;place-items:center;grid-row:1}.portal-action-icon svg{width:20px;height:20px}.tone-blue{background:#eaf2ff;color:#176bd2}.tone-orange{background:#fff1e4;color:#ef7b17}.tone-green{background:#e9f8ef;color:#15915a}.tone-purple{background:#efecff;color:#6d5bd6}.tone-red{background:#ffedf1;color:#e34264}
.portal-action-copy{min-width:0;display:flex;flex-direction:column;padding-top:1px}.portal-action-copy strong{font-size:13px;line-height:1.25;margin-bottom:5px}.portal-action-copy small{font-size:10px;line-height:1.48;color:#65778e}
.portal-action-link{grid-column:2;align-self:end;font-size:10px;font-weight:900;color:#075fd0;margin-top:11px}.portal-action-link b{font-size:13px;margin-left:3px}
.portal-mobile-nav{display:none}.portal-sidebar-backdrop{display:none}
@media(max-width:1180px){.portal-action-grid{grid-template-columns:repeat(2,minmax(0,1fr))}.portal-brand{min-width:270px}.portal-brand img{width:125px}.portal-profile-chip{min-width:180px}}
@media(max-width:900px){.portal-header-inner{height:66px;padding:0 14px}.portal-brand{min-width:0;gap:10px}.portal-brand img{width:112px;height:44px}.portal-brand-copy{padding-left:10px}.portal-brand-copy strong{font-size:15px}.portal-brand-copy small{font-size:9px}.portal-menu-toggle{display:block;margin-left:auto}.portal-header-actions{margin-left:0}.portal-profile-chip{min-width:0;width:44px;padding:4px}.portal-profile-chip>span:last-child,.portal-header-btn{display:none}.portal-shell{display:block;padding:14px}.portal-sidebar{position:fixed;z-index:80;left:0;top:0;bottom:0;width:286px;max-height:none;border-radius:0;transform:translateX(-102%);transition:transform .2s ease;padding-top:18px}.portal-nav-open .portal-sidebar{transform:translateX(0)}.portal-sidebar-backdrop{position:fixed;z-index:70;inset:0;background:rgba(15,23,42,.42);backdrop-filter:blur(2px)}.portal-nav-open .portal-sidebar-backdrop{display:block}.portal-sidebar-head{display:flex;justify-content:space-between;align-items:center}.portal-sidebar-head button{display:grid;place-items:center;width:34px;height:34px;border:0;border-radius:9px;background:#eef3f9;color:#24364d;font-size:24px}.portal-page-heading{padding:5px 2px 14px}.portal-page-heading h1{font-size:24px}.portal-section{padding:14px}.portal-mobile-nav{position:fixed;z-index:60;left:0;right:0;bottom:0;height:68px;padding-bottom:env(safe-area-inset-bottom);display:flex;background:rgba(255,255,255,.97);border-top:1px solid #dce5f0;box-shadow:0 -8px 24px rgba(15,23,42,.08)}.portal-mobile-nav a,.portal-mobile-nav button{flex:1;border:0;background:transparent;color:#6b7d94;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:3px;font-size:8px;font-weight:800;min-width:0;padding:5px 2px}.portal-mobile-nav svg{width:20px;height:20px}.portal-mobile-nav a:first-child{color:#176bd2}.portal-main{padding-bottom:78px}.portal-dashboard-page{padding-bottom:68px}}
@media(max-width:620px){.portal-brand-copy{display:none}.portal-header-inner{gap:8px}.portal-action-grid{grid-template-columns:1fr}.portal-action-card{min-height:112px}.portal-section-heading p{display:none}.portal-page-heading h1{font-size:22px}.portal-shell{padding:10px}.portal-section{border-radius:14px;margin-bottom:12px}.portal-section-heading>span{font-size:9px}.portal-action-copy strong{font-size:12px}.portal-action-copy small{font-size:9.5px}}

/* Existing-data dashboard summary */
.portal-dashboard-heading{margin-bottom:14px}.portal-stat-grid{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:12px;margin-bottom:14px}.portal-stat-card{display:flex;align-items:center;gap:13px;min-height:86px;padding:15px 17px;border:1px solid #dbe4f1;border-radius:14px;background:#fff;color:#0f172a;text-decoration:none;box-shadow:0 5px 16px rgba(15,23,42,.045);transition:.18s}.portal-stat-card:hover{transform:translateY(-2px);box-shadow:0 10px 24px rgba(15,23,42,.08)}.portal-stat-icon{display:grid;place-items:center;width:43px;height:43px;border-radius:50%;background:#edf4ff;color:#2563eb;flex:0 0 43px}.portal-stat-icon svg{width:22px;height:22px}.portal-stat-card strong{display:block;font-size:24px;line-height:1}.portal-stat-card small{display:block;margin-top:7px;color:#475569;font-weight:700}.portal-stat-card.tone-green .portal-stat-icon{background:#e8f8ef;color:#059669}.portal-stat-card.tone-orange .portal-stat-icon{background:#fff2e4;color:#ea7a12}.portal-stat-card.tone-purple .portal-stat-icon{background:#f1eaff;color:#7c3aed}.portal-dashboard-columns{display:grid;grid-template-columns:minmax(0,1.65fr) minmax(300px,.85fr);gap:14px;align-items:start}.portal-task-panel,.portal-quick-panel,.portal-activity-panel{margin-bottom:14px}.portal-task-table-wrap{overflow:auto;border:1px solid #e2e8f0;border-radius:12px}.portal-task-table{width:100%;border-collapse:collapse;min-width:700px}.portal-task-table th,.portal-task-table td{padding:12px 13px;border-bottom:1px solid #e8edf5;text-align:left;font-size:12px}.portal-task-table th{background:#f8fafc;color:#475569;font-weight:800}.portal-task-table tr:last-child td{border-bottom:0}.portal-task-table td small{display:block;margin-top:3px;color:#64748b}.portal-status{display:inline-flex;padding:5px 8px;border-radius:999px;background:#edf4ff;color:#2563eb;font-weight:800;white-space:nowrap}.portal-status.status-returned_to_maker{background:#fff0e6;color:#d96700}.portal-status.status-submitted_to_approver,.portal-status.status-in_approver_review{background:#f1eaff;color:#7c3aed}.portal-status.status-approved{background:#e8f8ef;color:#078b4f}.portal-table-action{display:inline-flex;padding:7px 11px;border-radius:8px;background:#1262d6;color:#fff;text-decoration:none;font-weight:800}.portal-quick-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:9px}.portal-quick-card{display:flex;align-items:center;gap:10px;min-height:70px;padding:11px;border:1px solid #e2e8f0;border-radius:11px;background:#fff;text-decoration:none;color:#172033}.portal-quick-card:hover{border-color:#aac5ee;box-shadow:0 7px 18px rgba(15,23,42,.06)}.portal-quick-card .portal-action-icon{width:36px;height:36px;flex-basis:36px}.portal-quick-card strong{font-size:12px;line-height:1.35}.portal-activity-list{display:grid}.portal-activity-row{display:grid;grid-template-columns:34px 1fr auto;gap:10px;align-items:center;padding:10px 2px;border-bottom:1px solid #edf1f6}.portal-activity-row:last-child{border-bottom:0}.portal-activity-icon{display:grid;place-items:center;width:28px;height:28px;border-radius:50%;background:#edf4ff;color:#2563eb}.portal-activity-icon svg{width:15px;height:15px}.portal-activity-row strong{display:block;font-size:12px}.portal-activity-row small{display:block;color:#64748b;margin-top:2px}.portal-activity-row time{color:#64748b;font-size:11px;white-space:nowrap}.portal-empty-state{padding:26px;text-align:center;color:#64748b;border:1px dashed #cbd5e1;border-radius:12px;background:#f8fafc}
@media(max-width:1050px){.portal-stat-grid{grid-template-columns:repeat(2,minmax(0,1fr))}.portal-dashboard-columns{grid-template-columns:1fr}.portal-quick-grid{grid-template-columns:repeat(3,minmax(0,1fr))}}
@media(max-width:680px){.portal-stat-grid{grid-template-columns:repeat(2,minmax(0,1fr));gap:8px}.portal-stat-card{min-height:78px;padding:12px}.portal-stat-card strong{font-size:21px}.portal-stat-card small{font-size:11px}.portal-quick-grid{grid-template-columns:repeat(2,minmax(0,1fr))}.portal-activity-row{grid-template-columns:30px 1fr}.portal-activity-row time{grid-column:2}.portal-task-panel{padding-left:10px;padding-right:10px}}

/* Dashboard tabbed workspace — uses existing portal data and actions only. */
.portal-workspace{margin-bottom:18px;background:#fff;border:1px solid #dbe4f0;border-radius:17px;box-shadow:0 12px 32px rgba(31,56,93,.055);overflow:hidden}
.portal-workspace-tabs{display:flex;align-items:stretch;gap:4px;padding:8px 10px 0;background:linear-gradient(180deg,#f8fbff 0%,#fff 100%);border-bottom:1px solid #dfe7f2;overflow-x:auto;scrollbar-width:none}
.portal-workspace-tabs::-webkit-scrollbar{display:none}
.portal-workspace-tab{position:relative;min-width:170px;height:54px;padding:0 14px;border:0;border-radius:11px 11px 0 0;background:transparent;color:#64748b;display:flex;align-items:center;gap:9px;font:inherit;font-size:12px;font-weight:850;cursor:pointer;white-space:nowrap}
.portal-workspace-tab svg{width:18px;height:18px;flex:0 0 18px}
.portal-workspace-tab b{margin-left:auto;min-width:23px;height:23px;padding:0 6px;border-radius:12px;display:grid;place-items:center;background:#e9eff7;color:#64748b;font-size:10px}
.portal-workspace-tab:hover{background:#eef5ff;color:#145dc5}
.portal-workspace-tab.is-active{background:#fff;color:#075fc9;box-shadow:0 -1px 0 #dfe7f2,1px 0 0 #dfe7f2,-1px 0 0 #dfe7f2}
.portal-workspace-tab.is-active:after{content:"";position:absolute;left:14px;right:14px;bottom:-1px;height:3px;border-radius:3px 3px 0 0;background:linear-gradient(90deg,#1262d6,#4b91f1)}
.portal-workspace-tab.is-active b{background:#e8f1ff;color:#075fc9}
.portal-workspace-panel{padding:18px;animation:portalPanelIn .16s ease}
.portal-workspace-panel[hidden]{display:none!important}
@keyframes portalPanelIn{from{opacity:.35;transform:translateY(3px)}to{opacity:1;transform:none}}
.portal-workspace-heading{display:flex;align-items:flex-start;justify-content:space-between;gap:16px;margin-bottom:14px}
.portal-workspace-heading h2{margin:0 0 3px;font-size:18px;letter-spacing:-.3px}
.portal-workspace-heading p{margin:0;color:#6b7d94;font-size:11px}
.portal-workspace-heading>span{padding:6px 10px;border-radius:999px;background:#f2f6fb;color:#71839a;font-size:10px;white-space:nowrap}
.portal-quick-grid-wide{grid-template-columns:repeat(5,minmax(0,1fr));gap:10px}
.portal-quick-grid-wide .portal-quick-card{position:relative;min-height:94px;align-items:flex-start;padding:13px 34px 13px 12px}
.portal-quick-grid-wide .portal-quick-card>span:nth-child(2){min-width:0;padding-top:2px}
.portal-quick-grid-wide .portal-quick-card strong{display:block;font-size:12px;line-height:1.25}
.portal-quick-grid-wide .portal-quick-card small{display:block;margin-top:4px;color:#6b7d94;font-size:9px;line-height:1.4}
.portal-quick-grid-wide .portal-quick-card>b{position:absolute;right:12px;top:16px;color:#1262d6;font-size:14px}
.portal-quick-grid-wide .portal-quick-card:hover{transform:translateY(-2px);background:#fbfdff}
.portal-stat-card{position:relative;overflow:hidden}
.portal-stat-card:after{content:"";position:absolute;left:0;right:0;bottom:0;height:3px;background:#2a72dc;opacity:.9}
.portal-stat-card.tone-green:after{background:#18a46b}.portal-stat-card.tone-orange:after{background:#ef8a26}.portal-stat-card.tone-purple:after{background:#8458df}
.portal-task-table tbody tr{transition:background .14s ease}.portal-task-table tbody tr:hover{background:#f8fbff}
.portal-table-action{box-shadow:0 5px 12px rgba(18,98,214,.18)}
@media(max-width:1250px){.portal-quick-grid-wide{grid-template-columns:repeat(3,minmax(0,1fr))}}
@media(max-width:760px){.portal-workspace{border-radius:14px}.portal-workspace-tabs{padding-left:7px;padding-right:7px}.portal-workspace-tab{min-width:145px;height:50px;padding:0 10px;font-size:11px}.portal-workspace-panel{padding:12px}.portal-quick-grid-wide{grid-template-columns:repeat(2,minmax(0,1fr))}.portal-workspace-heading p{display:none}}
@media(max-width:430px){.portal-quick-grid-wide{grid-template-columns:1fr}.portal-quick-grid-wide .portal-quick-card{min-height:76px}.portal-workspace-tab{min-width:132px}}

/* =========================================================
   2026 INTERNAL PORTAL VISUAL REFRESH
   Presentation-only overrides. No workflow or PHP logic changed.
   ========================================================= */
:root{
  --bg:#f4f7fb;
  --card:#ffffff;
  --text:#0b1733;
  --muted:#66758d;
  --line:#dbe4ef;
  --blue:#0f63d8;
  --blue2:#1677ee;
  --blueSoft:#eef5ff;
  --navy:#061d3e;
  --navy2:#0a315f;
  --radius:12px;
  --shadow:0 8px 24px rgba(22,45,78,.07);
  --shadow2:0 4px 14px rgba(22,45,78,.08);
}
html{background:var(--bg)}
body.portal-internal-page{background:var(--bg);min-height:100vh;color:var(--text)}
body.portal-internal-page::before{
  content:"";position:fixed;inset:0 auto 0 0;width:6px;
  background:linear-gradient(180deg,var(--blue2),var(--navy));z-index:50;
}
body.portal-internal-page .topbar{
  min-height:76px;display:flex;justify-content:center;align-items:center;
  position:sticky;top:0;z-index:40;background:rgba(255,255,255,.96);
  border-bottom:1px solid var(--line);box-shadow:0 2px 14px rgba(22,45,78,.04);
  backdrop-filter:blur(12px);
}
body.portal-internal-page .topbar-inner,
body.portal-internal-page .topbar > div{
  width:100%;max-width:1440px;margin:0 auto;padding:12px 28px;
  display:flex;align-items:center;justify-content:space-between;gap:18px;
}
body.portal-internal-page .topbar > div:last-child{width:auto;max-width:none;padding:0;margin-left:auto;margin-right:28px}
body.portal-internal-page .topbar .topbar-inner{padding:12px 28px}
body.portal-internal-page .brand{gap:14px;min-width:0}
body.portal-internal-page .brand-badge{
  width:132px;height:48px;border-radius:0;background:url('portal-logo.png') center/contain no-repeat;
  box-shadow:none;flex:0 0 auto;
}
body.portal-internal-page .brand > div:last-child{padding-left:16px;border-left:1px solid var(--line)}
body.portal-internal-page .brand > div:last-child > div:first-child{font-size:16px;font-weight:850;color:var(--text);letter-spacing:-.2px}
body.portal-internal-page .brand .small{font-size:11px;margin-top:2px}
body.portal-internal-page .container{
  max-width:1440px;margin:26px auto 48px;padding:0 28px;
}
body.portal-internal-page .container > .card:first-child{position:relative}
body.portal-internal-page .card{
  border:1px solid var(--line);border-radius:var(--radius);box-shadow:var(--shadow);
  padding:22px;background:rgba(255,255,255,.99);
}
body.portal-internal-page .card .card{box-shadow:none;background:#fbfdff;border-color:#e2e9f2}
body.portal-internal-page .card-header{
  margin:-2px 0 18px;padding-bottom:16px;border-bottom:1px solid #e7edf4;
  align-items:center;
}
body.portal-internal-page h1{font-size:26px;line-height:1.2;margin:0 0 7px;color:var(--text);font-weight:850}
body.portal-internal-page h2{font-size:20px;color:var(--text);font-weight:820}
body.portal-internal-page h3{color:var(--text)}
body.portal-internal-page .small,body.portal-internal-page .muted{color:var(--muted)}
body.portal-internal-page .pills{gap:8px}
body.portal-internal-page .btn{
  min-height:38px;padding:9px 14px;border-radius:9px;font-size:13px;font-weight:800;
  background:var(--blue);box-shadow:0 5px 12px rgba(15,99,216,.18);
}
body.portal-internal-page .btn:hover{background:#0959c7;transform:translateY(-1px);box-shadow:0 8px 18px rgba(15,99,216,.21)}
body.portal-internal-page .btn.secondary{background:var(--navy);box-shadow:0 5px 12px rgba(6,29,62,.17)}
body.portal-internal-page .btn.ghost{background:#fff;color:#075dcc;border:1px solid #c7d7eb;box-shadow:none}
body.portal-internal-page .btn.ghost:hover{background:var(--blueSoft);border-color:#9dbce3}
body.portal-internal-page input,
body.portal-internal-page select,
body.portal-internal-page textarea,
body.portal-internal-page .form-control{
  border:1px solid #cad6e5;border-radius:9px;background:#fff;padding:10px 12px;
  min-height:40px;color:var(--text);box-shadow:0 1px 2px rgba(15,23,42,.02);
}
body.portal-internal-page textarea{min-height:112px}
/* Native choice controls must not inherit full-width text-input styling.
   This is especially important on Safari/iOS, where radios can otherwise
   expand into large blue controls and push their labels out of place. */
body.portal-internal-page input[type="radio"],
body.portal-internal-page input[type="checkbox"]{
  width:auto;min-height:0;height:auto;padding:0;box-shadow:none;
  flex:0 0 auto;
}
body.portal-internal-page input[type="radio"]{
  width:18px;height:18px;min-height:18px;margin:2px 0 0;
}
body.portal-internal-page input[type="checkbox"]{
  width:18px;height:18px;min-height:18px;
}
body.portal-internal-page input:focus,
body.portal-internal-page select:focus,
body.portal-internal-page textarea:focus,
body.portal-internal-page .form-control:focus{
  border-color:#5a96e8;box-shadow:0 0 0 3px rgba(15,99,216,.11);outline:none;
}
body.portal-internal-page label{font-size:12px;color:#34445c;font-weight:800;margin-top:12px}
body.portal-internal-page .table-wrap{overflow:auto;border:1px solid var(--line);border-radius:11px;background:#fff}
body.portal-internal-page .table{
  border-radius:11px;border-color:var(--line);background:#fff;box-shadow:none;
}
body.portal-internal-page .table th{
  position:sticky;top:0;z-index:1;padding:12px 14px;background:#f5f8fc;
  color:#263a57;font-size:11px;text-transform:uppercase;letter-spacing:.035em;
}
body.portal-internal-page .table td{padding:13px 14px;font-size:13px;color:#182640}
body.portal-internal-page .table tbody tr{transition:background .12s ease}
body.portal-internal-page .table tbody tr:hover{background:#f8fbff}
body.portal-internal-page .badge{
  padding:5px 9px;border-radius:999px;background:#f3f6fa;border-color:#d7e0eb;
  color:#3b4b63;font-size:11px;font-weight:750;
}
body.portal-internal-page .filter-card,
body.portal-internal-page .filter-grid,
body.portal-internal-page .toolbar,
body.portal-internal-page .meta-box,
body.portal-internal-page .info-box,
body.portal-internal-page .section-card,
body.portal-internal-page .review-section,
body.portal-internal-page .maker-box{
  border-color:#dfe7f0!important;border-radius:11px!important;background:#fbfdff!important;
}
body.portal-internal-page .section-title,
body.portal-internal-page .review-section-title,
body.portal-internal-page .section-head{color:#13233f;font-weight:850}
body.portal-internal-page hr.sep{border-color:#e5ebf3}
body.portal-internal-page details{border-color:var(--line)!important;border-radius:10px!important;background:#fff}
body.portal-internal-page summary{font-weight:800;color:#17345c}
body.portal-internal-page .alert,
body.portal-internal-page .notice,
body.portal-internal-page .message{border-radius:9px!important}
body.portal-internal-page .action-card{border-radius:11px;box-shadow:none;background:#fff}
body.portal-internal-page .action-card:hover{border-color:#b9cce4;box-shadow:var(--shadow2)}
body.portal-internal-page .inline-form{gap:10px}
body.portal-internal-page pre{background:#f7f9fc;border:1px solid var(--line);border-radius:9px;padding:14px}

@media (max-width:920px){
  body.portal-internal-page::before{display:none}
  body.portal-internal-page .topbar-inner,
  body.portal-internal-page .topbar > div{padding:10px 16px;flex-direction:row;align-items:center}
  body.portal-internal-page .topbar > div:last-child{margin-right:16px}
  body.portal-internal-page .brand-badge{width:96px;height:40px}
  body.portal-internal-page .brand > div:last-child{display:none}
  body.portal-internal-page .container{padding:0 14px;margin-top:16px}
  body.portal-internal-page .card{padding:16px}
  body.portal-internal-page .card-header{align-items:flex-start;flex-direction:column}
  body.portal-internal-page .pills{width:100%}
  body.portal-internal-page .pills .btn{flex:1}
}

/* ========================================================================
   INTERNAL PAGE SHELL v2
   Shared navigation, dual Back control, and edge-line correction.
   Visual only; workflow logic remains unchanged.
   ======================================================================== */
body.portal-internal-page::before{display:none!important;content:none!important}
body.portal-internal-page{padding-left:258px;box-sizing:border-box;transition:padding-left .22s ease;background:#f4f7fb}
body.portal-internal-page.portal-nav-collapsed{padding-left:76px}

.portal-side-nav{
  position:fixed;inset:0 auto 0 0;width:258px;z-index:80;display:flex;flex-direction:column;
  color:#dce9f8;background:linear-gradient(180deg,#071f43 0%,#0b3769 100%);
  border-right:1px solid rgba(255,255,255,.08);box-shadow:8px 0 28px rgba(6,29,62,.10);
  transition:width .22s ease,transform .22s ease;overflow:hidden;
}
.portal-side-nav-head{height:76px;display:flex;align-items:center;justify-content:space-between;padding:0 16px 0 22px;border-bottom:1px solid rgba(255,255,255,.10);flex:0 0 auto}
.portal-side-nav-title{font-size:12px;font-weight:850;letter-spacing:.08em;text-transform:uppercase;color:#9eb8d5;white-space:nowrap}
.portal-side-toggle,.portal-mobile-nav-button{appearance:none;border:0;cursor:pointer;display:grid;place-items:center}
.portal-side-toggle{width:36px;height:36px;border-radius:9px;color:#fff;background:rgba(255,255,255,.10)}
.portal-side-toggle:hover{background:rgba(255,255,255,.18)}
.portal-side-toggle svg,.portal-mobile-nav-button svg,.portal-back-left svg,.portal-nav-icon svg{width:20px;height:20px}
.portal-side-nav-scroll{padding:14px 10px 20px;overflow-y:auto;overflow-x:hidden;flex:1;scrollbar-width:thin;scrollbar-color:rgba(255,255,255,.25) transparent}
.portal-nav-group{margin:0 0 6px;border:0!important;background:transparent!important;border-radius:0!important}
.portal-nav-group>summary{list-style:none}.portal-nav-group>summary::-webkit-details-marker{display:none}
.portal-nav-group-title{min-height:44px;padding:10px 11px;display:flex;align-items:center;gap:11px;border-radius:9px;color:#dce9f8;cursor:pointer;font-size:13px;font-weight:750;transition:background .15s ease,color .15s ease}
.portal-nav-group-title:hover,.portal-nav-group-title.active{background:rgba(22,119,238,.72);color:#fff}
.portal-nav-direct{margin:0 0 6px;text-decoration:none!important}
.portal-nav-icon{display:grid;place-items:center;flex:0 0 22px}.portal-nav-icon svg{width:19px;height:19px}
.portal-nav-label{white-space:nowrap;overflow:hidden;text-overflow:ellipsis;flex:1}
.portal-nav-chevron{font-size:20px;line-height:1;transition:transform .15s ease}.portal-nav-group[open] .portal-nav-chevron{transform:rotate(90deg)}
.portal-nav-items{padding:4px 0 5px 43px;display:grid;gap:2px}
.portal-nav-link{display:block;padding:8px 10px;border-radius:7px;color:#bdd0e6!important;text-decoration:none!important;font-size:12px;font-weight:650;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.portal-nav-link:hover,.portal-nav-link.active{color:#fff!important;background:rgba(255,255,255,.10)}
.portal-side-user{padding:16px 20px 18px;border-top:1px solid rgba(255,255,255,.10);display:flex;flex-direction:column;gap:4px;min-height:86px}
.portal-side-user-label{text-transform:uppercase;font-size:9px;letter-spacing:.08em;color:#8eabc9}.portal-side-user strong{font-size:14px;color:#fff}.portal-side-user small{font-size:9px;line-height:1.4;color:#afc4db;text-transform:uppercase}

body.portal-nav-collapsed .portal-side-nav{width:76px}
body.portal-nav-collapsed .portal-side-nav-head{padding:0 20px;justify-content:center}
body.portal-nav-collapsed .portal-side-nav-title,body.portal-nav-collapsed .portal-nav-label,body.portal-nav-collapsed .portal-nav-chevron,body.portal-nav-collapsed .portal-nav-items,body.portal-nav-collapsed .portal-side-user{display:none}
body.portal-nav-collapsed .portal-nav-group-title{justify-content:center;padding:10px}
body.portal-nav-collapsed .portal-nav-group-title:hover::after{content:attr(aria-label);position:fixed;left:70px;background:#071f43;color:#fff;padding:7px 10px;border-radius:7px;font-size:11px;z-index:100}

.portal-back-left{position:fixed;left:278px;top:92px;z-index:35;display:inline-flex;align-items:center;gap:7px;min-height:36px;padding:8px 12px;border-radius:9px;background:#fff;color:#075dcc!important;border:1px solid #c7d7eb;text-decoration:none!important;font-size:12px;font-weight:800;box-shadow:0 4px 12px rgba(22,45,78,.06);transition:left .22s ease,background .15s ease}
.portal-back-left:hover{background:#eef5ff}.portal-back-left svg{width:17px;height:17px}
body.portal-nav-collapsed .portal-back-left{left:96px}
body.portal-internal-page .container{margin-top:24px}

/* Keep the existing header Back button on the right, while ensuring consistency. */
body.portal-internal-page .topbar .btn[href*="dashboard.php"],
body.portal-internal-page .topbar .btn[href*="_queue.php"],
body.portal-internal-page .topbar .btn[href*="_list.php"]{display:inline-flex;align-items:center;justify-content:center}

.portal-mobile-nav-button{display:none;position:fixed;left:14px;top:88px;width:42px;height:42px;border-radius:10px;background:#0f63d8;color:#fff;box-shadow:0 8px 18px rgba(15,99,216,.25);z-index:91}

@media(max-width:980px){
  body.portal-internal-page,body.portal-internal-page.portal-nav-collapsed{padding-left:0}
  .portal-side-nav{transform:translateX(-100%);width:270px}
  body.portal-nav-mobile-open .portal-side-nav{transform:translateX(0)}
  .portal-mobile-nav-button{display:grid}
  body.portal-internal-page .container{margin-top:24px}
  body.portal-nav-mobile-open::after{content:"";position:fixed;inset:0;background:rgba(6,29,62,.36);z-index:70}
}
@media(max-width:560px){
  .portal-back-left span{display:none}.portal-back-left{width:42px;padding:0;justify-content:center}
}


/* Portal navigation consistency update — layout only */
.portal-side-nav-title{color:#fff!important;font-weight:900!important}
.portal-nav-group-title{color:#fff!important;font-weight:850!important;opacity:1!important}
.portal-nav-group-title .portal-nav-icon{color:#fff!important;opacity:1!important}
.portal-nav-link{color:#fff!important;font-weight:800!important;opacity:.92!important}
.portal-nav-link:hover,.portal-nav-link.active{color:#fff!important;opacity:1!important;background:rgba(22,119,238,.78)!important}
.portal-nav-chevron{color:#fff!important}

/* Dashboard now uses the same collapsible blue navigation as every internal page. */
body.portal-dashboard-page.portal-internal-page{padding-left:258px;padding-bottom:0}
body.portal-dashboard-page.portal-internal-page.portal-nav-collapsed{padding-left:76px}
body.portal-dashboard-page .portal-shell.portal-dashboard-shell{display:block;max-width:1440px;margin:0 auto;padding:24px 28px 40px}
body.portal-dashboard-page .portal-main{width:100%;min-width:0;padding:0}
body.portal-dashboard-page .portal-menu-toggle,
body.portal-dashboard-page .portal-sidebar-backdrop,
body.portal-dashboard-page .portal-sidebar,
body.portal-dashboard-page .portal-mobile-nav,
body.portal-dashboard-page .portal-back-left{display:none!important}
body.portal-dashboard-page .portal-header{left:0}

@media(max-width:980px){
  body.portal-dashboard-page.portal-internal-page,
  body.portal-dashboard-page.portal-internal-page.portal-nav-collapsed{padding-left:0}
  body.portal-dashboard-page .portal-shell.portal-dashboard-shell{padding:76px 14px 30px}
  body.portal-dashboard-page .portal-mobile-nav-button{display:grid}
}

/* ========================================================================
   LOGIN PAGE REDESIGN
   Presentation only. Authentication and redirect logic are unchanged.
   ======================================================================== */
body.portal-login-page{
  min-height:100vh;
  margin:0;
  overflow-x:hidden;
  background:#f3f7fc;
  color:#10213d;
}
body.portal-login-page::before{
  content:"";
  position:fixed;
  inset:0;
  pointer-events:none;
  background:
    radial-gradient(circle at 84% 12%,rgba(43,111,227,.12),transparent 25%),
    radial-gradient(circle at 70% 88%,rgba(31,95,191,.07),transparent 28%);
}
.login-shell{
  position:relative;
  min-height:100vh;
  display:grid;
  grid-template-columns:minmax(420px,46%) minmax(520px,54%);
}
.login-brand-panel{
  position:relative;
  min-height:100vh;
  display:flex;
  flex-direction:column;
  justify-content:space-between;
  padding:54px clamp(42px,6vw,92px) 36px;
  overflow:hidden;
  color:#fff;
  background:linear-gradient(145deg,#061b3b 0%,#0a3568 56%,#0f5db6 100%);
}
.login-brand-panel::before,
.login-brand-panel::after{
  content:"";
  position:absolute;
  border-radius:50%;
  border:1px solid rgba(255,255,255,.10);
  pointer-events:none;
}
.login-brand-panel::before{width:520px;height:520px;right:-230px;top:-165px;box-shadow:0 0 0 70px rgba(255,255,255,.025),0 0 0 140px rgba(255,255,255,.018)}
.login-brand-panel::after{width:320px;height:320px;left:-190px;bottom:-110px;box-shadow:0 0 0 64px rgba(255,255,255,.025)}
.login-brand-content,.login-brand-footer{position:relative;z-index:1}
.login-logo{display:block;width:190px;height:auto;filter:brightness(0) invert(1);opacity:.98;margin-bottom:72px}
.login-brand-kicker{font-size:12px;font-weight:850;letter-spacing:.17em;color:#9fc8fa;margin-bottom:12px}
.login-brand-content h1{margin:0 0 18px;font-size:clamp(42px,5vw,68px);line-height:1;letter-spacing:-.055em;color:#fff}
.login-brand-content>p{max-width:570px;margin:0;color:#d8e7f9;font-size:17px;line-height:1.7}
.login-feature-list{display:grid;gap:18px;margin-top:52px;max-width:560px}
.login-feature-item{display:flex;align-items:center;gap:15px;padding:15px 17px;border:1px solid rgba(255,255,255,.11);border-radius:14px;background:rgba(255,255,255,.065);backdrop-filter:blur(8px)}
.login-feature-icon{width:42px;height:42px;display:grid;place-items:center;flex:0 0 42px;border-radius:12px;color:#fff;background:rgba(72,151,245,.28)}
.login-feature-icon svg{width:23px;height:23px}
.login-feature-item span:last-child{display:flex;flex-direction:column;gap:3px}
.login-feature-item strong{font-size:14px;color:#fff}
.login-feature-item small{font-size:12px;line-height:1.4;color:#bcd0e8}
.login-brand-footer{text-transform:uppercase;font-size:10px;font-weight:750;letter-spacing:.12em;color:#91acca}
.login-form-panel{position:relative;display:flex;align-items:center;justify-content:center;padding:48px clamp(28px,6vw,96px)}
.login-form-wrap{width:100%;max-width:510px;padding:48px 46px;border:1px solid #dce6f2;border-radius:22px;background:rgba(255,255,255,.94);box-shadow:0 28px 75px rgba(21,50,91,.13);backdrop-filter:blur(10px)}
.login-mobile-logo{display:none}
.login-heading{margin-bottom:30px}
.login-eyebrow{display:block;margin-bottom:11px;font-size:11px;font-weight:900;letter-spacing:.13em;color:#1769d1}
.login-heading h2{margin:0 0 9px;font-size:34px;line-height:1.12;letter-spacing:-.04em;color:#0e1d36}
.login-heading p{margin:0;font-size:14px;color:#63748b}
.login-error{display:flex;align-items:center;gap:10px;margin:0 0 20px;padding:12px 14px;border:1px solid #fecaca;border-radius:11px;background:#fff4f4;color:#b42318;font-size:13px;font-weight:750}
.login-error svg{width:20px;height:20px;flex:0 0 20px}
.login-form{display:grid;gap:20px}
.login-field label{margin:0 0 8px;font-size:13px;font-weight:800;color:#1d2d47}
.login-input-wrap{position:relative}
.login-input-wrap>svg{position:absolute;left:14px;top:50%;width:20px;height:20px;transform:translateY(-50%);color:#7c8da5;pointer-events:none}
body.portal-login-page .login-input-wrap input{height:52px;padding:0 46px 0 45px;border:1px solid #cfdbea;border-radius:11px;background:#fff;font-size:14px;color:#10213d;box-shadow:0 1px 2px rgba(15,23,42,.02)}
body.portal-login-page .login-input-wrap input::placeholder{color:#9aa8b9}
body.portal-login-page .login-input-wrap input:focus{border-color:#2877dd;box-shadow:0 0 0 4px rgba(40,119,221,.12)}
.login-password-toggle{position:absolute;right:8px;top:50%;width:38px;height:38px;transform:translateY(-50%);display:grid;place-items:center;border:0;border-radius:8px;background:transparent;color:#74859b;cursor:pointer}
.login-password-toggle:hover{background:#eef4fb;color:#1769d1}
.login-password-toggle svg{width:20px;height:20px}
.login-submit{width:100%;height:52px;margin-top:3px;display:flex;align-items:center;justify-content:center;gap:11px;border:0;border-radius:11px;background:linear-gradient(135deg,#1264d6 0%,#2380ed 100%);color:#fff;font-size:14px;font-weight:850;cursor:pointer;box-shadow:0 12px 24px rgba(18,100,214,.23);transition:transform .12s ease,box-shadow .12s ease}
.login-submit svg{width:20px;height:20px;transition:transform .12s ease}
.login-submit:hover{transform:translateY(-1px);box-shadow:0 16px 28px rgba(18,100,214,.29)}
.login-submit:hover svg{transform:translateX(3px)}
.login-submit:active{transform:translateY(0)}
.login-help{display:flex;align-items:flex-start;gap:9px;margin-top:22px;padding:12px 13px;border-radius:10px;background:#f1f6fc;color:#53667f;font-size:12px;line-height:1.5}
.login-help svg{width:18px;height:18px;flex:0 0 18px;margin-top:1px;color:#1769d1}
.login-help strong{color:#17345c}
.login-security-note{margin:20px 0 0;text-align:center;font-size:10px;line-height:1.5;color:#91a0b2}
@media(max-width:980px){
  .login-shell{grid-template-columns:1fr}
  .login-brand-panel{display:none}
  .login-form-panel{min-height:100vh;padding:32px 20px}
  .login-form-wrap{max-width:480px;padding:38px 32px}
  .login-mobile-logo{display:block;margin-bottom:34px}
  .login-mobile-logo img{display:block;width:175px;height:auto}
}
@media(max-width:520px){
  .login-form-panel{padding:18px 14px}
  .login-form-wrap{padding:30px 22px;border-radius:17px}
  .login-heading h2{font-size:29px}
  .login-mobile-logo img{width:150px}
}

/* Login branding simplification — visual-only update */
.login-brand-panel{
  justify-content:center;
}
.login-brand-content{
  width:100%;
  max-width:620px;
}
.login-logo,
.login-feature-list,
.login-brand-footer{
  display:none !important;
}
.login-hero-logo{
  display:flex;
  align-items:center;
  justify-content:center;
  min-height:250px;
  margin-top:58px;
  padding:34px 24px;
  border:1px solid rgba(255,255,255,.10);
  border-radius:28px;
  background:rgba(255,255,255,.035);
  backdrop-filter:blur(6px);
}
.login-hero-logo img{
  display:block;
  width:min(390px,88%);
  height:auto;
  filter:brightness(0) invert(1);
  opacity:1;
}
@media(max-width:980px){
  .login-hero-logo{display:none}
}

/* ========================================================================
   LOGIN MOBILE RESPONSIVE REFINEMENT
   Presentation-only: desktop layout and authentication remain unchanged.
   ======================================================================== */
@media (max-width:980px){
  body.portal-login-page{
    min-height:100svh;
    background:#f3f7fc;
  }
  body.portal-login-page::before{
    background:
      radial-gradient(circle at 88% 4%,rgba(43,111,227,.12),transparent 30%),
      radial-gradient(circle at 12% 96%,rgba(31,95,191,.06),transparent 34%);
  }
  .login-shell{
    min-height:100svh;
    display:block;
  }
  .login-form-panel{
    min-height:100svh;
    align-items:flex-start;
    justify-content:center;
    padding:clamp(24px,7vh,64px) 18px 28px;
  }
  .login-form-wrap{
    width:100%;
    max-width:480px;
    margin:0 auto;
    padding:34px 30px 30px;
    border-radius:20px;
    box-shadow:0 20px 55px rgba(21,50,91,.13);
  }
  .login-mobile-logo{
    display:flex;
    justify-content:center;
    margin:0 0 24px;
  }
  .login-mobile-logo img{
    width:190px;
    max-width:58vw;
  }
  .login-heading{
    margin-bottom:24px;
  }
}

@media (max-width:520px){
  .login-form-panel{
    padding:24px 14px 22px;
  }
  .login-form-wrap{
    max-width:none;
    padding:28px 20px 24px;
    border-radius:18px;
  }
  .login-mobile-logo{
    margin-bottom:20px;
  }
  .login-mobile-logo img{
    width:170px;
    max-width:62vw;
  }
  .login-heading{
    margin-bottom:22px;
  }
  .login-heading h2{
    font-size:30px;
  }
  .login-heading p{
    font-size:13px;
  }
  .login-form{
    gap:17px;
  }
  body.portal-login-page .login-input-wrap input,
  .login-submit{
    height:50px;
  }
  .login-help{
    margin-top:18px;
  }
  .login-security-note{
    margin-top:16px;
  }
}

@media (max-width:380px){
  .login-form-panel{
    padding:16px 10px 18px;
  }
  .login-form-wrap{
    padding:23px 16px 20px;
  }
  .login-mobile-logo img{
    width:150px;
  }
  .login-heading h2{
    font-size:27px;
  }
}

@media (max-width:980px) and (max-height:650px){
  .login-form-panel{
    padding-top:16px;
    padding-bottom:16px;
  }
  .login-form-wrap{
    padding-top:22px;
    padding-bottom:20px;
  }
  .login-mobile-logo{
    margin-bottom:14px;
  }
  .login-mobile-logo img{
    width:145px;
  }
  .login-heading{
    margin-bottom:17px;
  }
  .login-heading h2{
    font-size:27px;
  }
  .login-form{
    gap:14px;
  }
  .login-help{
    margin-top:14px;
  }
  .login-security-note{
    margin-top:12px;
  }
}

/* ========================================================================
   LOGIN MOBILE SIZE ENHANCEMENT
   Makes the phone sign-in experience larger without affecting desktop.
   ======================================================================== */
@media (max-width:520px){
  .login-form-panel{
    padding:28px 12px 28px;
  }
  .login-form-wrap{
    width:100%;
    max-width:430px;
    padding:36px 25px 32px;
    border-radius:20px;
  }
  .login-mobile-logo{
    margin-bottom:25px;
  }
  .login-mobile-logo img{
    width:195px;
    max-width:70vw;
  }
  .login-eyebrow{
    margin-bottom:12px;
    font-size:12px;
  }
  .login-heading{
    margin-bottom:27px;
  }
  .login-heading h2{
    margin-bottom:10px;
    font-size:33px;
  }
  .login-heading p{
    font-size:14px;
    line-height:1.55;
  }
  .login-form{
    gap:20px;
  }
  .login-field label{
    margin-bottom:9px;
    font-size:14px;
  }
  body.portal-login-page .login-input-wrap input,
  .login-submit{
    height:56px;
  }
  body.portal-login-page .login-input-wrap input{
    font-size:15px;
  }
  .login-submit{
    font-size:15px;
  }
  .login-help{
    margin-top:22px;
    padding:14px;
    font-size:12.5px;
  }
  .login-security-note{
    margin-top:19px;
    font-size:10.5px;
  }
}

@media (max-width:380px){
  .login-form-panel{
    padding:20px 10px;
  }
  .login-form-wrap{
    padding:30px 20px 27px;
  }
  .login-mobile-logo img{
    width:178px;
  }
  .login-heading h2{
    font-size:30px;
  }
}


/* ========================================================================
   MOBILE USABILITY + FREE-TYPING COMMENTS
   ======================================================================== */
/* Review comments must follow the casing entered from the keyboard. */
.comment-textarea,
.review-textarea,
textarea[name="checker_comment"],
textarea[name="approver_comment"]{
  text-transform:none !important;
}

@media (max-width: 700px){
  html, body{max-width:100%;overflow-x:hidden;}
  body.portal-internal-page::before{width:3px;}
  body.portal-internal-page .container{
    width:100%;
    max-width:100%;
    margin:14px auto 28px;
    padding:0 10px;
  }
  body.portal-internal-page .card{
    width:100%;
    max-width:100%;
    padding:14px;
    border-radius:10px;
    overflow:hidden;
  }
  body.portal-internal-page .topbar-inner,
  body.portal-internal-page .topbar > div{
    max-width:100%;
    padding:10px 12px;
  }
  body.portal-internal-page .topbar .topbar-inner{padding:10px 12px;}
  body.portal-internal-page .topbar > div:last-child{
    margin-right:12px;
  }
  body.portal-internal-page .card-header,
  body.portal-internal-page .processing-heading{
    align-items:flex-start;
    flex-direction:column;
    gap:10px;
  }
  body.portal-internal-page h1{font-size:22px;}
  body.portal-internal-page h2{font-size:18px;}
  body.portal-internal-page .pills{width:100%;flex-wrap:wrap;}
  body.portal-internal-page .pills .btn{flex:1 1 auto;text-align:center;}
  body.portal-internal-page input,
  body.portal-internal-page select,
  body.portal-internal-page textarea,
  body.portal-internal-page .form-control{
    max-width:100%;
    box-sizing:border-box;
    font-size:16px; /* prevents iOS form zoom */
  }

  /* RMA search results become readable cards instead of a wide table. */
  .rma-results-table,
  .rma-results-table tbody,
  .rma-results-table tr,
  .rma-results-table td{
    display:block;
    width:100%;
  }
  .rma-results-table thead{display:none;}
  .rma-results-table tr{
    margin:0 0 12px;
    padding:12px;
    border:1px solid #dbe4ef;
    border-radius:10px;
    background:#fff;
    box-shadow:0 3px 10px rgba(22,45,78,.05);
  }
  .rma-results-table td{
    position:relative;
    min-height:34px;
    padding:8px 8px 8px 42% !important;
    border:0 !important;
    border-bottom:1px solid #edf2f7 !important;
    text-align:left !important;
    overflow-wrap:anywhere;
  }
  .rma-results-table td:last-child{border-bottom:0 !important;}
  .rma-results-table td::before{
    position:absolute;
    left:8px;
    top:8px;
    width:36%;
    color:#64748b;
    font-size:11px;
    font-weight:800;
    text-transform:uppercase;
  }
  .rma-results-table td:nth-child(1)::before{content:"BIC";}
  .rma-results-table td:nth-child(2)::before{content:"Bank Name";}
  .rma-results-table td:nth-child(3)::before{content:"Country";}
  .rma-results-table td:nth-child(4)::before{content:"RMA List";}
  .rma-results-table td:nth-child(5)::before{content:"Uploaded";}
  .rma-results-table td:nth-child(6)::before{content:"Action";}
  .rma-results-table .action-group{justify-content:flex-start;}

  /* Processing boards become stacked records on phones. */
  .processing-table-wrap{overflow:visible;}
  .processing-table,
  .processing-table tbody,
  .processing-table tr,
  .processing-table td{
    display:block;
    width:100%;
    min-width:0;
  }
  .processing-table thead{display:none;}
  .processing-table tr{
    margin:0 0 14px;
    border:1px solid #cbd7ea;
    border-radius:10px;
    overflow:hidden;
    background:#fff;
    box-shadow:0 3px 10px rgba(22,45,78,.05);
  }
  .processing-table td{
    position:relative;
    height:auto;
    min-height:46px;
    padding:8px 8px 8px 38% !important;
    border:0 !important;
    border-bottom:1px solid #e5edf6 !important;
    text-align:left !important;
    overflow:visible;
  }
  .processing-table td:last-child{border-bottom:0 !important;}
  .processing-table td.row-marker{display:none;}
  .processing-table td::before{
    position:absolute;
    left:10px;
    top:14px;
    width:32%;
    color:#64748b;
    font-size:10px;
    font-weight:850;
    text-transform:uppercase;
    line-height:1.25;
  }
  .processing-table td:nth-child(2)::before{content:"File Name";}
  .processing-table td:nth-child(3)::before{content:"Status";}
  .processing-table td:nth-child(4)::before{content:"Date";}
  .processing-table td:nth-child(5)::before{content:"Pending With";}
  .processing-table td:nth-child(6)::before{content:"Comments";}
  .processing-table td:nth-child(7)::before{content:"Actions";}
  .processing-table input,
  .processing-table select,
  .processing-table textarea{
    height:auto;
    min-height:38px;
    padding:8px;
    border:1px solid #d7e0eb;
    border-radius:7px;
    text-align:left;
    background:#fff;
  }
  .processing-table textarea{min-height:72px;resize:vertical;}
  .processing-table .status-cell,
  .processing-table .status-cell select,
  .processing-table .status-cell span{
    min-height:42px;
  }
  .processing-table .status-cell span{
    justify-content:flex-start;
    padding:8px 10px;
  }
  .processing-table .board-actions{
    justify-content:flex-start;
    flex-wrap:wrap;
    gap:7px;
  }
  .processing-table .board-icon-btn{min-width:42px;height:36px;}
}

/* ========================================================================
   REFINED PHONE LAYOUT TUNING
   ======================================================================== */
@media (max-width: 700px){
  body.portal-internal-page .topbar{
    display:block;
  }
  body.portal-internal-page .topbar-inner{
    align-items:stretch;
    gap:10px;
  }
  body.portal-internal-page .brand,
  body.portal-internal-page .pills{
    width:100%;
  }
  body.portal-internal-page .brand > div:last-child{
    min-width:0;
  }
  body.portal-internal-page .brand > div:last-child > div:first-child{
    font-size:15px;
    font-weight:800;
  }
  body.portal-internal-page .brand > div:last-child > div.small{
    font-size:11px;
    line-height:1.35;
  }
  body.portal-internal-page .pills{
    gap:8px;
    align-items:stretch;
  }
  body.portal-internal-page .user-chip{
    width:100%;
    padding:8px 10px;
    border:1px solid #dbe4ef;
    border-radius:10px;
    background:#f8fafc;
    font-size:12px;
    line-height:1.35;
    overflow-wrap:anywhere;
  }
  body.portal-internal-page .pills .btn{
    flex:1 1 0;
    min-height:38px;
    padding:9px 10px;
    font-size:14px;
    border-radius:10px;
  }
  body.portal-internal-page .processing-card,
  body.portal-internal-page .card{
    padding:12px;
    border-radius:12px;
  }
  body.portal-internal-page .processing-heading h1,
  body.portal-internal-page .card-header h1,
  body.portal-internal-page h1{
    font-size:20px;
    line-height:1.15;
  }
  body.portal-internal-page .small{
    font-size:12px;
    line-height:1.45;
  }
  body.portal-internal-page .board-access{
    padding:6px 10px;
    font-size:11px;
  }
  body.portal-internal-page .new-issuance-panel summary{
    padding:10px 12px;
    font-size:14px;
  }
  body.portal-internal-page .board-group-title{
    font-size:13px;
    padding:0 4px 9px;
  }
  body.portal-internal-page .board-form{
    gap:10px;
    padding:0 12px 12px;
  }
  body.portal-internal-page .board-form label{
    font-size:11px;
  }

  /* RMA table cards: place labels above values to avoid cramped side-by-side layouts. */
  .rma-results-table tr{
    padding:10px;
    margin:0 0 10px;
    border-radius:12px;
  }
  .rma-results-table td{
    min-height:0;
    padding:24px 0 8px !important;
  }
  .rma-results-table td::before{
    position:static;
    display:block;
    width:auto;
    margin:0 0 4px;
    font-size:10px;
    line-height:1.2;
  }
  .rma-results-table .badge{
    font-size:11px;
    padding:5px 8px;
  }

  /* Processing board cards: compact stacked fields with labels above content. */
  .processing-table tr{
    margin:0 0 10px;
    border-radius:12px;
    box-shadow:0 2px 8px rgba(22,45,78,.05);
  }
  .processing-table td{
    min-height:0;
    padding:26px 10px 10px !important;
  }
  .processing-table td::before{
    top:8px;
    left:10px;
    width:auto;
    font-size:10px;
    line-height:1.15;
  }
  .processing-table td.row-marker::before,
  .processing-table td.board-empty::before{
    content:none !important;
  }
  .processing-table input,
  .processing-table select,
  .processing-table textarea{
    min-height:36px;
    padding:7px 9px;
    font-size:14px;
    line-height:1.35;
  }
  .processing-table textarea{
    min-height:64px;
  }
  .processing-table .issuance-view,
  .processing-table .comments-view,
  .processing-table td > span,
  .processing-table td{
    font-size:13px;
    line-height:1.35;
  }
  .processing-table .status-cell span{
    padding:7px 9px;
  }
  .processing-table .board-actions{
    padding-top:28px !important;
    gap:6px;
    align-items:center;
  }
  .processing-table .board-actions form:first-child{
    flex:1 1 100%;
  }
  .processing-table .board-actions form:first-child .board-icon-btn.save{
    width:100%;
  }
  .processing-table .board-icon-btn{
    min-width:38px;
    height:34px;
    padding:0 10px;
    font-size:13px;
    border-radius:8px;
  }
  .processing-table .board-empty{
    padding:16px !important;
  }
}

/* ========================================================================
   PROCESSING BOARD — COMPACT MOBILE CARD LAYOUT
   ======================================================================== */
@media (max-width: 700px){
  body.portal-internal-page .processing-container{
    padding:0 8px !important;
    margin-top:10px !important;
  }
  body.portal-internal-page .processing-card{
    padding:10px !important;
    overflow:visible !important;
  }
  body.portal-internal-page .processing-heading{
    margin-bottom:12px !important;
  }
  body.portal-internal-page .processing-heading h1{
    margin-bottom:3px !important;
  }
  body.portal-internal-page .new-issuance-panel{
    margin-bottom:14px !important;
  }
  body.portal-internal-page .board-group-title{
    margin:4px 0 8px !important;
  }

  .processing-table-wrap{
    width:100% !important;
    overflow:visible !important;
  }
  .processing-table{
    display:block !important;
    width:100% !important;
    min-width:0 !important;
    border:0 !important;
    background:transparent !important;
  }
  .processing-table tbody{
    display:block !important;
    width:100% !important;
  }
  .processing-table thead{
    display:none !important;
  }
  .processing-table tr{
    display:grid !important;
    grid-template-columns:minmax(0,1fr) minmax(0,1fr) !important;
    gap:0 !important;
    width:100% !important;
    margin:0 0 12px !important;
    padding:0 !important;
    border:1px solid #d7e1ec !important;
    border-radius:13px !important;
    overflow:hidden !important;
    background:#fff !important;
    box-shadow:0 3px 12px rgba(15,23,42,.06) !important;
  }
  .processing-table td{
    display:block !important;
    width:auto !important;
    min-width:0 !important;
    min-height:0 !important;
    height:auto !important;
    padding:9px 10px !important;
    border:0 !important;
    border-bottom:1px solid #e7edf4 !important;
    background:#fff !important;
    overflow:visible !important;
    text-align:left !important;
  }
  .processing-table td::before{
    position:static !important;
    display:block !important;
    width:auto !important;
    margin:0 0 3px !important;
    color:#738196 !important;
    font-size:9px !important;
    line-height:1.1 !important;
    font-weight:800 !important;
    letter-spacing:.04em !important;
  }
  .processing-table td.row-marker{
    display:none !important;
  }

  /* File and status use full width. */
  .processing-table td:nth-child(2),
  .processing-table td:nth-child(3){
    grid-column:1 / -1 !important;
  }

  /* Date and pending-with share one compact row. */
  .processing-table td:nth-child(4){
    grid-column:1 !important;
    border-right:1px solid #e7edf4 !important;
  }
  .processing-table td:nth-child(5){
    grid-column:2 !important;
  }

  /* Comments and actions use full width. */
  .processing-table td:nth-child(6),
  .processing-table td:nth-child(7){
    grid-column:1 / -1 !important;
  }
  .processing-table td:last-child{
    border-bottom:0 !important;
  }

  .processing-table input,
  .processing-table select,
  .processing-table textarea{
    display:block !important;
    width:100% !important;
    min-width:0 !important;
    height:34px !important;
    min-height:34px !important;
    margin:0 !important;
    padding:6px 8px !important;
    border:1px solid #d5deea !important;
    border-radius:8px !important;
    background:#fdfefe !important;
    color:#172033 !important;
    font-size:14px !important;
    font-weight:500 !important;
    line-height:1.25 !important;
    text-align:left !important;
    box-shadow:none !important;
  }
  .processing-table select{
    padding-right:28px !important;
    font-weight:700 !important;
  }
  .processing-table textarea{
    height:54px !important;
    min-height:54px !important;
    max-height:110px !important;
    resize:vertical !important;
  }
  .processing-table input:focus,
  .processing-table select:focus,
  .processing-table textarea:focus{
    border-color:#4c8bf5 !important;
    box-shadow:0 0 0 2px rgba(76,139,245,.12) !important;
  }

  .processing-table .status-cell{
    border-left:3px solid #f59e0b !important;
  }
  .processing-table .status-cell select,
  .processing-table .status-cell span{
    min-height:34px !important;
    height:34px !important;
    padding:6px 8px !important;
    font-size:13px !important;
    line-height:1.2 !important;
    justify-content:flex-start !important;
  }

  .processing-table .board-actions{
    display:flex !important;
    align-items:center !important;
    justify-content:flex-start !important;
    gap:7px !important;
    padding:9px 10px 10px !important;
    flex-wrap:nowrap !important;
  }
  .processing-table .board-actions::before{
    display:none !important;
  }
  .processing-table .board-actions form{
    display:block !important;
    flex:0 0 auto !important;
    margin:0 !important;
  }
  .processing-table .board-actions form:first-child{
    flex:1 1 auto !important;
  }
  .processing-table .board-actions .board-icon-btn{
    width:38px !important;
    min-width:38px !important;
    height:34px !important;
    padding:0 !important;
    border-radius:8px !important;
    font-size:14px !important;
  }
  .processing-table .board-actions .board-icon-btn.save{
    width:100% !important;
    min-width:78px !important;
    padding:0 14px !important;
    font-size:13px !important;
  }

  .processing-table .issuance-view,
  .processing-table .comments-view{
    font-size:14px !important;
    line-height:1.3 !important;
  }
  .processing-table .board-empty{
    grid-column:1 / -1 !important;
    padding:16px !important;
    text-align:center !important;
  }

  /* Keep floating navigation controls from covering board headings/content. */
  body.portal-internal-page .portal-mobile-nav-button,
  body.portal-internal-page .portal-back-left{
    top:auto !important;
    bottom:18px !important;
  }
}

/* ========================================================================
   PROCESSING BOARD — CLEAN DISTINCTIVE MOBILE FINISH
   ======================================================================== */
@media (max-width: 700px){
  body.portal-internal-page .processing-card{
    background:#f7f9fc !important;
    border-color:#e1e8f1 !important;
  }

  body.portal-internal-page .board-group-title{
    display:flex !important;
    align-items:center !important;
    gap:8px !important;
    min-height:38px !important;
    margin:6px 0 10px !important;
    padding:0 2px 9px !important;
    color:#2f74d0 !important;
    border-bottom:2px solid #dbe7f7 !important;
    font-size:13px !important;
    letter-spacing:.03em !important;
  }
  body.portal-internal-page .board-group-title .group-chevron{
    display:grid !important;
    place-items:center !important;
    width:22px !important;
    height:22px !important;
    margin:0 !important;
    border-radius:7px !important;
    background:#eaf2ff !important;
    color:#2f74d0 !important;
    font-size:16px !important;
  }
  body.portal-internal-page .board-group-title .item-count{
    display:grid !important;
    place-items:center !important;
    min-width:25px !important;
    height:25px !important;
    margin-left:2px !important;
    padding:0 7px !important;
    border-radius:999px !important;
    background:#eaf2ff !important;
    color:#2f74d0 !important;
    font-size:12px !important;
  }

  .processing-table tr{
    position:relative !important;
    border:1px solid #dbe4ef !important;
    border-radius:14px !important;
    box-shadow:0 5px 16px rgba(15,23,42,.055) !important;
  }
  .processing-table tr::before{
    content:"" !important;
    position:absolute !important;
    top:0 !important;
    bottom:0 !important;
    left:0 !important;
    width:4px !important;
    background:#2d6cdf !important;
    z-index:2 !important;
  }

  .processing-table td{
    padding:10px 12px !important;
    background:#fff !important;
  }
  .processing-table td::before{
    margin-bottom:5px !important;
    color:#6b7a90 !important;
    font-size:9px !important;
    font-weight:850 !important;
    letter-spacing:.08em !important;
  }

  .processing-table td:nth-child(2){
    padding-top:12px !important;
    background:linear-gradient(180deg,#fbfdff 0%,#fff 100%) !important;
  }
  .processing-table td:nth-child(3){
    background:#fffaf3 !important;
    border-left:0 !important;
  }
  .processing-table td:nth-child(4),
  .processing-table td:nth-child(5){
    background:#fbfcfe !important;
  }
  .processing-table td:nth-child(6){
    background:#fff !important;
  }
  .processing-table td:nth-child(7){
    background:#f8fafc !important;
    border-top:1px solid #e5ebf3 !important;
  }

  .processing-table input,
  .processing-table select,
  .processing-table textarea{
    border:1px solid #dce4ee !important;
    background:#fff !important;
    border-radius:9px !important;
    color:#172033 !important;
  }
  .processing-table input[name="file_name"]{
    font-size:16px !important;
    font-weight:750 !important;
    letter-spacing:.01em !important;
  }
  .processing-table .status-cell{
    border-left:0 !important;
    box-shadow:inset 4px 0 0 #f3a718 !important;
  }
  .processing-table .status-cell select,
  .processing-table .status-cell span{
    background:#fff !important;
    font-weight:800 !important;
    text-align:left !important;
  }
  .processing-table textarea{
    min-height:58px !important;
    height:58px !important;
    background:#fcfdff !important;
  }

  .processing-table .board-actions{
    gap:8px !important;
    padding:10px 12px 12px !important;
  }
  .processing-table .board-actions .board-icon-btn{
    border-color:#d5deea !important;
    background:#fff !important;
    color:#445268 !important;
    box-shadow:0 1px 2px rgba(15,23,42,.04) !important;
  }
  .processing-table .board-actions .board-icon-btn.save{
    background:#2563eb !important;
    border-color:#2563eb !important;
    color:#fff !important;
    font-weight:800 !important;
    box-shadow:0 4px 10px rgba(37,99,235,.18) !important;
  }
  .processing-table .board-actions .board-icon-btn.delete{
    color:#dc2626 !important;
    background:#fff7f7 !important;
    border-color:#f2caca !important;
  }

  .document-submission-board{
    margin-top:20px !important;
    padding-top:14px !important;
    border-top:1px solid #e1e8f1 !important;
  }
  .document-submission-board .submission-heading h2{
    font-size:18px !important;
    line-height:1.2 !important;
    letter-spacing:-.01em !important;
  }
}

/* ========================================================================
   PROCESSING BOARD — LABEL SPACING FIX FOR MOBILE
   ======================================================================== */
@media (max-width: 700px){
  .processing-table tr::before{
    left:6px !important;
    top:10px !important;
    bottom:10px !important;
    width:3px !important;
    border-radius:999px !important;
  }

  .processing-table td:nth-child(2),
  .processing-table td:nth-child(3),
  .processing-table td:nth-child(4),
  .processing-table td:nth-child(6){
    padding-left:16px !important;
    padding-right:12px !important;
  }

  .processing-table td:nth-child(5){
    padding-left:12px !important;
    padding-right:12px !important;
  }

  .processing-table td::before{
    position:static !important;
    display:block !important;
    left:auto !important;
    top:auto !important;
    width:auto !important;
    margin:0 0 6px !important;
    padding:0 !important;
    transform:none !important;
    text-indent:0 !important;
    white-space:normal !important;
  }

  .processing-table input[name="file_name"],
  .processing-table select[name="status"],
  .processing-table input[name="due_date"],
  .processing-table textarea[name="comments"]{
    margin-top:0 !important;
  }
}

/* ========================================================================
   PROCESSING BOARD — REMOVE BLUE ACCENT + RESTORE STATUS COLOUR BOX ON MOBILE
   ======================================================================== */
@media (max-width: 700px){
  /* Remove the decorative blue rail on each mobile card. */
  .processing-table tr::before{
    content:none !important;
    display:none !important;
  }

  /* Restore desktop-like coloured status block inside the status area. */
  .processing-table td.status-cell{
    padding:0 !important;
    border-left:0 !important;
    box-shadow:none !important;
    background-clip:padding-box !important;
  }

  .processing-table td.status-cell::before{
    padding:10px 12px 0 !important;
    margin:0 !important;
    background:transparent !important;
  }

  .processing-table td.status-cell select,
  .processing-table td.status-cell span{
    display:flex !important;
    align-items:center !important;
    justify-content:center !important;
    width:calc(100% - 24px) !important;
    min-height:48px !important;
    height:48px !important;
    margin:8px 12px 12px !important;
    padding:0 14px !important;
    border:0 !important;
    border-radius:12px !important;
    background:transparent !important;
    box-shadow:none !important;
    color:#fff !important;
    font-size:13px !important;
    font-weight:800 !important;
    text-align:center !important;
    text-align-last:center !important;
  }

  /* Neutralise the orange/white strip styling from earlier mobile overrides. */
  .processing-table td:nth-child(3){
    border-left:0 !important;
  }

  /* Keep status option list readable when opened. */
  .processing-table td.status-cell select option{
    color:#111827 !important;
    background:#fff !important;
  }
}

/* ========================================================================
   PROCESSING BOARD — READABLE MOBILE STATUS BOX
   ======================================================================== */
@media (max-width: 700px){
  .processing-table td.status-cell{
    display:block !important;
    min-height:0 !important;
    height:auto !important;
    padding:10px 12px 12px !important;
    background:#fff !important;
    border:0 !important;
    box-shadow:none !important;
  }

  .processing-table td.status-cell::before{
    display:block !important;
    margin:0 0 6px !important;
    padding:0 !important;
    color:#6b7a90 !important;
    background:transparent !important;
  }

  .processing-table td.status-cell select,
  .processing-table td.status-cell span{
    display:block !important;
    width:100% !important;
    height:48px !important;
    min-height:48px !important;
    margin:0 !important;
    padding:0 42px 0 14px !important;
    border:0 !important;
    border-radius:10px !important;
    color:#fff !important;
    font-size:14px !important;
    font-weight:800 !important;
    line-height:48px !important;
    text-align:center !important;
    text-align-last:center !important;
    opacity:1 !important;
    box-shadow:none !important;
  }

  .processing-table td.status-cell span{
    padding:0 14px !important;
  }

  .processing-table td.status-issued-copy select,
  .processing-table td.status-issued-copy span{background:#ff9f1c !important;}
  .processing-table td.status-hard-copy select,
  .processing-table td.status-hard-copy span{background:#ed4ab3 !important;}
  .processing-table td.status-relay-copy select,
  .processing-table td.status-relay-copy span{background:#e83e62 !important;}
  .processing-table td.status-pending-ack select,
  .processing-table td.status-pending-ack span{background:#078b4f !important;}
  .processing-table td.status-done select,
  .processing-table td.status-done span{background:#00a967 !important;}
  .processing-table td.status-pending-reply select,
  .processing-table td.status-pending-reply span{background:#347fdc !important;}
  .processing-table td.status-reroute select,
  .processing-table td.status-reroute span{background:#7b8794 !important;}
  .processing-table td.status-tracking select,
  .processing-table td.status-tracking span{background:#684848 !important;}
  .processing-table td.status-yet select,
  .processing-table td.status-yet span{background:#0789bd !important;}
  .processing-table td.status-not-credited select,
  .processing-table td.status-not-credited span{background:#333 !important;}
  .processing-table td.status-pending-tracer select,
  .processing-table td.status-pending-tracer span{background:#7f67d8 !important;}

  .processing-table td.status-cell select option{
    color:#111827 !important;
    background:#fff !important;
  }
}

/* Login password case correction */
body.portal-login-page input[type="password"],
body.portal-login-page input#password,
body.portal-login-page input#password[type="text"] {
  text-transform: none !important;
  font-variant: normal;
  letter-spacing: normal;
}
