/* Dynapack's official website palette, with darker text and action colors. */
:root {
  --blue: #1161ad;
  --brand-teal: #3cb6a4;
  --brand-deep-teal: #1d9696;
  --ink: #252e34;
  --muted: #63737c;
  --line: #dce6e6;
  --pale: #f5f8f8;
}

html { min-height: 100%; scrollbar-gutter: stable; }
body {
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
}
.topbar {
  height: auto;
  min-height: 88px;
  padding: 0 30px;
  flex-shrink: 0;
  flex-wrap: nowrap;
  gap: 12px 26px;
  border-top: 3px solid var(--brand-teal);
}
.brand-identity { display: flex; align-items: center; flex-shrink: 0; }
.identity { display: inline-flex; line-height: 0; }
.dynapack-logo { display: block; width: 190px; height: auto; }
.partner-brand { margin-left: 16px; padding-left: 24px; border-left: 1px solid var(--line); flex-shrink: 0; line-height: 0; }
.piovan-logo { display: block; width: 148px; height: auto; }
.user-menu { position: relative; margin: 0 0 0 auto; font-size: 14px; min-width: 0; }
.user-menu > summary { display: flex; align-items: center; gap: 10px; width: auto; list-style: none; color: var(--ink); border-radius: 5px; padding: 6px; }
.user-menu > summary::-webkit-details-marker { display: none; }
.user-menu > summary::after { content: ""; width: 7px; height: 7px; border-right: 2px solid currentColor; border-bottom: 2px solid currentColor; transform: rotate(45deg); margin: -4px 3px 0 2px; }
.user-menu[open] > summary::after { transform: rotate(225deg); margin-top: 4px; }
.user-menu > summary:hover, .user-menu[open] > summary { background: var(--pale); }
.user-avatar { display: grid; place-items: center; width: 32px; height: 32px; flex-shrink: 0; border-radius: 50%; background: #e0f1ed; color: #17675e; font-weight: 700; }
.user-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 240px; }
.topbar .user-menu-panel { position: absolute; top: calc(100% + 8px); right: 0; z-index: 30; display: flex; flex-direction: column; flex-wrap: nowrap; align-items: stretch; gap: 0; width: 230px; max-width: calc(100vw - 32px); margin: 0; padding: 6px; border: 1px solid var(--line); border-radius: 7px; background: white; box-shadow: 0 5px 24px #192a3729; }
.user-menu-panel > a, .user-menu-panel button { display: flex; align-items: center; justify-content: space-between; width: 100%; padding: 11px 12px; border: 0; border-radius: 4px; color: var(--ink); font: inherit; font-weight: 500; background: white; text-align: left; }
.user-menu-panel > a:hover, .user-menu-panel button:hover { background: var(--pale); text-decoration: none; filter: none; }
.user-menu-panel form { border-top: 1px solid var(--line); margin-top: 4px; padding-top: 4px; }
.user-menu-panel button { cursor: pointer; color: #92322e; }
.workspace { flex: 1; min-height: 0; }
.sidebar { border-top: 2px solid #e5f3f0; }
.sidebar .catalogue-filters { display: flex; flex-direction: column; align-items: stretch; }
.filter-field { min-width: 0; }
.technical-filters { margin-top: 24px; padding-top: 18px; border-top: 1px solid var(--line); font-size: 12px; }
.technical-filters > summary { width: 100%; font-weight: 600; }
.technical-filter-fields { display: flex; flex-direction: column; }
.technical-filters select:disabled { color: var(--muted); background: var(--pale); }
.technical-filters .chip { margin: 6px 0 0; }
.eyebrow { color: #237d75; }
.chip { color: #17675e; background: #e0f1ed; }
.tabs .active { border-bottom: 2px solid var(--brand-teal); }
.tabs button { border-radius: 5px 5px 0 0; }
.auth-panel {
  width: min(480px, calc(100% - 40px));
  margin: clamp(32px, 6vh, 64px) auto 40px;
  border-top: 3px solid var(--brand-teal);
  box-shadow: 0 5px 24px #1d596408;
}
.auth-panel form > button { min-width: 116px; }
.security-links { display: grid; gap: 12px; margin-top: 24px; }
.security-links a { display: block; padding: 16px; border: 1px solid var(--line); border-radius: 6px; }
.security-links a:hover { background: var(--pale); text-decoration: none; }
.security-links strong, .security-links span { display: block; }
.security-links span { margin-top: 4px; color: var(--muted); font-size: 12px; }
.recovery-codes {
  width: 100%;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: #f7faf9;
  color: var(--ink);
  font: 15px/1.7 ui-monospace, SFMono-Regular, monospace;
  resize: vertical;
}
.recovery-confirmation { display: flex; align-items: flex-start; gap: 9px; font-size: 13px; }
.recovery-confirmation input { margin-top: 3px; }
button { background: var(--blue); }
.quiet { background: white; }
input:focus-visible, select:focus-visible, button:focus-visible,
a:focus-visible, summary:focus-visible { outline-color: #238579; }
.messages { background: #e6f3ef; }
.selection-page { width: min(1250px, 100%); }
.catalogue-table, .cart-table, .audit-table { table-layout: fixed; width: 100%; }
.catalogue-table { min-width: 960px; }
.catalogue-brand { width: 10%; }
.catalogue-product { width: 37%; }
.catalogue-code { width: 15%; }
.catalogue-price { width: 16%; }
.catalogue-quantity { width: 22%; }
.catalogue-table .product { min-width: 0; }
.catalogue-table td, .cart-table td, .audit-table td { overflow-wrap: anywhere; }
.catalogue-table .code, .cart-table .code { white-space: normal; }
.catalogue-table details p { max-width: 100%; white-space: normal; overflow-wrap: anywhere; }
.cart-table { min-width: 1100px; }
.cart-product { width: 30%; }
.cart-code { width: 13%; }
.cart-price, .cart-amount { width: 15%; }
.cart-quantity { width: 27%; }
.listed-price { display: block; color: var(--muted); font-size: 12px; font-weight: 400; }
.settings-form select { width: 100%; }
.rate-input { display: flex; align-items: center; gap: 8px; }
.rate-input input { min-width: 0; flex: 1; }
.rate-input span, .rate-input strong { white-space: nowrap; font-size: 12px; }
.rate-updated { margin-top: 20px; }
.button-link { display: inline-block; border-radius: 5px; padding: 9px 14px; color: white; background: var(--blue); white-space: nowrap; font-weight: 600; }
.button-link:hover { text-decoration: none; filter: brightness(.94); }
.dashboard-page { width: min(1500px, 100%); margin: 32px auto; padding: 0 30px; }
.dashboard-page h1 { margin: 4px 0 8px; }
.dashboard-metrics { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 12px; margin-bottom: 24px; }
.dashboard-metrics > div, .dashboard-insights > section { padding: 18px; border: 1px solid var(--line); border-radius: 7px; background: white; }
.dashboard-metrics span { display: block; color: var(--muted); font-size: 12px; }
.dashboard-metrics strong { display: block; font-size: 28px; margin-top: 8px; }
.dashboard-insights { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; margin-bottom: 16px; }
.dashboard-insights h2 { font-size: 17px; margin: 0 0 16px; }
.insight-row { display: grid; grid-template-columns: minmax(0, 1fr) 70px 32px; align-items: center; gap: 9px; margin: 10px 0; font-size: 12px; }
.insight-row > span { overflow-wrap: anywhere; }
.insight-row progress { width: 70px; height: 9px; accent-color: var(--brand-deep-teal); }
.insight-row strong { text-align: right; }
.activity-filters { display: flex; align-items: end; flex-wrap: wrap; gap: 12px; margin-top: 16px; }
.activity-filters label { margin: 0 0 6px; }
.activity-filters select { max-width: 250px; }
.activity-filters > .errorlist { flex-basis: 100%; }
.audit-table { min-width: 1000px; }
.audit-time { width: 18%; }
.audit-user { width: 24%; }
.audit-action { width: 20%; }
.audit-details { width: 38%; }
.audit-detail-list { margin: 12px 0 0; font-size: 12px; }
.audit-detail-list dt { font-weight: 600; margin-top: 10px; }
.audit-detail-list dd { margin: 3px 0 0; overflow-wrap: anywhere; }
.activity-summary { margin: 0 0 6px; font-size: 12px; }
@media (max-width: 1100px) {
  .dashboard-metrics { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .dashboard-insights { grid-template-columns: 1fr; }
}
.quantity-form button { white-space: nowrap; }
.quantity-form button:disabled { opacity: .65; cursor: wait; }
.cart-notice { position: fixed; bottom: 20px; right: 20px; z-index: 10; }
.cart-notice p { margin: 0; }
.cart-notice.is-visible {
  width: 360px;
  max-width: calc(100% - 32px);
  padding: 16px 48px 16px 18px;
  border: 1px solid var(--line);
  border-left: 4px solid var(--brand-deep-teal);
  border-radius: 7px;
  background: white;
  box-shadow: 0 5px 24px #192a3729;
}
.cart-notice.is-visible > a { display: inline-block; margin-top: 8px; font-weight: 600; }
.cart-notice.is-error { border-left-color: #92322e; }
.cart-notice.is-error p { color: #92322e; }
.cart-dismiss { position: absolute; top: 8px; right: 8px; padding: 2px 8px; font-size: 20px; }
.site-footer {
  margin-top: auto;
  flex-shrink: 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px 20px;
  padding: 15px 30px;
  background: white;
  border-top: 1px solid var(--line);
  color: var(--muted);
}
@media (max-width: 800px) {
  .user-name { display: none; }
}
@media (max-width: 650px) {
  .topbar {
    min-height: 82px;
    padding: 5px 12px;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
  }
  .dynapack-logo { width: 156px; }
  .piovan-logo { width: 116px; }
  .partner-brand { margin-left: 8px; padding-left: 12px; }
  .user-menu > summary { gap: 5px; padding: 4px 0; }
  .auth-panel { width: calc(100% - 32px); margin: 30px auto 40px; padding: 24px; }
  .sidebar .catalogue-filters { gap: 0; }
  .sidebar .filter-field { display: grid; grid-template-columns: 110px minmax(0, 1fr); align-items: center; gap: 10px; margin-top: 12px; }
  .sidebar .catalogue-filters > .full { margin-top: 18px; }
  .sidebar .catalogue-filters > .text-link { margin-top: 12px; }
  .technical-filters .full { margin-top: 16px; }
  .site-footer { padding: 14px 16px; font-size: 10px; }
  .dashboard-page { padding: 0 16px; }
  .dashboard-page .results-heading { align-items: flex-start; flex-direction: column; }
  .dashboard-metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 380px) {
  .topbar { padding-left: 10px; padding-right: 10px; gap: 6px; }
  .partner-brand { margin-left: 4px; padding-left: 8px; }
  .dynapack-logo { width: 132px; }
  .piovan-logo { width: 96px; }
}
