@font-face { font-family: 'Hind'; src: url('/static/fonts/Hind-Regular.ttf') format('truetype'); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: 'Hind'; src: url('/static/fonts/Hind-Medium.ttf') format('truetype'); font-weight: 500; font-style: normal; font-display: swap; }
@font-face { font-family: 'Hind'; src: url('/static/fonts/Hind-SemiBold.ttf') format('truetype'); font-weight: 600; font-style: normal; font-display: swap; }
@font-face { font-family: 'Hind'; src: url('/static/fonts/Hind-Bold.ttf') format('truetype'); font-weight: 700 900; font-style: normal; font-display: swap; }

:root {
  --hcv-primary: #114778;
  --hcv-primary-deep: #0b2a4a;
  --hcv-primary-20: #00325a;
  --hcv-accent: #ffb200;
  --hcv-bg: #f8f9ff;
  --hcv-surface: #ffffff;
  --hcv-row: #f3f3f8;
  --hcv-row-hover: #edf1fb;
  --hcv-border: #c2c7d0;
  --hcv-border-soft: #dee2ed;
  --hcv-text: #1a1c1f;
  --hcv-muted: #727780;
  --hcv-success: #00d147;
  --hcv-success-dark: #006e39;
  --hcv-error: #e8201e;
  --hcv-warning: #ffdd8d;
  --hcv-info-bg: #eaf1ff;
  --hcv-radius: 8px;
  --hcv-panel-radius: 14px;
  --hcv-sidebar: 236px;
  --hcv-shadow: 0 1px 1px rgba(0,0,0,.02);
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body {
  background: var(--hcv-bg);
  color: var(--hcv-text);
  font-family: "Hind", "Segoe UI", Arial, sans-serif;
  font-size: 14px;
  line-height: 1.45;
}
button, input, select, textarea { font: inherit; }
a { color: inherit; }

/* App shell */
.portal-shell { min-height: 100vh; display: grid; grid-template-columns: var(--hcv-sidebar) minmax(0,1fr); }
.portal-sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  background: #fbfbff;
  border-right: 1px solid var(--hcv-border-soft);
  padding: 14px 10px;
  display: flex;
  flex-direction: column;
  z-index: 20;
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 34px;
  padding: 0 8px 12px;
}
.brand-mark {
  width: 30px;
  height: 30px;
  display: block;
  flex: 0 0 auto;
  object-fit: contain;
}
.brand-title { font-weight: 750; color: var(--hcv-primary-deep); font-size: 15px; line-height: 1.05; }
.brand-sub { color: var(--hcv-muted); font-size: 9px; margin-top: 2px; }
.sidebar-nav { display: flex; flex-direction: column; gap: 5px; margin-top: 4px; }
.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 48px;
  padding: 0 10px;
  border-radius: var(--hcv-radius);
  text-decoration: none;
  color: #20262c;
  font-size: 13px;
  font-weight: 500;
}
.nav-item:hover { background: #f0f0f5; }
.nav-item.active { background: #e8e8ec; font-weight: 700; color: #101419; }
.nav-icon { width: 21px; height: 21px; color: var(--hcv-primary-deep); flex: 0 0 auto; }
.nav-count {
  margin-left: auto;
  min-width: 22px;
  height: 22px;
  padding: 0 6px;
  border-radius: 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--hcv-accent);
  color: #1a1c1f;
  font-size: 11px;
  font-weight: 800;
}
.sidebar-spacer { flex: 1; }
.sidebar-note { border-top: 1px solid var(--hcv-border-soft); padding: 14px 8px 4px; color: var(--hcv-muted); font-size: 11px; }

.portal-main { min-width: 0; }
.topbar {
  height: 44px;
  background: var(--hcv-bg);
  border-bottom: 1px solid var(--hcv-border-soft);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 18px 0 20px;
  position: sticky;
  top: 0;
  z-index: 15;
}
.breadcrumb { display: flex; align-items: center; gap: 8px; font-size: 14px; }
.breadcrumb strong { font-size: 15px; }
.topbar-user { display: flex; align-items: center; gap: 12px; }
.user-pill { display: flex; align-items: center; gap: 9px; color: var(--hcv-muted); font-size: 12px; }
.user-avatar {
  width: 28px; height: 28px; border: 1px solid var(--hcv-primary-deep); border-radius: 50%;
  display: grid; place-items: center; color: var(--hcv-primary-deep); font-weight: 700; background: white;
}
.logout-link { border: 0; background: none; padding: 6px; cursor: pointer; color: var(--hcv-primary-deep); }

.page { padding: 18px; }
.content-card {
  background: var(--hcv-surface);
  border: 1px solid var(--hcv-border);
  border-radius: var(--hcv-panel-radius);
  box-shadow: var(--hcv-shadow);
  overflow: hidden;
}
.page-tabs { display: flex; gap: 6px; border-bottom: 1px solid var(--hcv-border-soft); padding: 0 16px; min-height: 48px; align-items: flex-end; }
.page-tab {
  min-height: 46px;
  padding: 0 16px;
  display: inline-flex;
  align-items: center;
  border-bottom: 3px solid transparent;
  text-decoration: none;
  color: #222a31;
  font-size: 13px;
}
.page-tab.active { border-bottom-color: var(--hcv-primary-deep); font-weight: 600; }
.page-body { padding: 16px; }
.page-heading { display: flex; justify-content: space-between; align-items: flex-start; gap: 20px; margin-bottom: 16px; }
.page-heading h1 { margin: 0; font-size: 22px; font-weight: 720; color: var(--hcv-primary-deep); }
.page-heading p { margin: 5px 0 0; color: var(--hcv-muted); font-size: 12px; }

/* Buttons */
.btn {
  min-height: 40px;
  border-radius: 22px;
  border: 1px solid var(--hcv-primary-deep);
  padding: 0 16px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  text-decoration: none;
  cursor: pointer;
  font-weight: 650;
  font-size: 13px;
  background: white;
  color: var(--hcv-primary-deep);
}
.btn:hover { filter: brightness(.98); }
.btn-primary { background: var(--hcv-primary-deep); color: white; }
.btn-danger { border-color: var(--hcv-error); color: white; background: var(--hcv-error); }
.btn-success { border-color: var(--hcv-success-dark); color: white; background: var(--hcv-success-dark); }
.btn-ghost { border-color: var(--hcv-border); background: white; }
.btn-square { width: 40px; padding: 0; border-radius: 10px; }

/* Dashboard */
.kpi-grid { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 12px; margin-bottom: 14px; }
.kpi {
  border: 1px solid var(--hcv-border);
  border-radius: var(--hcv-panel-radius);
  background: white;
  min-height: 118px;
  padding: 14px;
}
.kpi-head { display: flex; align-items: flex-start; gap: 10px; }
.kpi-icon { width: 40px; height: 40px; border-radius: 12px; background: #d2e4ff; color: var(--hcv-primary); display: grid; place-items: center; }
.kpi-icon svg { width: 21px; height: 21px; }
.kpi-label { font-size: 12px; color: var(--hcv-muted); }
.kpi-value { font-size: 25px; line-height: 1; font-weight: 750; margin-top: 13px; color: #14191e; }
.kpi-meta { font-size: 11px; color: var(--hcv-muted); margin-top: 4px; }
.progress-grid { display: grid; grid-template-columns: 1fr; gap: 12px; margin-bottom: 14px; }
.progress-card { border: 1px solid var(--hcv-border); border-radius: var(--hcv-panel-radius); padding: 14px 16px; background: white; }
.progress-card-header { display: flex; justify-content: space-between; gap: 12px; align-items: center; }
.progress-card-title { font-weight: 650; color: var(--hcv-primary-deep); }
.progress-card-meta { color: var(--hcv-muted); font-size: 11px; margin-top: 2px; }
.progress-value { font-weight: 750; color: var(--hcv-primary); }
.progress-track { height: 8px; border-radius: 8px; background: #e8e8ec; overflow: hidden; margin-top: 11px; }
.progress-fill { height: 100%; background: var(--hcv-primary); border-radius: inherit; }

.notice {
  display: flex; align-items: center; gap: 8px; min-height: 38px; padding: 8px 12px;
  border-radius: var(--hcv-radius); background: #fff8e8; border: 1px solid #ffdead; color: #604100; font-size: 12px;
}
.notice strong { color: #432c00; }

/* Toolbar */
.toolbar { display: flex; justify-content: space-between; gap: 12px; align-items: center; margin: 14px 0 10px; }
.toolbar-left, .toolbar-right { display: flex; gap: 8px; align-items: center; }
.field {
  height: 40px;
  border: 1px solid var(--hcv-border);
  border-radius: var(--hcv-radius);
  background: white;
  color: var(--hcv-text);
  padding: 0 12px;
  outline: none;
}
.field:focus { border-color: var(--hcv-primary); box-shadow: 0 0 0 1px var(--hcv-primary); }
.search-field { min-width: 270px; }
textarea.field { height: auto; min-height: 110px; padding: 10px 12px; resize: vertical; }

/* Tables */
.table-wrap { overflow-x: auto; }
.hcv-table { width: 100%; border-collapse: separate; border-spacing: 0 4px; }
.hcv-table th { text-align: left; padding: 7px 12px; color: #222a31; font-weight: 650; font-size: 12px; white-space: nowrap; }
.hcv-table td { padding: 9px 12px; background: var(--hcv-row); vertical-align: middle; font-size: 12px; }
.hcv-table tbody tr:hover td { background: var(--hcv-row-hover); }
.hcv-table td:first-child { border-radius: 8px 0 0 8px; }
.hcv-table td:last-child { border-radius: 0 8px 8px 0; }
.table-name { font-weight: 650; color: #171c23; }
.table-sub { color: var(--hcv-muted); font-size: 10px; margin-top: 2px; }
.table-action { color: var(--hcv-primary-deep); font-weight: 700; text-decoration: none; white-space: nowrap; }
.empty-state { text-align: center; color: var(--hcv-muted); padding: 36px 12px !important; background: white !important; }

.status { display: inline-flex; align-items: center; gap: 7px; white-space: nowrap; font-weight: 600; }
.status-dot { width: 10px; height: 10px; border-radius: 50%; display: inline-block; background: #8f9095; }
.status-internal .status-dot { background: #8f9095; }
.status-open .status-dot { background: var(--hcv-accent); }
.status-returned .status-dot { background: var(--hcv-error); }
.status-approved .status-dot { background: var(--hcv-success); }

/* Job detail */
.job-grid { display: grid; grid-template-columns: minmax(0,2fr) 360px; gap: 14px; }
.panel { border: 1px solid var(--hcv-border); border-radius: var(--hcv-panel-radius); background: white; overflow: hidden; }
.panel-header { min-height: 56px; padding: 10px 16px; display: flex; align-items: center; gap: 12px; border-bottom: 1px solid var(--hcv-border); background: #fdfdff; }
.panel-icon { width: 40px; height: 40px; background: #d2e4ff; color: var(--hcv-primary); border-radius: 12px; display: grid; place-items: center; }
.panel-icon svg { width: 22px; height: 22px; }
.panel-title { font-weight: 700; color: #20262c; }
.panel-subtitle { color: var(--hcv-muted); font-size: 10px; margin-top: 1px; }
.panel-body { padding: 16px; }
.pdf-frame { width: 100%; min-height: 780px; border: 0; display: block; background: #f0f0f5; }
.meta-grid { display: grid; grid-template-columns: 120px 1fr; gap: 9px 12px; font-size: 12px; }
.meta-label { color: var(--hcv-muted); }
.meta-value { font-weight: 600; overflow-wrap: anywhere; }
.action-stack { display: grid; gap: 8px; }
.action-stack .btn { width: 100%; }
.info-box { padding: 11px 12px; border-radius: var(--hcv-radius); background: var(--hcv-info-bg); color: #00325a; font-size: 12px; margin-bottom: 12px; }
.return-box { padding: 11px 12px; border-radius: var(--hcv-radius); background: #fff1f0; color: #7e0007; font-size: 12px; }
.comment { padding: 10px 11px; border-radius: var(--hcv-radius); background: var(--hcv-row); margin-top: 8px; border-left: 3px solid var(--hcv-border); }
.comment.internal { border-left-color: var(--hcv-primary); }
.comment.customer { border-left-color: var(--hcv-accent); }
.comment-head { display: flex; justify-content: space-between; gap: 10px; align-items: center; }
.comment-author { font-weight: 700; }
.comment-meta { color: var(--hcv-muted); font-size: 10px; }
.comment-text { margin-top: 6px; white-space: pre-wrap; }
.timeline { display: grid; }
.timeline-item { display: grid; grid-template-columns: 14px 1fr; gap: 9px; padding: 7px 0; }
.timeline-marker { width: 8px; height: 8px; background: var(--hcv-primary); border-radius: 50%; margin-top: 5px; }
.timeline-title { font-weight: 650; font-size: 12px; }
.timeline-meta { color: var(--hcv-muted); font-size: 10px; margin-top: 2px; }

/* Login: restrained brand layout, scoped to the sign-in page. */
.login-body { min-height:100vh; min-height:100svh; display:flex; flex-direction:column; justify-content:center; align-items:center; background:#f1f3f5; padding:48px 24px 24px; }
.login-page { width:100%; max-width:1000px; display:grid; grid-template-columns:44% 56%; background:#fff; border:1px solid #dce1e6; border-radius:10px; overflow:hidden; box-shadow:0 12px 40px rgba(11,42,74,.045); }
.login-identity { min-height:600px; padding:46px 44px 36px; display:flex; flex-direction:column; background:#f7f8fa; border-right:1px solid #e2e6ea; }
.login-brand { display:flex; align-items:center; gap:10px; }
.login-brand-logo { display:block; width:220px; max-width:100%; height:auto; flex:0 0 auto; object-fit:contain; object-position:left center; }
.login-introduction { margin:auto 0; padding:60px 0 72px; }
.login-rule { display:block; width:30px; height:3px; background:#ffb200; margin-bottom:22px; }
.login-product { margin:0 0 16px; color:var(--hcv-primary-deep); font-size:38px; font-weight:650; letter-spacing:-1.3px; line-height:1.2; }
.login-description { max-width:300px; margin:0; color:#596574; font-size:16px; line-height:1.7; }
.login-identity-footer { margin:0; padding-top:22px; border-top:1px solid #dde2e7; color:#6a7683; font-size:12px; }
.login-panel { padding:58px 64px; display:flex; align-items:center; justify-content:center; }
.login-panel-inner { width:100%; max-width:360px; }
.login-panel h1 { margin:0 0 12px; color:var(--hcv-primary-deep); font-size:30px; font-weight:650; letter-spacing:-.6px; line-height:1.25; }
.login-lead { color:#62707d; margin:0 0 34px; font-size:14px; line-height:1.7; }
.login-form { display:grid; gap:22px; }
.login-field label { display:block; color:#344452; font-size:13px; font-weight:600; margin-bottom:8px; }
.login-field .field { width:100%; min-width:0; height:48px; border-color:#cbd3da; border-radius:5px; padding:0 14px; font-size:16px; }
.login-field .field:focus { border-color:var(--hcv-primary); box-shadow:0 0 0 3px rgba(17,71,120,.12); }
.login-form .btn { width:100%; height:48px; margin-top:6px; border:1px solid var(--hcv-primary-deep); border-radius:5px; font-size:14px; justify-content:space-between; padding:0 17px; }
.login-form .btn:hover { background:var(--hcv-primary); border-color:var(--hcv-primary); filter:none; }
.login-form .btn:focus-visible { outline:3px solid #ffb200; outline-offset:3px; }
.login-error { border-left:3px solid #bb3030; background:#fff3f2; color:#8c2525; padding:12px 14px; margin:0 0 22px; border-radius:3px; font-size:13px; line-height:1.5; }
.login-help { margin:30px 0 0; padding-top:22px; border-top:1px solid #edf0f2; color:#6c7884; font-size:12px; line-height:1.7; }
.login-footer { margin-top:22px; color:#7b8793; font-size:11px; letter-spacing:.15px; }
.login-footer span { padding:0 7px; }

@media (max-width:900px) {
  .login-identity { padding:36px 30px 30px; }
  .login-panel { padding:44px 36px; }
  .login-product { font-size:32px; }
}
@media (max-width:640px) {
  .login-body { justify-content:flex-start; padding:24px 16px 20px; }
  .login-page { grid-template-columns:1fr; max-width:460px; }
  .login-identity { min-height:0; padding:24px 28px; border-right:0; border-bottom:1px solid #e2e6ea; }
  .login-brand-logo { width:190px; }
  .login-introduction { margin:18px 0 0; padding:0; }
  .login-product { margin:0; font-size:22px; letter-spacing:-.4px; }
  .login-rule,.login-description,.login-identity-footer { display:none; }
  .login-panel { padding:32px 28px 34px; }
  .login-panel h1 { font-size:27px; }
  .login-lead { margin-bottom:28px; }
  .login-footer { margin-top:18px; }
}

@media (max-width: 1120px) {
  :root { --hcv-sidebar: 205px; }
  .kpi-grid { grid-template-columns: repeat(2,1fr); }
  .job-grid { grid-template-columns: 1fr; }
  .pdf-frame { min-height: 650px; }
}
@media (max-width: 780px) {
  .portal-shell { display:block; }
  .portal-sidebar { position:static; height:auto; border-right:0; border-bottom:1px solid var(--hcv-border-soft); }
  .sidebar-nav { flex-direction:row; overflow:auto; }
  .nav-item { min-width:max-content; }
  .sidebar-spacer,.sidebar-note { display:none; }
  .topbar { position:static; }
  .page { padding:10px; }
  .kpi-grid { grid-template-columns:1fr 1fr; }
  .progress-grid { grid-template-columns:1fr; }
  .toolbar,.page-heading { align-items:stretch; flex-direction:column; }
  .toolbar-left,.toolbar-right { flex-wrap:wrap; }
  .search-field { min-width:0; width:100%; }
}


/* HCV_DEPARTMENT_ADMIN */

.admin-tab-disabled {
  color: var(--hcv-muted);
  cursor: default;
}

.admin-create-card {
  border: 1px solid var(--hcv-border);
  border-radius: var(--hcv-panel-radius);
  background: #fdfdff;
  padding: 16px;
  margin-bottom: 20px;
}

.admin-section-title {
  font-weight: 700;
  color: var(--hcv-primary-deep);
  font-size: 14px;
}

.admin-section-sub {
  color: var(--hcv-muted);
  font-size: 11px;
  margin-top: 3px;
}

.admin-create-form {
  display: grid;
  grid-template-columns: minmax(220px, .7fr) minmax(280px, 1.3fr) auto;
  gap: 10px;
  align-items: end;
  margin-top: 12px;
}

.admin-field {
  min-width: 0;
}

.admin-field label {
  display: block;
  font-size: 11px;
  font-weight: 650;
  margin-bottom: 5px;
  color: #343a40;
}

.admin-field .field {
  width: 100%;
}

.admin-section-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin: 4px 0 8px;
}

.admin-message {
  border-radius: var(--hcv-radius);
  padding: 10px 12px;
  margin-bottom: 14px;
  font-size: 12px;
}

.admin-message-error {
  border: 1px solid #ffb4ab;
  background: #fff1f0;
  color: #7e0007;
}

.admin-message-success {
  border: 1px solid #a8e8be;
  background: #eefbf2;
  color: #005f30;
}

.admin-table-input {
  width: 100%;
  min-width: 180px;
  height: 36px;
}

.admin-description-input {
  min-width: 260px;
}

.admin-status {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-weight: 650;
  white-space: nowrap;
}

.admin-status-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
}

.admin-status.active
.admin-status-dot {
  background: var(--hcv-success);
}

.admin-status.inactive
.admin-status-dot {
  background: #8f9095;
}

.admin-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  white-space: nowrap;
}

.admin-small-btn {
  min-height: 34px;
  padding: 0 13px;
}

.admin-text-action {
  border: 0;
  background: none;
  padding: 4px 0;
  color: var(--hcv-primary-deep);
  font-weight: 650;
  font-size: 11px;
  cursor: pointer;
}

.admin-text-action.danger {
  color: var(--hcv-error);
}

@media (max-width: 900px) {

  .admin-create-form {
    grid-template-columns: 1fr;
  }

  .admin-create-form .btn {
    justify-self: start;
  }
}


/* HCV_USER_ADMIN_V2 */

.user-create-grid {
  display: grid;
  grid-template-columns:
    minmax(180px,1fr)
    minmax(160px,.8fr)
    minmax(150px,.65fr)
    minmax(180px,.8fr)
    minmax(160px,.7fr)
    auto;
  gap: 10px;
  align-items: end;
  margin-top: 12px;
}

.admin-submit-field {
  display: flex;
  align-items: flex-end;
}

.user-list {
  display: grid;
  gap: 10px;
}

.user-card {
  border: 1px solid var(--hcv-border);
  border-radius: var(--hcv-panel-radius);
  background: white;
  padding: 14px;
}

.user-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--hcv-border-soft);
}

.user-card-name {
  font-size: 14px;
  font-weight: 700;
  color: var(--hcv-primary-deep);
}

.user-card-username {
  margin-top: 2px;
  color: var(--hcv-muted);
  font-size: 11px;
}

.user-edit-grid {
  display: grid;
  grid-template-columns:
    minmax(220px,1fr)
    minmax(170px,.7fr)
    minmax(200px,.9fr)
    auto;
  gap: 10px;
  align-items: end;
  padding-top: 12px;
}

.user-card-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 14px;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--hcv-border-soft);
}

.password-reset-form {
  display: flex;
  align-items: center;
  gap: 8px;
}

.password-reset-form .field {
  min-width: 220px;
}

.department-waiting-card {
  border: 1px solid var(--hcv-border);
  border-radius: var(--hcv-panel-radius);
  padding: 22px;
  display: flex;
  align-items: center;
  gap: 16px;
  max-width: 680px;
  background: #fdfdff;
}

.department-waiting-icon {
  width: 46px;
  height: 46px;
  flex: 0 0 46px;
  display: grid;
  place-items: center;
  border-radius: 14px;
  background: #eaf1ff;
  color: var(--hcv-primary);
  font-size: 22px;
  font-weight: 800;
}

.department-waiting-title {
  font-weight: 700;
  color: var(--hcv-primary-deep);
}

.department-waiting-text {
  color: var(--hcv-muted);
  font-size: 12px;
  margin-top: 3px;
}

@media (max-width: 1250px) {

  .user-create-grid {
    grid-template-columns: repeat(3,1fr);
  }

  .user-edit-grid {
    grid-template-columns: repeat(2,1fr);
  }
}

@media (max-width: 780px) {

  .user-create-grid,
  .user-edit-grid {
    grid-template-columns: 1fr;
  }

  .user-card-footer {
    align-items: stretch;
    flex-direction: column;
  }

  .password-reset-form {
    align-items: stretch;
    flex-direction: column;
  }

  .password-reset-form .field {
    min-width: 0;
    width: 100%;
  }
}


/* HCV_ASSIGNMENTS_V3 */

.assignment-switch {
  display: inline-flex;
  border: 1px solid var(--hcv-border);
  border-radius: 10px;
  padding: 3px;
  background: #f6f7fb;
  margin-bottom: 14px;
}

.assignment-switch-item {
  min-height: 36px;
  padding: 0 15px;
  border-radius: 7px;
  display: inline-flex;
  align-items: center;
  text-decoration: none;
  color: var(--hcv-muted);
  font-size: 12px;
  font-weight: 650;
}

.assignment-switch-item.active {
  background: white;
  color: var(--hcv-primary-deep);
  box-shadow: 0 1px 2px rgba(0,0,0,.06);
}

.assignment-toolbar {
  border: 1px solid var(--hcv-border);
  border-radius: var(--hcv-panel-radius);
  background: #fdfdff;
  padding: 13px 14px;
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.assignment-toolbar-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.assignment-toolbar-actions .field {
  min-width: 220px;
}

.assignment-checkbox-column {
  width: 70px;
}

.assignment-checkbox {
  width: 17px;
  height: 17px;
  cursor: pointer;
}

.assignment-pill {
  display: inline-flex;
  align-items: center;
  min-height: 25px;
  padding: 0 9px;
  border-radius: 14px;
  background: #eaf1ff;
  color: var(--hcv-primary-deep);
  font-size: 11px;
  font-weight: 700;
}

.assignment-empty {
  color: var(--hcv-muted);
  font-size: 11px;
}

.batch-assignment-form {
  display: flex;
  align-items: center;
  gap: 7px;
  flex-wrap: wrap;
}

.batch-assignment-form .field {
  min-width: 170px;
}

.department-kpi-grid {
  display: grid;
  grid-template-columns: repeat(4,minmax(0,1fr));
  gap: 10px;
  margin-top: 14px;
}

.department-kpi {
  border: 1px solid var(--hcv-border);
  border-radius: var(--hcv-panel-radius);
  padding: 14px;
  background: white;
}

.department-kpi span {
  display: block;
  color: var(--hcv-muted);
  font-size: 11px;
}

.department-kpi strong {
  display: block;
  color: var(--hcv-primary-deep);
  font-size: 24px;
  margin-top: 5px;
}

@media (max-width: 900px) {

  .assignment-toolbar {
    align-items: stretch;
    flex-direction: column;
  }

  .assignment-toolbar-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .assignment-toolbar-actions .field {
    min-width: 0;
    width: 100%;
  }

  .department-kpi-grid {
    grid-template-columns: repeat(2,1fr);
  }
}

/* Customer review: clear empty states, readable feedback, and version context. */
.sr-only { position:absolute; width:1px; height:1px; padding:0; margin:-1px; overflow:hidden; clip:rect(0,0,0,0); white-space:nowrap; border:0; }
.portal-empty { display:grid; justify-items:center; gap:8px; text-align:center; padding:48px 24px; border:1px dashed var(--hcv-border); border-radius:var(--hcv-panel-radius); background:#fdfdff; color:var(--hcv-primary-deep); }
.portal-empty-icon { width:48px; height:48px; display:grid; place-items:center; border-radius:14px; background:var(--hcv-info-bg); font-size:24px; }
.portal-empty h2 { margin:0; font-size:19px; }
.portal-empty p { max-width:540px; margin:0; color:#505963; font-size:14px; }
.result-count { color:#505963; font-size:13px; white-space:nowrap; }
.heading-actions { display:flex; gap:8px; flex-wrap:wrap; justify-content:flex-end; }
.version-note { padding:14px 16px; margin-bottom:16px; border:1px solid #b3c9e6; border-left:4px solid var(--hcv-primary); border-radius:var(--hcv-radius); background:#f1f6ff; }
.version-note strong { color:var(--hcv-primary-deep); }
.version-note p { margin:6px 0 0; overflow-wrap:anywhere; }
.preview-actions { display:flex; justify-content:space-between; align-items:center; gap:12px; padding:10px 16px; color:#505963; font-size:13px; }
.preview-actions a { color:var(--hcv-primary-deep); font-weight:700; }
.preview-links { display:flex; gap:16px; flex-wrap:wrap; justify-content:flex-end; }
.feedback-form { display:grid; gap:10px; }
.feedback-form h3 { margin:0; font-size:15px; color:var(--hcv-primary-deep); }
.feedback-form label { display:block; font-weight:650; font-size:13px; margin-bottom:4px; }
.feedback-form .field { width:100%; }
.feedback-form .btn { width:100%; }
.feedback-fields { display:grid; grid-template-columns:1fr 115px; gap:10px; }
.decision-confirmation { padding:12px; border:1px solid #97c8a8; border-radius:var(--hcv-radius); background:#f0faf3; }
.decision-confirmation summary { cursor:pointer; color:#005b2d; font-weight:700; }
.decision-confirmation p { margin:10px 0; color:#34513d; }
.decision-confirmation .btn { width:100%; text-align:center; }
.section-divider { border:0; border-top:1px solid var(--hcv-border-soft); margin:18px 0; }
.muted-note { color:#505963; font-size:13px; }
.hcv-table th, .hcv-table td { font-size:13px; }
.table-sub, .panel-subtitle, .comment-meta, .timeline-meta { font-size:12px; }

@media (max-width: 780px) {
  .page-tabs { overflow-x:auto; white-space:nowrap; }
  .page-tab { min-width:max-content; }
  .portal-empty { padding:36px 18px; }
  .feedback-fields { grid-template-columns:1fr; }
  .pdf-frame { min-height:600px; }
  .admin-table-input { min-width:0; }
  .admin-table, .assignment-job-table, .assignment-batch-table,
  .admin-table tbody, .assignment-job-table tbody, .assignment-batch-table tbody { display:block; width:100%; }
  .admin-table thead, .assignment-job-table thead, .assignment-batch-table thead { display:none; }
  .admin-table tbody tr, .assignment-job-table tbody tr, .assignment-batch-table tbody tr { display:grid; gap:0; padding:10px; margin-bottom:12px; border:1px solid var(--hcv-border); border-radius:var(--hcv-panel-radius); background:var(--hcv-row); }
  .admin-table tbody td, .assignment-job-table tbody td, .assignment-batch-table tbody td { display:block; width:100%; padding:8px 4px; background:transparent; }
  .admin-table tbody td:not([colspan])::before, .assignment-job-table tbody td:not([colspan])::before, .assignment-batch-table tbody td:not([colspan])::before { display:block; margin-bottom:4px; color:#505963; font-size:12px; font-weight:700; }
  .admin-table tbody td.empty-state::before, .assignment-job-table tbody td.empty-state::before, .assignment-batch-table tbody td.empty-state::before { content:none; }
  .admin-table tbody td:nth-child(1)::before { content:"Fachbereich"; }
  .admin-table tbody td:nth-child(2)::before { content:"Beschreibung"; }
  .admin-table tbody td:nth-child(3)::before { content:"Status"; }
  .admin-table tbody td:nth-child(4)::before { content:"Zuletzt geändert"; }
  .admin-table tbody td:nth-child(5)::before { content:"Aktionen"; }
  .assignment-job-table tbody td:nth-child(1)::before { content:"Auswahl"; }
  .assignment-job-table tbody td:nth-child(2)::before { content:"Status"; }
  .assignment-job-table tbody td:nth-child(3)::before { content:"Brief"; }
  .assignment-job-table tbody td:nth-child(4)::before { content:"Batch"; }
  .assignment-job-table tbody td:nth-child(5)::before { content:"Fachbereich"; }
  .assignment-job-table tbody td:nth-child(6)::before { content:"Version"; }
  .assignment-job-table tbody td:nth-child(7)::before { content:"Aktion"; }
  .assignment-batch-table tbody td:nth-child(1)::before { content:"Batch"; }
  .assignment-batch-table tbody td:nth-child(2)::before { content:"Briefe"; }
  .assignment-batch-table tbody td:nth-child(3)::before { content:"Offen"; }
  .assignment-batch-table tbody td:nth-child(4)::before { content:"Fachbereich"; }
  .assignment-batch-table tbody td:nth-child(5)::before { content:"Einzelabweichungen"; }
  .assignment-batch-table tbody td:nth-child(6)::before { content:"Zuweisung"; }
  .admin-table .admin-description-input { min-width:0; }
  .admin-table .admin-actions { flex-wrap:wrap; white-space:normal; }
  .assignment-batch-table .batch-assignment-form .field { min-width:0; width:100%; }

  .job-list-table, .batch-list-table, .department-work-table,
  .job-list-table tbody, .batch-list-table tbody, .department-work-table tbody { display:block; width:100%; }
  .job-list-table thead, .batch-list-table thead, .department-work-table thead { display:none; }
  .job-list-table tbody tr, .batch-list-table tbody tr, .department-work-table tbody tr { display:grid; gap:0; padding:10px; margin-bottom:12px; border:1px solid var(--hcv-border); border-radius:var(--hcv-panel-radius); background:var(--hcv-row); }
  .job-list-table tbody td, .batch-list-table tbody td, .department-work-table tbody td { display:block; width:100%; padding:7px 4px; background:transparent; }
  .job-list-table tbody td:not([colspan])::before, .batch-list-table tbody td:not([colspan])::before, .department-work-table tbody td:not([colspan])::before { display:block; margin-bottom:3px; color:#505963; font-size:12px; font-weight:700; }
  .job-list-table tbody td:nth-child(1)::before, .department-work-table tbody td:nth-child(1)::before { content:"Status"; }
  .job-list-table tbody td:nth-child(2)::before { content:"Brief"; }
  .job-list-table tbody td:nth-child(3)::before { content:"Langname"; }
  .job-list-table tbody td:nth-child(4)::before { content:"Version"; }
  .job-list-table tbody td:nth-child(5)::before { content:"Aktualisiert"; }
  .job-list-table tbody td:nth-child(6)::before { content:"Fachliche Prüfung"; }
  .job-list-table tbody td:nth-child(7)::before { content:"Aktion"; }
  .department-work-table tbody td:nth-child(2)::before { content:"Brief"; }
  .department-work-table tbody td:nth-child(3)::before { content:"Langname"; }
  .department-work-table tbody td:nth-child(4)::before { content:"Batch"; }
  .department-work-table tbody td:nth-child(5)::before { content:"Version"; }
  .department-work-table tbody td:nth-child(6)::before { content:"Aktualisiert"; }
  .department-work-table tbody td:nth-child(7)::before { content:"Fachliche Prüfung"; }
  .department-work-table tbody td:nth-child(8)::before { content:"Aktion"; }
  .batch-list-table tbody td:nth-child(1)::before { content:"Batch"; }
  .batch-list-table tbody td:nth-child(2)::before { content:"Briefe"; }
  .batch-list-table tbody td:nth-child(3)::before { content:"Bereitgestellt"; }
  .batch-list-table tbody td:nth-child(4)::before { content:"Offen"; }
  .batch-list-table tbody td:nth-child(5)::before { content:"Freigegeben"; }
  .batch-list-table tbody td:nth-child(6)::before { content:"Rückläufer"; }
  .batch-list-table tbody td:nth-child(7)::before { content:"Aktion"; }
  .job-list-table tbody td.empty-state::before, .batch-list-table tbody td.empty-state::before, .department-work-table tbody td.empty-state::before { content:none; }
}

@media (max-width: 480px) {
  .sidebar-nav { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); overflow:visible; gap:4px; }
  .nav-item { min-width:0; min-height:42px; gap:6px; padding:0 7px; font-size:12px; }
  .nav-icon { width:18px; height:18px; }
  .topbar { height:auto; min-height:54px; gap:8px; padding:7px 10px; }
  .breadcrumb { min-width:0; flex-wrap:wrap; gap:4px; font-size:12px; }
  .breadcrumb strong { font-size:13px; overflow-wrap:anywhere; }
  .topbar-user { flex:0 0 auto; gap:4px; }
  .user-pill > div:first-child { display:none; }
  .user-avatar { width:28px; height:28px; }
  .page-body { padding:12px; }
  .page-tabs { justify-content:space-between; gap:0; padding:0 8px; overflow:visible; }
  .page-tab { min-width:0; padding:0 7px; font-size:12px; }
}

/* Per-account two-factor enrollment and recovery, never external QR services. */
.mfa-qr { display:block; max-width:100%; margin:18px auto; padding:8px; background:#fff; border:1px solid var(--border, #dfe5ec); border-radius:12px; }
.mfa-manual { margin:12px 0; }
.mfa-secret { display:block; padding:12px; background:#f4f7fa; overflow-wrap:anywhere; user-select:all; }
.mfa-cancel { margin-top:14px; }
.mfa-card { max-width:850px; padding:28px; line-height:1.6; }
.mfa-card details { margin:22px 0; }
.mfa-card .login-form { max-width:450px; margin-top:16px; }
.mfa-recovery-codes { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:10px 24px; padding-left:22px; margin:24px 0; }
.mfa-recovery-codes code { overflow-wrap:anywhere; font-size:13px; user-select:all; }
@media (max-width:650px) { .mfa-recovery-codes { grid-template-columns:1fr; } .mfa-card { padding:18px; } }
@media print { .portal-sidebar, .topbar, .mfa-card .btn { display:none!important; } .portal-main { margin:0!important; } .mfa-card { border:0; box-shadow:none; } }
.password-tools{display:flex;gap:10px;flex-wrap:wrap;margin:12px 0}
.password-tools .btn{min-height:42px}

/* Long names are display metadata; keep long terms readable on all screen sizes. */
.template-long-name { min-width:160px; max-width:360px; white-space:normal; overflow-wrap:anywhere; }
