/* ── Customer Portal Theme ────────────────────────────────────────────
   Wireframe-matching flex layout. Replaces MudBlazor layout shell.
──────────────────────────────────────────────────────────────────────*/

/* ── Base font: matches wireframe (Arial, 13 px) ── */
html, body {
  margin: 0;
  padding: 0;
  height: 100%;
  font-family: Arial, sans-serif;
  font-size: 13px;
  color: #333;
  background: #0f1833;
}

/* ── Shell: sidebar + right column, full viewport ── */
.cp-app {
  display: flex;
  height: 100vh;
  overflow: hidden;
}

/* ── Sidebar ── */
.cp-sidebar {
  width: 210px;
  flex-shrink: 0;
  background: #1a2444;
  border-right: 2px solid #0f1833;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.cp-sidebar-logo {
  padding: 14px 14px 12px;
  background: #030916;
  border-bottom: 1px solid #0f1833;
  flex-shrink: 0;
}

/* MudNavMenu fills remaining sidebar height */
.cp-sidebar .mud-navmenu {
  flex: 1;
  overflow-y: auto;
}

/* ── Right column ── */
.cp-right {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  min-width: 0;
}

/* ── Header bar — exact wireframe .hdr ── */
.cp-header {
  background: #1a2444;
  border-bottom: 2px solid #0f1833;
  padding: 10px 22px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-shrink: 0;
}

.cp-title {
  font-weight: bold;
  font-size: 15px;
  color: #fff;
}

/* ── User info area — exact wireframe .hdr-user ── */
.cp-user {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 12px;
  color: #b8c8e8;
}

.cp-user strong {
  color: #fff;
}

/* ── Sign-out button — exact wireframe .btn-signout ── */
.cp-signout {
  border: 1px solid #5a7abf;
  background: transparent;
  padding: 4px 11px;
  font-size: 11px;
  cursor: pointer;
  border-radius: 3px;
  color: #b8c8e8;
  font-family: Arial, sans-serif;
}

.cp-signout:hover {
  background: #243060;
  color: #fff;
}

/* ── Scrollable content area ── */
.cp-content {
  flex: 1;
  overflow-y: auto;
  background: #f7f7f7;
  padding: 26px 28px;
}

/* ── Nav links — default ── */
.mud-nav-link {
  color: #b8c8e8 !important;
  border-bottom: 1px solid #243060 !important;
  border-radius: 0 !important;
}

.mud-nav-link .mud-icon-root,
.mud-nav-link .mud-nav-link-text {
  color: #b8c8e8 !important;
}

/* ── Nav links — hover ── */
.mud-nav-link:hover {
  background-color: #243060 !important;
  color: #ffffff !important;
}

.mud-nav-link:hover .mud-icon-root,
.mud-nav-link:hover .mud-nav-link-text {
  color: #ffffff !important;
}

/* ── Nav links — active ── */
.mud-nav-link.active,
.mud-nav-link-active {
  background-color: #1a5fa8 !important;
  color: #ffffff !important;
  border-left: 3px solid #5a9fe0 !important;
  padding-left: 13px !important;
}

.mud-nav-link.active .mud-icon-root,
.mud-nav-link.active .mud-nav-link-text,
.mud-nav-link-active .mud-icon-root,
.mud-nav-link-active .mud-nav-link-text {
  color: #ffffff !important;
}

/* ── Page heading & subtitle — exact wireframe .pg-title / .pg-sub ── */
.pg-title {
  font-size: 20px;
  font-weight: bold;
  color: #111;
  margin-bottom: 6px;
}

.pg-sub {
  font-size: 12px;
  color: #888;
  margin-bottom: 22px;
}

/* ══════════════════════════════════════════════════════════
   Wireframe content-area utility classes
   (exact values from customer-portal-wireframe.html)
══════════════════════════════════════════════════════════ */

/* ── Toolbar ── */
.toolbar {
  display: flex;
  gap: 9px;
  align-items: center;
  margin-bottom: 14px;
  flex-wrap: wrap;
}
.spacer { flex: 1; }
.txt-muted { color: #999; font-size: 11px; }
.sec-title {
  font-size: 10px;
  font-weight: bold;
  color: #777;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  margin-bottom: 12px;
}

/* ── Inputs & selects ── */
.cp-content input,
.cp-content select,
.cp-content textarea {
  border: 1px solid #bbb;
  padding: 6px 9px;
  font-size: 12px;
  border-radius: 3px;
  background: white;
  font-family: Arial, sans-serif;
  color: #333;
  box-sizing: border-box;
}
.cp-content input:focus,
.cp-content select:focus {
  outline: 1px solid #1a5fa8;
  border-color: #1a5fa8;
}
.inp-search { width: 230px; }
.inp-sm     { width: 160px; }
.inp-med    { width: 260px; }

/* ── Buttons ── */
.btn {
  border: 1px solid #bbb;
  padding: 6px 14px;
  font-size: 12px;
  border-radius: 3px;
  cursor: pointer;
  background: white;
  font-family: Arial, sans-serif;
  color: #333;
}
.btn:not(:disabled):hover  { background: #f0f0f0; }
/* A disabled button (e.g. Transfer Out while a transfer is pending review) must read as disabled, not
   just be unclickable — without this it looked identical to an enabled button. */
.btn:disabled,
.btn[disabled] { opacity: 0.45; cursor: not-allowed; }
.btn-pri    { background: #3a3a3a; color: white; border-color: #3a3a3a; }
.btn-pri:hover { background: #555; }
.btn-ok     { background: #2e6e2e; color: white; border-color: #2e6e2e; }
.btn-del    { background: #902020; color: white; border-color: #902020; }
.btn-wrn    { background: #7a5000; color: white; border-color: #7a5000; }
.btn-sm     { padding: 3px 9px; font-size: 11px; }
.btn-xs     { padding: 2px 6px; font-size: 10px; }

/* ── Table ── */
.tbl {
  width: 100%;
  border-collapse: collapse;
  background: white;
  border: 1px solid #ddd;
  border-radius: 5px;
  overflow: hidden;
  margin-bottom: 8px;
}
.tbl th {
  background: #efefef;
  border-bottom: 2px solid #ddd;
  padding: 9px 12px;
  text-align: left;
  font-size: 11px;
  font-weight: bold;
  color: #555;
  white-space: nowrap;
}
.tbl td {
  border-bottom: 1px solid #eee;
  padding: 8px 12px;
  font-size: 12px;
  vertical-align: middle;
}
.tbl tr:last-child td { border-bottom: none; }
.tbl tbody tr:hover td { background: #f6f7f9; }
.tbl .acts { white-space: nowrap; }

/* ── Card ── */
.card {
  background: white;
  border: 1px solid #ddd;
  border-radius: 5px;
  padding: 20px;
  margin-bottom: 20px;
}

/* ── Monospace ── */
.mono { font-family: Consolas, monospace; font-size: 11px; }

/* ── Status chips (all wireframe colours) ── */
.chip {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 10px;
  font-size: 10px;
  font-weight: bold;
  white-space: nowrap;
  margin-right: 3px;
}
.c-green  { background: #d6f0d6; color: #1e5a1e; border: 1px solid #a8d8a8; }
.c-orange { background: #fff0cc; color: #7a5000; border: 1px solid #ddc870; }
.c-red    { background: #f5d5d5; color: #7a1515; border: 1px solid #d8a8a8; }
.c-gray   { background: #e8e8e8; color: #555;    border: 1px solid #ccc; }
.c-blue   { background: #d5e8ff; color: #1a4080; border: 1px solid #a8c8f0; }
.c-purple { background: #e8d5ff; color: #4a1080; border: 1px solid #c8a8e8; }

/* ── Tabs: restyle MudTabs to match the admin wireframe folder-tab look ── */
/* ⚠ mud-tabs-TOOLBAR, not mud-tabs-tabbar. MudBlazor has no class of the latter name,
   so this whole rule silently did nothing: the bar kept MudBlazor's white surface and
   never got its 2px rule, leaving white showing under the active tab. */
.mud-tabs .mud-tabs-toolbar {
  /* WHITE, not transparent. The unselected tabs take their colour from this bar, and the
     selected one is #f7f7f7 to match the page below — that contrast IS how you tell them
     apart. Making the bar transparent greyed out all of them and the selection vanished.
     min-height:0 here is necessary but NOT sufficient — see the inner-wrapper rule below,
     which is what actually collapses the white strip. */
  border-bottom: 2px solid #ccc; background: #fff; box-shadow: none; min-height: 0;
}

/* ⚠ THIS is what actually removes the white strip under the tabs, and it is not the toolbar.
   MudBlazor puts an inner wrapper inside it:

       .mud-tabs-toolbar .mud-tabs-toolbar-inner { display:flex; min-height:48px }

   Our tabs are 36px, so the wrapper held 12px of spare height that painted white below them.
   min-height:0 on the OUTER toolbar cannot shrink a child demanding 48px — the strip survived
   the first two attempts at this for exactly that reason. */
.mud-tabs .mud-tabs-toolbar-inner { min-height: 0; }
.mud-tabs .mud-tab {
  font-size: 12px; font-family: Arial, sans-serif; text-transform: none; font-weight: 400;
  color: #555; min-height: 36px; min-width: 0; padding: 8px 18px;
  border: 1px solid transparent; border-bottom: none; border-radius: 4px 4px 0 0; margin-bottom: -2px;
}
.mud-tabs .mud-tab:hover { background: #f0f3f7; }
.mud-tabs .mud-tab.mud-tab-active {
  /* Same fill as the panel below, pulled down 2px (see .mud-tab) so it paints over the
     bar's rule — that overlap is what makes the tab read as open into the content. */
  color: #1a5fa8; font-weight: bold; border-color: #ccc; background: #f7f7f7;
}
.mud-tabs .mud-tab-slider { display: none; }
