:root {
  --ksl-interface-font-family: Inter, "Segoe UI", Arial, sans-serif;
  --ksl-content-font-family: Inter, "Segoe UI", Arial, sans-serif;
  --ksl-maroon: #7a1118;
  --ksl-maroon-dark: #3e0b10;
  --ksl-navy: #003366;
  --ksl-navy-700: #0b477f;
  --ksl-navy-soft: #eaf1f8;
  --ksl-red: #b4232a;
  --ksl-red-soft: #fdebed;
  --ksl-gold: #c7a044;
  --ksl-gold-soft: #f8f3e5;
  --ksl-ink: #102033;
  --ksl-muted: #607089;
  --ksl-line: #d8e1ec;
  --ksl-bg: #f6f8fb;
  --ksl-card: #ffffff;
  --ksl-success: #168a4a;
  --ksl-warning: #b7791f;
  --ksl-danger: #c24141;
  --ksl-info: #1b6b9b;
  --shadow-sm: 0 8px 24px rgba(16, 32, 51, 0.07);
  --shadow-md: 0 18px 45px rgba(16, 32, 51, 0.12);
  --radius: 8px;
  --chart-grid: #d7e0ec;
  --row-hover: #f1f6fc;
}

html[data-script-font="mangal"] {
  --ksl-content-font-family: "Mangal", "Nirmala UI", "Kalimati", "Kokila", sans-serif;
}

html[data-script-font="kalimati"] {
  --ksl-content-font-family: "Kalimati", "Mangal", "Nirmala UI", "Kokila", sans-serif;
}

html[data-script-font="kokila"] {
  --ksl-content-font-family: "Kokila", "Mangal", "Nirmala UI", "Kalimati", sans-serif;
}

html[data-theme="dark"] {
  color-scheme: dark;
  --ksl-maroon: #d26770;
  --ksl-maroon-dark: #22060a;
  --ksl-navy: #8ebaff;
  --ksl-navy-700: #5f98df;
  --ksl-navy-soft: #162a45;
  --ksl-red: #ff8e96;
  --ksl-red-soft: #3b1419;
  --ksl-gold: #e7c66b;
  --ksl-gold-soft: #352b16;
  --ksl-ink: #eef4ff;
  --ksl-muted: #b7c5d8;
  --ksl-line: #29415f;
  --ksl-bg: #071426;
  --ksl-card: #0d2038;
  --chart-grid: #2d4667;
  --row-hover: #102b4c;
  --text-main: #eef4ff;
  --text-muted: #b7c5d8;
  --border-soft: #29415f;
  --surface: #0d2038;
  --surface-soft: #102b4c;
  --shadow-sm: 0 10px 28px rgba(0, 0, 0, 0.26);
  --shadow-md: 0 18px 48px rgba(0, 0, 0, 0.38);
}

* {
  box-sizing: border-box;
}

html {
  color-scheme: light;
}

body {
  margin: 0;
  color: var(--ksl-ink);
  background:
    linear-gradient(180deg, rgba(11, 45, 87, 0.055), rgba(255, 255, 255, 0.76) 42%, transparent 72%),
    var(--ksl-bg);
  font-family: var(--ksl-interface-font-family);
  line-height: 1.5;
  transition: background 0.22s ease, color 0.22s ease;
}

input,
textarea,
[contenteditable="true"],
[data-user-content],
.ksl-user-content,
.cell-clamp,
.cell-truncate,
.comment-entry p,
.repository-path,
.script-font-preview,
td,
dd {
  font-family: var(--ksl-content-font-family);
}

button,
select,
option,
th,
.pill,
.badge,
.tag,
.btn,
input[type="button"],
input[type="submit"],
input[type="reset"] {
  font-family: var(--ksl-interface-font-family);
}

html[data-theme="dark"] body {
  color: var(--ksl-ink);
  background: var(--ksl-bg);
}

a {
  color: var(--ksl-maroon);
}

.app-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 292px minmax(0, 1fr);
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
  color: #fff;
  background:
    radial-gradient(circle at 20% 0%, rgba(199, 160, 68, 0.18), transparent 34%),
    linear-gradient(180deg, rgba(11, 45, 87, 0.99), rgba(62, 11, 16, 0.95)),
    var(--ksl-maroon-dark);
  padding: 22px 18px;
}

.brand-lockup {
  display: grid;
  grid-template-columns: 58px minmax(0, 1fr);
  gap: 12px;
  align-items: center;
  padding-bottom: 22px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.14);
}

.brand-lockup img,
.login-logo img {
  width: 58px;
  height: 58px;
  object-fit: contain;
  background: #fff;
  border-radius: 50%;
  padding: 6px;
}

.brand-lockup strong,
.login-logo strong {
  display: block;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.02rem;
  line-height: 1.15;
}

.brand-lockup span,
.login-logo span {
  display: block;
  color: rgba(255, 255, 255, 0.78);
  font-size: 0.78rem;
  margin-top: 4px;
}

.sidebar-profile {
  display: flex;
  gap: 10px;
  align-items: center;
  margin: 18px 0;
  padding: 12px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: var(--radius);
}

.avatar {
  display: inline-grid;
  place-items: center;
  width: 38px;
  height: 38px;
  flex: 0 0 38px;
  border-radius: 50%;
  background: #fff;
  color: var(--ksl-navy);
  font-weight: 800;
}

.sidebar-profile b {
  display: block;
  font-size: 0.92rem;
}

.sidebar-profile small {
  color: rgba(255, 255, 255, 0.72);
  text-transform: capitalize;
}

.nav-group {
  margin-top: 20px;
}

.nav-label {
  margin: 0 0 8px 12px;
  color: rgba(255, 255, 255, 0.58);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.nav-sub {
  margin: 12px 0 6px 12px;
  color: rgba(255, 255, 255, 0.68);
  font-size: 0.78rem;
  font-weight: 800;
}

.nav-link {
  position: relative;
  display: flex;
  gap: 12px;
  align-items: center;
  min-height: 42px;
  color: rgba(255, 255, 255, 0.88);
  text-decoration: none;
  padding: 10px 12px;
  border-radius: var(--radius);
  margin-bottom: 4px;
}

.nav-link:hover,
.nav-link.active {
  color: #fff;
  background: rgba(255, 255, 255, 0.14);
  transform: translateX(2px);
}

.nav-link i {
  width: 18px;
  text-align: center;
  color: #f0cf76;
}

.badge-dot {
  margin-left: auto;
  min-width: 22px;
  height: 22px;
  padding: 0 6px;
  display: inline-grid;
  place-items: center;
  border-radius: 999px;
  background: #fff;
  color: var(--ksl-navy);
  font-size: 0.72rem;
  font-weight: 800;
}

.register-wizard {
  display: grid;
  gap: 18px;
}

.register-stepper {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 8px;
  padding: 0;
  margin: 0 0 6px;
  list-style: none;
}

.stepper-item {
  width: 100%;
  min-height: 54px;
  border: 1px solid var(--ksl-line);
  border-radius: var(--radius);
  background: var(--ksl-card);
  color: var(--ksl-muted);
  font-weight: 800;
  text-align: left;
  padding: 8px 10px;
  cursor: pointer;
  transition: border-color 0.18s ease, box-shadow 0.18s ease, transform 0.18s ease;
}

.stepper-item span {
  display: inline-grid;
  place-items: center;
  width: 26px;
  height: 26px;
  margin-right: 6px;
  border-radius: 999px;
  background: var(--ksl-navy-soft);
  color: var(--ksl-navy);
}

.stepper-item.active,
.stepper-item.complete {
  color: var(--ksl-navy);
  border-color: rgba(0, 51, 102, 0.38);
  box-shadow: var(--shadow-sm);
}

.stepper-item.active {
  transform: translateY(-1px);
}

.stepper-item.active span,
.stepper-item.complete span {
  background: var(--ksl-navy);
  color: #fff;
}

.register-step {
  border: 1px solid var(--ksl-line);
  border-radius: var(--radius);
  background: var(--ksl-card);
  overflow: hidden;
}

.register-step-title {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border: 0;
  background: linear-gradient(90deg, var(--ksl-navy-soft), transparent);
  color: var(--ksl-ink);
  padding: 15px 18px;
  cursor: pointer;
  text-align: left;
}

.register-step-title i:first-child {
  color: var(--ksl-maroon);
  margin-right: 8px;
}

.register-step-body {
  padding: 18px;
}

.direction-tabs {
  width: fit-content;
  margin-bottom: 18px;
}

.legacy-routing-fields {
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px dashed var(--ksl-line);
}

.input-action-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
}

.rich-text-lite {
  min-height: 168px;
}

.validation-summary {
  margin: 14px 18px 0;
  padding: 12px 14px;
  border: 1px solid rgba(194, 65, 65, 0.24);
  border-left: 4px solid var(--ksl-danger);
  border-radius: var(--radius);
  color: var(--ksl-danger);
  background: rgba(194, 65, 65, 0.08);
}

.validation-summary ul {
  margin: 6px 0 0;
  padding-left: 18px;
}

[aria-invalid="true"] {
  border-color: var(--ksl-danger) !important;
  box-shadow: 0 0 0 3px rgba(194, 65, 65, 0.12) !important;
}

.field-error {
  display: block;
  margin-top: 6px;
  color: var(--ksl-danger);
  font-size: 0.76rem;
  font-weight: 800;
  line-height: 1.3;
}

.upload-progress {
  height: 8px;
  margin-top: 12px;
  overflow: hidden;
  border-radius: 999px;
  background: var(--ksl-navy-soft);
}

.upload-progress span {
  display: block;
  height: 100%;
  width: 0;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--ksl-navy), var(--ksl-maroon));
  transition: width 0.28s ease;
}

.attachment-meta-list {
  display: grid;
  gap: 8px;
  padding: 0;
  margin: 0 0 12px;
  list-style: none;
}

.attachment-meta-list li {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 10px;
  border: 1px solid var(--ksl-line);
  border-radius: var(--radius);
  background: var(--ksl-bg);
}

.attachment-meta-list span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 700;
}

.review-summary dl {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin: 0;
}

.review-summary div,
.audit-preview {
  padding: 12px;
  border: 1px solid var(--ksl-line);
  border-radius: var(--radius);
  background: var(--ksl-bg);
}

.review-summary dt {
  color: var(--ksl-muted);
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
}

.review-summary dd {
  margin: 3px 0 0;
  color: var(--ksl-ink);
  font-weight: 800;
  overflow-wrap: anywhere;
}

.register-nav {
  position: sticky;
  bottom: 0;
  z-index: 5;
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding: 14px 0 0;
  background: linear-gradient(180deg, transparent, var(--ksl-card) 30%);
}

.drop-zone.is-dragging {
  border-color: var(--ksl-maroon);
  background: var(--ksl-red-soft);
}

.register-classic-form {
  position: relative;
  border-top: 4px solid var(--ksl-navy);
  background:
    linear-gradient(180deg, rgba(234, 241, 248, 0.72), transparent 150px),
    var(--ksl-card);
}

.simple-register-form {
  display: grid;
  gap: 18px;
}

.register-form-tabs {
  width: fit-content;
  margin: 0 0 16px;
}

.register-form-panels {
  display: grid;
  gap: 18px;
}

.register-form-panel {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 340px);
  gap: 18px;
  align-items: start;
  animation: assignmentReveal 0.2s ease-out;
}

.register-form-panel[hidden] {
  display: none;
}

.direction-register-form {
  min-width: 0;
}

.simple-register-top {
  display: grid;
  grid-template-columns: minmax(220px, auto) minmax(0, 1fr);
  gap: 16px;
  align-items: end;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--ksl-line);
}

.simple-register-top .direction-tabs {
  margin-bottom: 0;
}

.simple-register-top h2 {
  margin: 0 0 4px;
  color: var(--ksl-navy);
  font-size: 1.12rem;
}

.simple-number-preview {
  min-height: 52px;
  align-items: center;
}

.recent-register-card {
  position: sticky;
  top: 16px;
  display: grid;
  gap: 12px;
}

.recent-register-card .section-head {
  margin-bottom: 0;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--ksl-line);
}

.recent-register-list {
  display: grid;
  gap: 8px;
}

.recent-register-item {
  display: grid;
  gap: 3px;
  padding: 10px;
  border: 1px solid var(--ksl-line);
  border-radius: 7px;
  color: var(--ksl-ink);
  background: var(--ksl-bg);
  text-decoration: none;
}

.recent-register-item:hover,
.recent-register-item:focus {
  border-color: rgba(122, 17, 24, 0.48);
  box-shadow: 0 0 0 3px rgba(122, 17, 24, 0.08);
}

.recent-register-item strong {
  overflow: hidden;
  font-size: 0.88rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.recent-register-item .recent-reference {
  display: inline-flex;
  width: fit-content;
  max-width: 100%;
  padding: 3px 7px;
  border-radius: 6px;
  color: var(--ksl-maroon);
  background: var(--ksl-red-soft);
  font-family: ui-monospace, SFMono-Regular, Consolas, "Liberation Mono", monospace;
  font-size: 0.74rem;
  font-weight: 900;
}

.recent-register-item span,
.recent-register-item small {
  color: var(--ksl-muted);
  font-size: 0.76rem;
  font-weight: 750;
}

.simple-register-section {
  display: grid;
  gap: 14px;
  padding: 18px;
  border: 1px solid var(--ksl-line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.72);
}

.simple-register-section h2 {
  margin: 0;
  color: var(--ksl-navy);
  font-size: 1.08rem;
}

.simple-register-section[hidden] {
  display: none;
}

.simple-register-section select[multiple] {
  min-height: 132px;
}

.assignment-field {
  gap: 8px;
}

.assignment-step {
  padding-top: 4px;
}

.assignment-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.assignment-head label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.assignment-head label span {
  display: inline-grid;
  place-items: center;
  min-width: 46px;
  height: 22px;
  padding: 0 8px;
  border-radius: 999px;
  color: #fff;
  background: var(--ksl-navy);
  font-size: 0.68rem;
  font-weight: 900;
  text-transform: uppercase;
}

.assignment-count {
  color: var(--ksl-muted);
  font-size: 0.78rem;
  font-weight: 800;
}

.assignment-table {
  overflow: hidden;
  border: 1px solid var(--ksl-line);
  border-radius: var(--radius);
  background: var(--ksl-card);
}

.assignment-table-head {
  display: grid;
  gap: 8px;
  padding: 8px 10px;
  border-bottom: 1px solid var(--ksl-line);
  color: var(--ksl-muted);
  background: var(--ksl-navy-soft);
  font-size: 0.74rem;
  font-weight: 900;
  text-transform: uppercase;
}

.assignment-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 8px;
  max-height: 310px;
  overflow: auto;
  padding: 8px;
}

.assignment-grid-compact {
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  max-height: 220px;
}

.assignment-row {
  display: grid;
  gap: 8px;
  align-items: center;
  min-width: 0;
  min-height: 44px;
  padding: 8px 10px;
  border: 1px solid var(--ksl-line);
  border-radius: 7px;
  background: #fff;
  cursor: pointer;
  transition: border-color 0.18s ease, background 0.18s ease, box-shadow 0.18s ease;
}

.assignment-user-row {
  grid-template-columns: 24px minmax(116px, 1.4fr) minmax(74px, 0.8fr) minmax(88px, 1fr);
}

.assignment-department-row {
  grid-template-columns: 24px minmax(130px, 1fr) minmax(52px, 0.35fr);
}

.assignment-row:hover,
.assignment-row:focus-within {
  border-color: rgba(122, 17, 24, 0.48);
  box-shadow: 0 0 0 3px rgba(122, 17, 24, 0.08);
}

.assignment-row:has(input:checked),
.assignment-row.is-active {
  border-color: rgba(122, 17, 24, 0.55);
  background: var(--ksl-red-soft);
}

.assignment-check-cell {
  position: relative;
  display: grid;
  place-items: center;
}

.assignment-check-cell input {
  position: absolute;
  inset: 0;
  width: 18px;
  height: 18px;
  min-height: 18px;
  opacity: 0;
  pointer-events: none;
}

.assignment-checkmark {
  display: grid;
  place-items: center;
  width: 18px;
  height: 18px;
  border: 1px solid #8da0b8;
  border-radius: 5px;
  background: #fff;
  color: transparent;
  font-size: 10px;
}

.assignment-check-cell input:checked + .assignment-checkmark {
  border-color: var(--ksl-maroon);
  background: var(--ksl-maroon);
  color: #fff;
}

.assignment-primary,
.assignment-meta {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}

.assignment-primary strong {
  display: block;
  overflow: hidden;
  color: var(--ksl-ink);
  font-size: 0.86rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.assignment-primary small,
.assignment-meta {
  display: block;
  color: var(--ksl-muted);
  font-size: 0.76rem;
  font-weight: 750;
  line-height: 1.25;
}

.assignment-primary small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.assignment-table.is-invalid {
  border-color: var(--ksl-danger);
  box-shadow: 0 0 0 3px rgba(194, 65, 65, 0.12);
}

.assignment-empty-state {
  padding: 12px 14px;
  border: 1px dashed rgba(0, 51, 102, 0.25);
  border-radius: var(--radius);
  color: var(--ksl-muted);
  background: rgba(234, 241, 248, 0.55);
  font-size: 0.86rem;
  font-weight: 750;
}

.assignment-user-group {
  border-bottom: 1px solid var(--ksl-line);
  animation: assignmentReveal 0.18s ease-out;
}

.assignment-user-group:last-child {
  border-bottom: 0;
}

.assignment-group-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 10px;
  color: var(--ksl-navy);
  background: rgba(234, 241, 248, 0.42);
}

.assignment-group-head strong {
  min-width: 0;
  overflow: hidden;
  font-size: 0.88rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.assignment-group-head span {
  color: var(--ksl-muted);
  font-size: 0.74rem;
  font-weight: 850;
}

@keyframes assignmentReveal {
  from {
    opacity: 0;
    transform: translateY(-3px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

html[data-theme="dark"] .assignment-table,
html[data-theme="dark"] .assignment-row,
html[data-theme="dark"] .assignment-checkmark,
html[data-theme="dark"] .assignment-empty-state {
  background: var(--ksl-card);
}

.form-section-title {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  margin-bottom: 18px;
  padding: 14px;
  border: 1px solid var(--ksl-line);
  border-radius: var(--radius);
  background: linear-gradient(90deg, var(--ksl-navy-soft), rgba(255, 255, 255, 0.68));
}

.form-section-title span {
  display: inline-grid;
  place-items: center;
  width: 42px;
  height: 42px;
  flex: 0 0 42px;
  border-radius: 50%;
  color: #fff;
  background: var(--ksl-navy);
  box-shadow: 0 8px 18px rgba(0, 51, 102, 0.18);
}

.form-section-title h2 {
  margin: 0;
  color: var(--ksl-navy);
  font-size: 1.05rem;
}

.form-section-title p {
  margin: 3px 0 0;
  color: var(--ksl-muted);
}

.register-identity-grid {
  padding: 14px;
  border: 1px solid var(--ksl-line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.72);
}

.register-workspace {
  align-items: start;
}

.register-routing-workspace {
  width: 100%;
  grid-template-columns: minmax(0, 1fr);
}

.register-routing-workspace .register-panel {
  width: 100%;
  min-width: 0;
}

.register-routing-workspace #incomingFields,
.register-routing-workspace #outgoingFields {
  grid-template-columns: repeat(2, minmax(220px, 1fr));
}

.recipient-tools {
  display: grid;
  grid-template-columns: repeat(4, minmax(150px, 1fr));
  gap: 12px;
  align-items: end;
  padding: 14px;
  border: 1px solid var(--ksl-line);
  border-radius: var(--radius);
  background:
    linear-gradient(180deg, rgba(234, 241, 248, 0.66), transparent),
    var(--ksl-card);
}

.recipient-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 12px;
  max-height: 360px;
  overflow: auto;
  padding: 12px;
  border: 1px solid var(--ksl-line);
  border-radius: var(--radius);
  background: var(--ksl-card);
}

.recipient-card {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 10px;
  align-items: start;
  min-width: 0;
  padding: 12px;
  border: 1px solid var(--ksl-line);
  border-radius: var(--radius);
  background: #fff;
  cursor: pointer;
  transition: transform 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
}

.recipient-card:hover,
.recipient-card:focus-within {
  transform: translateY(-1px);
  border-color: var(--ksl-maroon);
  box-shadow: 0 10px 24px rgba(16, 32, 51, 0.08);
}

.recipient-card input {
  width: 18px;
  height: 18px;
  min-height: 18px;
  margin-top: 3px;
}

.recipient-card b,
.recipient-card small {
  display: block;
  overflow-wrap: anywhere;
}

.recipient-card small {
  color: var(--ksl-muted);
}

.recipient-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}

.recipient-count {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--ksl-maroon);
  font-weight: 850;
}

.department-check-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(138px, 1fr));
  gap: 7px;
  margin-top: 8px;
  padding: 12px;
  border: 1px solid rgba(0, 51, 102, 0.12);
  border-radius: 8px;
  background: rgba(234, 241, 248, 0.45);
}

.department-check {
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr);
  align-items: center;
  gap: 7px;
  min-height: 34px;
  padding: 8px 9px;
  border: 1px solid var(--ksl-line);
  border-radius: 7px;
  background: #fff;
  color: var(--ksl-text);
  cursor: pointer;
  transition: border-color .18s ease, background .18s ease, box-shadow .18s ease;
}

.department-check:hover,
.department-check:focus-within {
  border-color: var(--ksl-maroon);
  box-shadow: 0 0 0 3px rgba(122, 17, 24, 0.08);
}

.department-check input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.department-check-mark {
  display: grid;
  place-items: center;
  width: 17px;
  height: 17px;
  border: 1px solid #9aabc0;
  border-radius: 5px;
  background: #fff;
  color: transparent;
  font-size: 10px;
}

.department-check span:last-child {
  overflow-wrap: anywhere;
  font-size: 12px;
  font-weight: 700;
  line-height: 1.2;
}

.department-check:has(input:checked) {
  border-color: rgba(122, 17, 24, 0.48);
  background: var(--ksl-red-soft);
}

.department-check input:checked + .department-check-mark {
  border-color: var(--ksl-maroon);
  background: var(--ksl-maroon);
  color: #fff;
}

html[data-theme="dark"] .recipient-card {
  background: #0d2038;
}

html[data-theme="dark"] .department-check,
html[data-theme="dark"] .department-check-mark {
  background: #0d2038;
}

.register-panel {
  border: 1px solid var(--ksl-line);
  background:
    linear-gradient(180deg, rgba(234, 241, 248, 0.7), transparent 120px),
    var(--ksl-card);
}

.register-panel .section-head {
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--ksl-line);
}

.register-panel .section-head h2 {
  display: flex;
  gap: 9px;
  align-items: center;
  color: var(--ksl-navy);
}

.register-panel .section-head h2::before {
  content: "";
  display: inline-block;
  width: 9px;
  height: 24px;
  border-radius: 999px;
  background: var(--ksl-maroon);
}

.register-upload-panel .drop-zone {
  min-height: 170px;
  border-color: rgba(0, 51, 102, 0.26);
  background:
    linear-gradient(180deg, rgba(234, 241, 248, 0.88), rgba(255, 255, 255, 0.92));
}

.register-upload-panel .drop-zone:hover {
  border-color: var(--ksl-navy);
  transform: translateY(-1px);
  box-shadow: var(--shadow-sm);
}

.register-actionbar {
  position: sticky;
  bottom: 0;
  z-index: 4;
  padding: 14px;
  border: 1px solid var(--ksl-line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(12px);
}

.simple-register-form .register-actionbar {
  position: static;
}

.repo-table-wrap {
  border-color: rgba(0, 51, 102, 0.2);
  box-shadow: var(--shadow-sm);
}

.classic-repository-table {
  min-width: 1180px;
  table-layout: fixed;
}

.classic-repository-table th {
  position: sticky;
  top: 0;
  z-index: 2;
  white-space: nowrap;
  vertical-align: middle;
}

.classic-repository-table th:nth-child(1),
.classic-repository-table td:nth-child(1) {
  width: 168px;
}

.classic-repository-table th:nth-child(2),
.classic-repository-table td:nth-child(2),
.classic-repository-table th:nth-child(4),
.classic-repository-table td:nth-child(4),
.classic-repository-table th:nth-child(6),
.classic-repository-table td:nth-child(6),
.classic-repository-table th:nth-child(7),
.classic-repository-table td:nth-child(7),
.classic-repository-table th:nth-child(9),
.classic-repository-table td:nth-child(9),
.classic-repository-table th:nth-child(10),
.classic-repository-table td:nth-child(10) {
  width: 118px;
}

.classic-repository-table th:nth-child(3),
.classic-repository-table td:nth-child(3) {
  width: 280px;
}

.classic-repository-table th:nth-child(5),
.classic-repository-table td:nth-child(5),
.classic-repository-table th:nth-child(8),
.classic-repository-table td:nth-child(8),
.classic-repository-table th:nth-child(11),
.classic-repository-table td:nth-child(11),
.classic-repository-table th:nth-child(12),
.classic-repository-table td:nth-child(12) {
  width: 150px;
}

.classic-repository-table th:nth-child(13),
.classic-repository-table td:nth-child(13) {
  width: 190px;
}

.classic-repository-table td {
  vertical-align: top;
}

.classic-repository-table tbody tr:nth-child(even) {
  background: rgba(234, 241, 248, 0.45);
}

.classic-repository-table tbody tr:hover {
  background: var(--row-hover);
}

.repo-number-cell {
  background: rgba(234, 241, 248, 0.48);
}

.repo-subject-cell .cell-truncate {
  color: var(--ksl-navy);
  font-weight: 800;
}

.repo-actions-cell .actions {
  align-items: stretch;
}

.repo-actions-cell .btn {
  justify-content: center;
}

.report-option-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(120px, 1fr));
  gap: 10px;
}

.report-option-grid a {
  display: grid;
  gap: 7px;
  justify-items: center;
  min-height: 86px;
  padding: 14px 10px;
  border: 1px solid var(--ksl-line);
  border-radius: var(--radius);
  color: var(--ksl-navy);
  background: var(--ksl-card);
  text-align: center;
  text-decoration: none;
  font-weight: 850;
}

.report-option-grid a i {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  color: #fff;
  background: var(--ksl-navy);
  border-radius: 50%;
}

.report-option-grid a.active,
.report-option-grid a:hover {
  border-color: rgba(122, 17, 24, 0.34);
  background: var(--ksl-red-soft);
}

.report-bars {
  display: grid;
  gap: 10px;
  margin-top: 14px;
}

.editor-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 8px;
  border: 1px solid var(--ksl-line);
  border-bottom: 0;
  border-radius: var(--radius) var(--radius) 0 0;
  background: var(--ksl-navy-soft);
}

.editor-toolbar + textarea {
  border-top-left-radius: 0;
  border-top-right-radius: 0;
}

html[data-theme="dark"] .form-section-title,
html[data-theme="dark"] .register-identity-grid,
html[data-theme="dark"] .register-panel,
html[data-theme="dark"] .register-actionbar,
html[data-theme="dark"] .repo-number-cell {
  background: var(--ksl-card);
}

html[data-theme="dark"] .classic-repository-table tbody tr:nth-child(even) {
  background: rgba(255, 255, 255, 0.03);
}

@media (max-width: 1120px) {
  .simple-register-top {
    grid-template-columns: 1fr;
  }

  .register-form-panel {
    grid-template-columns: 1fr;
  }

  .recent-register-card {
    position: static;
  }

  .simple-number-preview .quick-actions {
    justify-content: flex-start;
  }

  .report-option-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .register-actionbar {
    position: static;
  }

  .classic-repository-table {
    min-width: 0;
  }

  .classic-repository-table thead {
    display: none;
  }

  .classic-repository-table,
  .classic-repository-table tbody,
  .classic-repository-table tr,
  .classic-repository-table td {
    display: block;
    width: 100% !important;
  }

  .classic-repository-table tr {
    margin: 0 0 14px;
    border: 1px solid var(--ksl-line);
    border-radius: var(--radius);
    background: var(--ksl-card);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
  }

  .classic-repository-table td {
    display: grid;
    grid-template-columns: 138px minmax(0, 1fr);
    gap: 12px;
    border-bottom: 1px solid var(--ksl-line);
  }

  .classic-repository-table td::before {
    content: attr(data-label);
    color: var(--ksl-muted);
    font-size: 0.78rem;
    font-weight: 900;
    text-transform: uppercase;
  }

  .classic-repository-table td:last-child {
    border-bottom: 0;
  }

  .repo-actions-cell .actions {
    flex-direction: row;
  }
}

@media (max-width: 680px) {
  .assignment-table-head {
    display: none;
  }

  .assignment-grid {
    grid-template-columns: 1fr;
    max-height: 360px;
  }

  .assignment-user-row,
  .assignment-department-row {
    grid-template-columns: 24px minmax(0, 1fr);
  }

  .assignment-user-row .assignment-meta,
  .assignment-department-row .assignment-meta {
    grid-column: 2;
  }
}

@media (max-width: 860px) {
  .topbar {
    grid-template-columns: auto minmax(0, 1fr);
  }

  .topbar-actions {
    grid-column: 1 / -1;
  }

  .mobile-menu-toggle {
    align-self: start;
    width: 38px;
  }
}

/* Darta 9: flat, compact workspace and final overflow safeguards. */
:root {
  --radius: 10px;
  --shadow-sm: 0 2px 9px rgba(16, 32, 51, 0.055);
  --shadow-md: 0 8px 26px rgba(16, 32, 51, 0.09);
}

html,
body {
  width: 100%;
  max-width: 100%;
  overflow-x: hidden;
}

:where(.app-shell, .main-shell, .content, .page-container, .card, .grid, .grid > *, .section-head, .section-head > *, .topbar, .topbar > *, .topbar-actions, .filter-bar, .form-grid, .quick-actions, .actions) {
  min-width: 0;
}

:where(p, dd, td, code, pre, .card-subtitle, .field-hint, .nav-link, .profile-block, .activity-item, .metric-row) {
  overflow-wrap: anywhere;
}

img,
svg,
canvas,
video,
iframe {
  max-width: 100%;
}

input,
select,
textarea,
button {
  max-width: 100%;
}

pre,
code {
  white-space: pre-wrap;
  word-break: break-word;
}

.app-shell {
  grid-template-columns: 252px minmax(0, 1fr);
  background: var(--ksl-bg);
}

.sidebar {
  padding: 14px 12px 18px;
  scrollbar-width: thin;
  background:
    linear-gradient(180deg, rgba(6, 37, 72, 0.985), rgba(62, 11, 16, 0.97)),
    var(--ksl-maroon-dark);
}

.brand-lockup {
  grid-template-columns: 44px minmax(0, 1fr);
  gap: 10px;
  padding: 2px 6px 14px;
}

.brand-lockup img {
  width: 44px;
  height: 44px;
  padding: 5px;
}

.brand-lockup strong {
  font-size: 0.94rem;
}

.brand-lockup span {
  margin-top: 2px;
  font-size: 0.7rem;
}

.sidebar-profile {
  margin: 12px 0 6px;
  padding: 9px 10px;
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.065);
  box-shadow: none;
}

.sidebar-profile .avatar {
  width: 32px;
  height: 32px;
  flex-basis: 32px;
  font-size: 0.8rem;
}

.sidebar-profile b {
  font-size: 0.82rem;
}

.sidebar-profile small {
  font-size: 0.68rem;
}

.nav-group {
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px solid rgba(255, 255, 255, 0.085);
}

.nav-group:first-child {
  border-top: 0;
}

.nav-label {
  margin: 0 0 5px 10px;
  font-size: 0.62rem;
  letter-spacing: 0.11em;
}

.nav-sub {
  margin: 8px 0 4px 10px;
  font-size: 0.68rem;
}

.nav-link {
  gap: 9px;
  min-height: 34px;
  margin-bottom: 2px;
  padding: 6px 9px;
  border-radius: 8px;
  font-size: 0.8rem;
  line-height: 1.15;
}

.nav-link:hover,
.nav-link.active {
  transform: none;
  background: rgba(255, 255, 255, 0.13);
}

.nav-link.active::after {
  position: absolute;
  right: 7px;
  width: 3px;
  height: 16px;
  border-radius: 3px;
  background: #f0cf76;
  content: "";
}

.nav-link i {
  width: 16px;
  font-size: 0.82rem;
}

.nav-link .badge-dot {
  min-width: 18px;
  height: 18px;
  font-size: 0.62rem;
}

.main-shell {
  width: 100%;
  max-width: 100%;
}

.topbar {
  min-height: 68px;
  padding: 10px 20px;
  border-bottom: 1px solid var(--ksl-line);
  background: color-mix(in srgb, var(--ksl-card) 94%, transparent);
  box-shadow: none;
  backdrop-filter: blur(14px);
}

.topbar h1 {
  font-size: clamp(1rem, 1.4vw, 1.3rem);
}

.topbar .eyebrow {
  margin-bottom: 1px;
  font-size: 0.6rem;
}

.topbar-actions {
  gap: 7px;
}

.topbar-search input {
  min-width: 180px !important;
  height: 34px;
}

.profile-block {
  padding: 5px 8px;
}

.profile-block small {
  max-width: 260px;
  white-space: normal;
}

.content,
.page-container {
  width: 100%;
  max-width: 100%;
  padding: clamp(14px, 2vw, 26px);
}

.portal-frame {
  display: block;
  width: 100%;
  min-width: 0;
  height: calc(100vh - 69px);
  border: 0;
  background: var(--ksl-bg);
}

.card {
  border: 1px solid var(--ksl-line);
  box-shadow: var(--shadow-sm);
}

.card-pad {
  padding: clamp(13px, 1.5vw, 18px);
}

.section-head,
.page-heading {
  gap: 12px;
  margin-bottom: 14px;
}

.section-head h1,
.page-heading h1 {
  font-size: clamp(1.35rem, 2vw, 1.8rem);
  line-height: 1.16;
}

.section-head h2,
.page-heading h2,
.card h2 {
  font-size: clamp(1rem, 1.2vw, 1.18rem);
}

.btn {
  min-height: 32px;
  padding: 6px 10px;
  border-radius: 8px;
  box-shadow: none;
  font-size: 0.78rem;
  line-height: 1.15;
}

.btn-sm {
  min-height: 27px;
  padding: 4px 7px;
  font-size: 0.7rem;
}

.form-field {
  min-width: 0;
}

.form-field input,
.form-field select,
.form-field textarea {
  width: 100%;
}

.filter-bar {
  grid-template-columns: repeat(auto-fit, minmax(135px, 1fr));
  gap: 9px;
}

.filter-bar .form-field label,
.form-field > label:first-child {
  margin-bottom: 4px;
  font-size: 0.72rem;
}

input,
select {
  min-height: 34px;
  padding: 6px 9px;
}

textarea {
  padding: 8px 9px;
}

.table-wrap,
.repo-table-wrap {
  position: relative;
  overflow-x: auto;
  overflow-y: visible;
  overscroll-behavior-inline: contain;
  border: 1px solid var(--ksl-line);
  border-radius: 10px;
  background: var(--ksl-card);
  box-shadow: none;
}

.table-wrap > table,
.repo-table-wrap > table {
  width: 100%;
  max-width: 100%;
  margin: 0;
}

table th,
table td {
  padding: 7px 8px;
  border-bottom-color: var(--ksl-line);
  font-size: 0.76rem;
  line-height: 1.22;
  vertical-align: middle;
}

table th {
  position: sticky;
  top: 0;
  z-index: 2;
  padding-top: 8px;
  padding-bottom: 8px;
  color: var(--ksl-muted);
  background: color-mix(in srgb, var(--ksl-card) 92%, var(--ksl-navy-soft));
  font-size: 0.66rem;
  letter-spacing: 0.045em;
  text-transform: uppercase;
}

table tbody tr:last-child td {
  border-bottom: 0;
}

table .actions,
table .quick-actions {
  gap: 4px;
}

.document-register-table {
  min-width: 0 !important;
  table-layout: fixed !important;
}

.document-register-table .repo-col-ref { width: 13%; }
.document-register-table .repo-col-document { width: 25%; }
.document-register-table .repo-col-parties { width: 22%; }
.document-register-table .repo-col-date { width: 13%; }
.document-register-table .repo-col-status { width: 11%; }
.document-register-table .repo-col-actions { width: 16%; }

.document-register-table td {
  height: auto;
  padding: 6px 7px;
}

.document-register-table .repo-inline-meta,
.document-register-table .repo-party-line {
  gap: 4px;
  margin-top: 2px;
}

.document-register-table .repo-action-grid {
  grid-template-columns: repeat(4, minmax(25px, 1fr));
  gap: 3px;
}

.document-register-table .repo-action-grid .btn {
  min-width: 0;
  min-height: 25px;
  padding: 3px 4px;
}

.document-register-table .repo-action-label {
  display: none;
}

.user-table th,
.user-table td {
  padding: 5px 7px;
  line-height: 1.15;
}

.user-table tbody tr {
  height: auto;
}

.dashboard-balance-grid {
  grid-template-columns: minmax(0, 1.35fr) minmax(330px, 0.65fr);
  align-items: stretch;
}

.dashboard-calendar-widget {
  min-height: 370px;
  padding: 10px;
}

.calendar-toolbar,
.calendar-subtoolbar {
  margin-bottom: 7px;
}

.calendar-month-grid {
  gap: 3px;
  grid-auto-rows: minmax(40px, 1fr);
}

.calendar-day {
  min-height: 40px;
  padding: 4px;
  font-size: clamp(1rem, 0.35vw + 0.92rem, 1.12rem);
}

.calendar-legend,
.calendar-agenda {
  margin-top: 8px;
}

@media (max-width: 1180px) {
  .dashboard-balance-grid {
    grid-template-columns: minmax(0, 1fr) minmax(310px, 0.8fr);
  }

  .document-register-table .repo-action-grid {
    grid-template-columns: repeat(3, minmax(25px, 1fr));
  }
}

@media (max-width: 980px) {
  .dashboard-balance-grid {
    grid-template-columns: 1fr;
  }

  .topbar-actions {
    flex-wrap: wrap;
  }
}

@media (max-width: 860px) {
  .app-shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    width: min(280px, 88vw);
  }

  .portal-frame {
    height: calc(100vh - 64px);
  }
}

@media (max-width: 760px) {
  .document-register-table {
    table-layout: auto !important;
  }

  .dashboard-calendar-widget {
    min-height: 350px;
  }

  .calendar-month-grid {
    grid-auto-rows: minmax(39px, 1fr);
  }

  .calendar-day {
    min-height: 39px;
    font-size: 0.98rem;
  }
}

/* Compact document-aware calendar and action-level RBAC. */
@media (min-width: 1101px) {
  .dashboard-balance-grid {
    grid-template-columns: minmax(0, 1.55fr) minmax(330px, 0.72fr);
    align-items: start;
  }
}

.dashboard-balance-grid .dashboard-equal-card {
  min-height: 0;
}

.dashboard-calendar-card {
  align-self: start;
}

.dashboard-calendar-widget {
  gap: 7px;
  min-height: 0;
  padding: 11px;
  grid-template-rows: auto auto auto auto minmax(74px, auto);
}

.dashboard-calendar-widget .calendar-toolbar {
  gap: 7px;
}

.dashboard-calendar-widget .calendar-subtoolbar {
  padding: 5px 8px;
}

.dashboard-calendar-widget .calendar-month-grid {
  gap: 4px;
  grid-auto-rows: 35px;
}

.dashboard-calendar-widget .calendar-weekday {
  min-height: 24px;
  font-size: 0.72rem;
}

.dashboard-calendar-widget .calendar-day {
  position: relative;
  min-height: 35px;
  padding: 3px 2px 8px;
  border-radius: 7px;
  font-size: clamp(0.92rem, 0.24vw + 0.88rem, 1.03rem);
}

.calendar-day.is-selected:not(.is-today) {
  border-color: var(--ksl-navy);
  box-shadow: inset 0 0 0 1px var(--ksl-navy);
}

.calendar-day.is-weekly-holiday:not(.is-today) {
  color: var(--ksl-maroon);
}

.calendar-event-dots {
  position: absolute;
  bottom: 3px;
  left: 50%;
  display: inline-flex;
  gap: 3px;
  transform: translateX(-50%);
}

.holiday-dot,
.document-dot {
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 999px;
}

.holiday-dot { background: var(--ksl-maroon); }
.document-dot { background: #1677c8; }
.calendar-day.is-today .holiday-dot { background: #ffd875; }
.calendar-day.is-today .document-dot { background: #bde3ff; }

.calendar-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 12px;
  align-items: center;
  color: var(--ksl-muted);
  font-size: 0.68rem;
}

.calendar-legend span {
  display: inline-flex;
  gap: 5px;
  align-items: center;
}

.calendar-agenda {
  display: grid;
  gap: 5px;
  max-height: 118px;
  padding-top: 7px;
  overflow: auto;
  border-top: 1px solid var(--ksl-line);
  scrollbar-width: thin;
}

.calendar-agenda-head {
  position: sticky;
  top: 0;
  z-index: 1;
  display: flex;
  justify-content: space-between;
  padding: 1px 2px 4px;
  color: var(--ksl-muted);
  background: var(--ksl-card);
  font-size: 0.7rem;
}

.calendar-agenda-head b { color: var(--ksl-ink); }

.calendar-agenda-item {
  display: grid;
  grid-template-columns: 24px minmax(0, 1fr);
  gap: 7px;
  align-items: start;
  padding: 5px 6px;
  border: 1px solid var(--ksl-line);
  border-radius: 7px;
  color: var(--ksl-ink);
  background: var(--ksl-card);
  text-decoration: none;
}

.calendar-agenda-item:hover { border-color: var(--ksl-gold); }
.calendar-agenda-item b,
.calendar-agenda-item small,
.calendar-agenda-item .ksl-user-content { display: block; }
.calendar-agenda-item b { font-size: 0.72rem; line-height: 1.25; }
.calendar-agenda-item small,
.calendar-agenda-item .ksl-user-content { margin-top: 2px; color: var(--ksl-muted); font-size: 0.65rem; line-height: 1.2; }

.calendar-agenda-icon {
  display: grid;
  width: 24px;
  height: 24px;
  place-items: center;
  border-radius: 6px;
  color: var(--ksl-maroon);
  background: var(--ksl-gold-soft);
  font-size: 0.68rem;
}

.calendar-agenda-icon.is-document { color: #1266a5; background: #e7f3ff; }
.calendar-agenda-empty { padding: 9px; color: var(--ksl-muted); text-align: center; font-size: 0.7rem; }

.rbac-role-picker { max-width: 420px; }
.rbac-groups { display: grid; gap: 14px; margin-top: 16px; }
.rbac-group { min-width: 0; padding: 14px; border: 1px solid var(--ksl-line); border-radius: var(--radius); }
.rbac-group legend { padding: 0 8px; color: var(--ksl-navy); font-weight: 800; }
.rbac-capability-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 8px; }
.rbac-capability-card { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 9px; align-items: start; min-width: 0; padding: 10px; border: 1px solid var(--ksl-line); border-radius: 9px; background: var(--ksl-card); }
.rbac-capability-card.is-enabled { border-color: rgba(0, 51, 102, 0.34); background: color-mix(in srgb, var(--ksl-gold-soft) 28%, var(--ksl-card)); }
.rbac-capability-card input { margin-top: 3px; }
.rbac-capability-card b,
.rbac-capability-card small,
.rbac-capability-card code { display: block; min-width: 0; }
.rbac-capability-card small { margin-top: 3px; color: var(--ksl-muted); line-height: 1.3; }
.rbac-capability-card code { margin-top: 5px; color: var(--ksl-navy); font-size: 0.66rem; overflow-wrap: anywhere; }

.workflow-kanban {
  display: grid;
  grid-template-columns: repeat(5, minmax(190px, 1fr));
  gap: 9px;
  padding-bottom: 6px;
  overflow-x: auto;
}

.workflow-kanban-column {
  min-width: 190px;
  padding: 9px;
  border: 1px solid var(--ksl-line);
  border-radius: 10px;
  background: var(--ksl-bg);
}

.workflow-kanban-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.workflow-kanban-head h3 { margin: 0; font-size: 0.84rem; }
.workflow-kanban-stack { display: grid; gap: 7px; }
.workflow-kanban-card { display: block; min-width: 0; padding: 8px; border: 1px solid var(--ksl-line); border-left: 3px solid var(--ksl-navy); border-radius: 8px; color: var(--ksl-ink); background: var(--ksl-card); text-decoration: none; box-shadow: var(--shadow-sm); }
.workflow-kanban-card.is-overdue { border-left-color: var(--ksl-maroon); }
.workflow-kanban-card b,
.workflow-kanban-card small { display: block; min-width: 0; overflow-wrap: anywhere; }
.workflow-kanban-card b { font-size: 0.75rem; line-height: 1.3; }
.workflow-kanban-card small { margin-top: 4px; color: var(--ksl-muted); font-size: 0.67rem; }
.workflow-kanban-empty { padding: 12px 4px; color: var(--ksl-muted); text-align: center; font-size: 0.7rem; }

html[data-theme="dark"] .calendar-agenda-head { background: var(--ksl-card); }
html[data-theme="dark"] .calendar-agenda-icon.is-document { background: rgba(22, 119, 200, 0.22); color: #8cc9f7; }

@media (max-width: 760px) {
  .dashboard-calendar-widget { min-height: 0; padding: 9px; }
  .dashboard-calendar-widget .calendar-month-grid { grid-auto-rows: 34px; }
  .dashboard-calendar-widget .calendar-day { min-height: 34px; font-size: 0.92rem; }
  .calendar-agenda { max-height: 142px; }
  .rbac-capability-grid { grid-template-columns: 1fr; }
}

/* KSL Darta completion layer: dense registers, movement tree, report studio and bulk tools. */
html,
body,
.app-shell,
.main-shell,
.content,
.page-container {
  min-width: 0;
  max-width: 100%;
}

body,
.main-shell,
.content,
.page-container {
  overflow-x: hidden;
}

.table-wrap {
  width: 100%;
  min-width: 0;
  max-width: 100%;
}

.table-wrap > table:not(.smart-table) {
  table-layout: fixed;
}

.table-wrap > table:not(.smart-table) th,
.table-wrap > table:not(.smart-table) td {
  padding: 6px 8px;
  line-height: 1.2;
  overflow-wrap: anywhere;
}

.table-wrap > table:not(.smart-table) td > b,
.table-wrap > table:not(.smart-table) td > small {
  display: block;
  min-width: 0;
}

.table-wrap > table:not(.smart-table) td > small {
  margin-top: 2px;
  line-height: 1.15;
}

.classic-repository-table tbody tr {
  height: auto;
  min-height: 54px;
}

.classic-repository-table td {
  padding: 5px 7px;
}

.repo-action-grid {
  grid-template-columns: repeat(3, minmax(26px, 1fr));
  gap: 3px;
}

.repo-action-grid .btn {
  min-height: 25px;
  padding: 3px 4px;
}

.repo-file-meta,
.repo-meta-line,
.repo-date-cell small {
  margin-top: 2px;
}

.user-table.smart-table td,
.user-table td {
  padding-top: 5px;
  padding-bottom: 5px;
  line-height: 1.16;
}

.user-table .avatar,
.user-table .profile-photo {
  width: 32px;
  height: 32px;
}

.dashboard-calendar-widget {
  min-height: 450px;
}

.calendar-month-grid {
  grid-auto-rows: minmax(50px, 1fr);
}

.calendar-day {
  min-height: 50px;
  font-size: clamp(1.06rem, 0.42vw + 0.96rem, 1.22rem);
}

.calendar-day.is-today,
html[data-theme="dark"] .calendar-day.is-today {
  font-size: 1.2rem;
}

.movement-summary {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 16px;
  align-items: center;
  margin-bottom: 18px;
  border-left: 5px solid var(--ksl-maroon);
}

.movement-workspace {
  align-items: start;
}

.movement-picker {
  grid-template-columns: minmax(240px, 1fr) auto;
}

.movement-tree-wrap {
  overflow-x: auto;
  padding: 4px 4px 4px 0;
}

.movement-tree {
  min-width: 0;
  margin: 0;
  padding-left: 28px;
  list-style: none;
}

.movement-tree:first-child {
  padding-left: 0;
}

.movement-tree .movement-tree {
  position: relative;
  margin: 8px 0 0 18px;
  border-left: 2px solid rgba(122, 17, 24, 0.2);
}

.movement-tree .movement-tree > li::before {
  content: "";
  position: absolute;
  width: 18px;
  margin-top: 26px;
  margin-left: -28px;
  border-top: 2px solid rgba(122, 17, 24, 0.2);
}

.movement-tree li + li {
  margin-top: 8px;
}

.movement-node {
  min-width: 260px;
  padding: 11px 13px;
  border: 1px solid var(--ksl-line);
  border-left: 4px solid var(--ksl-maroon);
  border-radius: 10px;
  background: var(--ksl-card);
  box-shadow: var(--shadow-sm);
}

.movement-node-head,
.comment-head {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  align-items: center;
}

.movement-node-head time,
.comment-head time {
  margin-left: auto;
  color: var(--ksl-muted);
  font-size: 0.74rem;
}

.movement-kind {
  color: var(--ksl-maroon);
  font-weight: 800;
}

.movement-node p {
  margin: 6px 0 0;
}

.comment-timeline {
  display: grid;
  gap: 0;
}

.comment-entry {
  position: relative;
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  gap: 12px;
  padding: 12px 0;
}

.comment-entry:not(:last-child)::before {
  content: "";
  position: absolute;
  top: 43px;
  bottom: -2px;
  left: 16px;
  width: 2px;
  background: var(--ksl-line);
}

.comment-marker {
  z-index: 1;
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border-radius: 50%;
  color: #fff;
  background: var(--ksl-maroon);
}

.comment-entry p {
  margin: 7px 0 4px;
}

.report-filter-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(130px, 1fr));
  gap: 10px;
  align-items: end;
}

.report-keyword {
  grid-column: span 2;
}

.preset-list {
  display: grid;
  gap: 8px;
  max-height: 260px;
  overflow: auto;
}

.preset-item {
  display: flex;
  gap: 10px;
  align-items: center;
  justify-content: space-between;
  padding: 9px 11px;
  border: 1px solid var(--ksl-line);
  border-radius: 9px;
  color: inherit;
  background: var(--ksl-bg);
  text-decoration: none;
}

.preset-item small {
  display: block;
  margin-top: 2px;
  color: var(--ksl-muted);
}

.bulk-studio-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.6fr) minmax(280px, 0.75fr);
  gap: 18px;
  align-items: stretch;
}

.bulk-action-card,
.bulk-history-card,
.bulk-feedback {
  margin-top: 18px;
}

.step-badge {
  display: inline-grid;
  width: 28px;
  height: 28px;
  margin-bottom: 7px;
  place-items: center;
  border-radius: 8px;
  color: #fff;
  background: var(--ksl-maroon);
  font-size: 0.82rem;
  font-weight: 800;
}

.bulk-file-drop label {
  display: flex;
  min-height: 88px;
  gap: 13px;
  align-items: center;
  justify-content: center;
  padding: 15px;
  border: 2px dashed rgba(122, 17, 24, 0.28);
  border-radius: 12px;
  color: var(--ksl-maroon);
  background: color-mix(in srgb, var(--ksl-gold-soft) 34%, var(--ksl-card));
  cursor: pointer;
}

.bulk-file-drop label i {
  font-size: 1.45rem;
}

.bulk-file-drop label small,
.bulk-file-drop label b {
  display: block;
}

.bulk-file-drop label small {
  margin-top: 3px;
  color: var(--ksl-muted);
  font-weight: 500;
}

.bulk-file-drop input {
  margin-top: 8px;
}

.compact-form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.check-list {
  display: grid;
  gap: 12px;
  padding: 0;
  list-style: none;
}

.check-list li {
  display: grid;
  grid-template-columns: 22px minmax(0, 1fr);
  gap: 7px;
  color: var(--ksl-muted);
}

.check-list i {
  color: var(--ksl-success);
}

.admin-import-details {
  margin-top: 18px;
  padding-top: 14px;
  border-top: 1px solid var(--ksl-line);
}

.admin-import-details summary,
.bulk-feedback summary {
  cursor: pointer;
}

.admin-import-details form,
.bulk-feedback-list {
  margin-top: 12px;
}

.bulk-feedback-list {
  display: grid;
  gap: 6px;
  max-height: 250px;
  overflow: auto;
}

.bulk-feedback-list .alert {
  margin: 0;
  padding: 8px 10px;
}

.bulk-action-options {
  display: grid;
  grid-template-columns: minmax(250px, 0.7fr) minmax(0, 1.3fr);
  gap: 12px;
  margin-bottom: 14px;
}

.bulk-action-options fieldset {
  min-width: 0;
  margin: 0;
  padding: 12px;
  border: 1px solid var(--ksl-line);
  border-radius: 10px;
  background: var(--ksl-bg);
}

.bulk-action-options legend {
  padding: 0 6px;
  font-weight: 800;
}

.bulk-action-options .btn {
  margin-top: 10px;
}

.compact-table-wrap {
  max-height: min(58vh, 620px);
  overflow: auto;
}

.bulk-selection-table th:first-child,
.bulk-selection-table td:first-child {
  width: 42px;
  text-align: center;
}

.bulk-selection-table th:nth-child(2) { width: 15%; }
.bulk-selection-table th:nth-child(3) { width: 31%; }
.bulk-selection-table th:nth-child(4) { width: 11%; }
.bulk-selection-table th:nth-child(5) { width: 12%; }
.bulk-selection-table th:nth-child(6) { width: 12%; }
.bulk-selection-table th:nth-child(7) { width: 14%; }

.bulk-document-checkbox {
  width: 17px;
  min-height: 17px;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

@media (max-width: 1150px) {
  .report-filter-grid {
    grid-template-columns: repeat(3, minmax(150px, 1fr));
  }

  .bulk-studio-grid,
  .bulk-action-options {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 760px) {
  .dashboard-calendar-widget {
    min-height: 410px;
  }

  .calendar-month-grid {
    grid-auto-rows: minmax(43px, 1fr);
  }

  .calendar-day {
    min-height: 43px;
    font-size: 1rem;
  }

  .movement-summary,
  .movement-picker,
  .report-filter-grid,
  .compact-form-grid {
    grid-template-columns: 1fr;
  }

  .report-keyword {
    grid-column: auto;
  }

  .movement-tree {
    padding-left: 16px;
  }

  .compact-table-wrap > table {
    min-width: 720px;
  }
}

@media (max-width: 980px) {
  .register-stepper {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .recipient-tools {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .recipient-grid {
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  }

  .review-summary dl {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 680px) {
  .register-stepper {
    grid-template-columns: 1fr;
  }

  .stepper-item {
    min-height: 44px;
  }

  .input-action-row,
  .recipient-tools,
  .register-routing-workspace #incomingFields,
  .register-routing-workspace #outgoingFields,
  .review-summary dl {
    grid-template-columns: 1fr;
  }

  .register-nav {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }

  .register-nav .btn {
    width: 100%;
  }

  .dashboard-equal-card {
    min-height: auto;
  }

  .calendar-month-grid {
    gap: 4px;
  }

  .calendar-day {
    min-height: 28px;
    padding: 3px 1px;
    font-size: 0.76rem;
  }

  .calendar-day-note {
    display: none;
  }
}

.main-shell {
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: grid;
  grid-template-columns: auto minmax(220px, 1fr) auto;
  align-items: center;
  gap: 16px;
  min-height: 76px;
  padding: 16px 26px;
  background: rgba(245, 247, 251, 0.88);
  border-bottom: 1px solid var(--ksl-line);
  backdrop-filter: blur(14px);
}

.topbar > div:first-of-type {
  min-width: 0;
}

html[data-theme="dark"] .topbar {
  background: rgba(7, 20, 38, 0.9);
}

html[data-theme="dark"] .topbar h1,
html[data-theme="dark"] .page-title h1,
html[data-theme="dark"] h1,
html[data-theme="dark"] h2,
html[data-theme="dark"] h3,
html[data-theme="dark"] label {
  color: #eef4ff;
}

html[data-theme="dark"] .eyebrow {
  color: #f3d47a;
}

html[data-theme="dark"] a {
  color: #9fc8ff;
}

.topbar h1,
.page-title h1 {
  margin: 0;
  color: var(--ksl-ink);
  font-size: clamp(1.35rem, 2vw, 1.9rem);
  letter-spacing: 0;
}

.eyebrow {
  margin: 0 0 4px;
  color: var(--ksl-maroon);
  font-size: 0.76rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.topbar-actions {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
  justify-content: flex-end;
  min-width: 0;
}

.mobile-menu-toggle {
  display: none !important;
}

.topbar-actions > .profile-block {
  flex: 0 1 380px;
}

.topbar-search,
.topbar-actions form {
  flex: 1 1 220px;
  min-width: 180px;
  max-width: 320px;
}

.topbar-search input[type="search"] {
  min-width: 0 !important;
}

.profile-block {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  min-width: min(100%, 260px);
  padding: 8px 10px;
  border: 1px solid var(--ksl-line);
  border-radius: var(--radius);
  color: var(--ksl-ink);
  background: var(--ksl-card);
}

.profile-block img,
.profile-photo {
  width: 42px;
  height: 42px;
  object-fit: cover;
  border: 2px solid var(--ksl-navy-soft);
  border-radius: 50%;
}

.profile-block b,
.profile-block small {
  display: block;
  min-width: 0;
  overflow-wrap: anywhere;
}

.profile-block small {
  color: var(--ksl-muted);
  line-height: 1.35;
}

.quick-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 6px;
}

.content {
  width: 100%;
  max-width: 1480px;
  margin: 0 auto;
  padding: 26px;
}

.portal-frame {
  width: 100%;
  min-height: calc(100vh - 77px);
  border: 0;
  background: transparent;
}

.portal-hero {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(240px, 360px);
  gap: 24px;
  align-items: center;
  margin-bottom: 22px;
  padding: clamp(20px, 3vw, 32px);
  overflow: hidden;
  color: #fff;
  background:
    linear-gradient(135deg, rgba(11, 45, 87, 0.96), rgba(111, 21, 27, 0.9)),
    var(--ksl-navy);
  border-radius: var(--radius);
  box-shadow: var(--shadow-md);
}

.portal-hero::before {
  content: "";
  position: absolute;
  inset: auto -80px -120px auto;
  width: 280px;
  height: 280px;
  border: 44px solid rgba(255, 255, 255, 0.08);
  border-radius: 50%;
}

.portal-hero h2 {
  position: relative;
  z-index: 1;
  max-width: 760px;
  margin: 0;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(1.65rem, 3vw, 2.55rem);
  line-height: 1.08;
}

.portal-hero p:not(.eyebrow) {
  position: relative;
  z-index: 1;
  max-width: 660px;
  color: rgba(255, 255, 255, 0.84);
  margin: 10px 0 0;
}

.portal-hero img {
  position: relative;
  z-index: 1;
  width: 100%;
  max-height: 230px;
  object-fit: contain;
  animation: float-soft 5.2s ease-in-out infinite;
}

.portal-hero .eyebrow {
  color: #f3d47a;
}

@keyframes float-soft {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-8px); }
}

.grid {
  display: grid;
  gap: 18px;
}

.grid-2 {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.grid-3 {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.grid-4 {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.card {
  background: var(--ksl-card);
  border: 1px solid var(--ksl-line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  animation: card-in 0.28s ease both;
}

@keyframes card-in {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.card-pad {
  padding: 20px;
}

.stat-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 46px;
  gap: 12px;
  align-items: start;
  padding: 18px;
  border-top: 4px solid var(--ksl-maroon);
}

.stat-card p {
  margin: 0;
  color: var(--ksl-muted);
  font-size: 0.9rem;
}

.stat-card strong {
  display: block;
  margin-top: 8px;
  font-size: 2rem;
  line-height: 1;
}

.stat-icon {
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  border-radius: var(--radius);
  color: var(--ksl-navy);
  background: var(--ksl-navy-soft);
}

.view-controls {
  display: inline-flex;
  gap: 5px;
  padding: 4px;
  border: 1px solid var(--ksl-line);
  border-radius: var(--radius);
  background: var(--ksl-card);
}

.view-controls .btn {
  color: var(--ksl-ink);
}

.view-controls .btn:disabled {
  opacity: 0.42;
  cursor: not-allowed;
}

.appearance-control {
  display: grid;
  grid-template-columns: auto minmax(150px, 1fr) auto auto;
  gap: 10px;
  align-items: center;
  max-width: 520px;
}

.appearance-control input[type="range"] {
  min-height: 38px;
  padding: 0;
  accent-color: var(--ksl-maroon);
}

.appearance-control strong {
  min-width: 52px;
  color: var(--ksl-ink);
  text-align: right;
  white-space: nowrap;
}

.script-font-control {
  display: grid;
  grid-template-columns: minmax(180px, 250px) minmax(0, 1fr);
  gap: 12px;
  align-items: center;
  max-width: 720px;
}

.script-font-preview {
  min-width: 0;
  padding: 11px 14px;
  border: 1px solid var(--ksl-line);
  border-radius: var(--radius);
  color: var(--ksl-ink);
  background: var(--ksl-bg);
  font-family: var(--ksl-content-font-family);
  font-size: 1.1rem;
  line-height: 1.45;
  overflow-wrap: anywhere;
}

@media (max-width: 640px) {
  .script-font-control {
    grid-template-columns: 1fr;
  }
}

.section-head {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: center;
  margin-bottom: 16px;
}

.section-head h2,
.card h2 {
  margin: 0;
  font-size: 1.1rem;
}

.section-head p,
.card-subtitle {
  margin: 4px 0 0;
  color: var(--ksl-muted);
  font-size: 0.9rem;
}

.btn,
button.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 39px;
  border: 1px solid transparent;
  border-radius: var(--radius);
  padding: 9px 14px;
  font: inherit;
  font-weight: 750;
  text-decoration: none;
  cursor: pointer;
  max-width: 100%;
  white-space: normal;
  overflow-wrap: anywhere;
  line-height: 1.2;
}

.btn-primary {
  color: #fff;
  background: var(--ksl-maroon);
}

.btn-primary:hover {
  background: var(--ksl-navy-700);
}

.btn-secondary {
  color: #fff;
  background: var(--ksl-red);
}

.btn-outline {
  color: var(--ksl-ink);
  background: var(--ksl-card);
  border-color: var(--ksl-line);
}

html[data-theme="dark"] .btn-outline {
  color: var(--ksl-ink);
}

.btn-danger {
  color: #fff;
  background: var(--ksl-danger);
}

.btn-success {
  color: #fff;
  background: var(--ksl-success);
}

.btn-sm {
  min-height: 32px;
  padding: 6px 10px;
  font-size: 0.86rem;
}

.icon-btn {
  flex: 0 0 auto;
  width: 38px;
  height: 38px;
  padding: 0;
  white-space: nowrap;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.form-grid-3 {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.form-field {
  display: grid;
  gap: 7px;
}

.form-field.full {
  grid-column: 1 / -1;
}

label {
  color: var(--ksl-ink);
  font-size: 0.88rem;
  font-weight: 750;
}

code {
  color: var(--ksl-maroon);
  background: var(--ksl-red-soft);
  border-radius: 6px;
  padding: 3px 6px;
}

.code-panel {
  overflow: auto;
  max-height: 420px;
  padding: 14px;
  border: 1px solid var(--ksl-line);
  border-radius: var(--radius);
  color: var(--ksl-ink);
  background: var(--ksl-card);
  white-space: pre-wrap;
}

input,
select,
textarea {
  width: 100%;
  min-height: 41px;
  border: 1px solid var(--ksl-line);
  border-radius: var(--radius);
  padding: 9px 11px;
  color: var(--ksl-ink);
  background: var(--ksl-card);
  font: inherit;
}

input,
textarea,
[contenteditable="true"] {
  font-family: var(--ksl-content-font-family);
}

select,
input::placeholder,
textarea::placeholder {
  font-family: var(--ksl-interface-font-family);
}

input[type="checkbox"],
input[type="radio"] {
  width: 18px;
  height: 18px;
  min-height: 18px;
  flex: 0 0 18px;
  margin: 0;
  padding: 0;
  accent-color: var(--ksl-maroon);
}

.switch {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  cursor: pointer;
}

.switch input[type="checkbox"] {
  position: absolute;
  width: 1px;
  height: 1px;
  min-height: 1px;
  opacity: 0;
}

.switch span {
  position: relative;
  flex: 0 0 34px;
  width: 34px;
  height: 20px;
  border-radius: 999px;
  background: #cbd6e4;
  transition: background 0.18s ease, box-shadow 0.18s ease;
}

.switch span::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 14px;
  height: 14px;
  border-radius: 999px;
  background: #fff;
  box-shadow: 0 1px 3px rgba(16, 32, 51, 0.2);
  transition: transform 0.18s ease;
}

.switch input[type="checkbox"]:checked + span {
  background: var(--ksl-maroon);
}

.switch input[type="checkbox"]:checked + span::after {
  transform: translateX(14px);
}

.switch input[type="checkbox"]:focus-visible + span {
  box-shadow: 0 0 0 3px rgba(196, 154, 44, 0.28);
}

html[data-theme="dark"] input,
html[data-theme="dark"] select,
html[data-theme="dark"] textarea,
html[data-theme="dark"] .btn-outline,
html[data-theme="dark"] .table-wrap,
html[data-theme="dark"] .activity-item,
html[data-theme="dark"] .calendar-item,
html[data-theme="dark"] .modal-panel,
html[data-theme="dark"] .tabs,
html[data-theme="dark"] .drop-zone,
html[data-theme="dark"] .profile-block {
  color: var(--ksl-ink);
  background: #0d2038;
  border-color: var(--ksl-line);
}

html[data-theme="dark"] th {
  color: #ffffff;
  background: linear-gradient(180deg, #174a80, #0b2d57);
}

html[data-theme="dark"] td {
  color: #eef4ff;
}

textarea {
  min-height: 94px;
  resize: vertical;
}

input:focus,
select:focus,
textarea:focus {
  outline: 3px solid rgba(196, 154, 44, 0.28);
  border-color: var(--ksl-navy-700);
}

.filter-bar {
  display: grid;
  grid-template-columns: repeat(6, minmax(120px, 1fr));
  gap: 10px;
  align-items: end;
}

.user-document-search .filter-bar {
  grid-template-columns: minmax(260px, 1fr) auto auto;
}

.user-document-search .form-field.full {
  grid-column: auto;
}

.user-search-actions {
  min-width: 112px;
}

.user-documents-table {
  min-width: 1080px;
}

.user-documents-table th:nth-child(3),
.user-documents-table td:nth-child(3) {
  width: 260px;
}

.table-wrap {
  overflow-x: auto;
  max-width: 100%;
  overscroll-behavior-inline: contain;
  scrollbar-color: rgba(11, 45, 87, 0.45) transparent;
  border: 1px solid var(--ksl-line);
  border-radius: var(--radius);
  background: var(--ksl-card);
  box-shadow: 0 12px 26px rgba(16, 32, 51, 0.06);
}

table {
  width: 100%;
  border-collapse: collapse;
  table-layout: auto;
  font-size: clamp(0.78rem, 0.35vw + 0.72rem, 0.92rem);
}

.smart-table-wrap {
  position: relative;
}

.smart-table {
  table-layout: fixed;
  min-width: 1180px;
}

.smart-table th,
.smart-table td {
  max-width: 320px;
}

.smart-table th {
  white-space: nowrap;
}

.smart-table .col-expand {
  width: 46px;
}

.smart-table .col-select {
  width: 46px;
}

.smart-table .col-number {
  width: 160px;
  font-family: "Cascadia Mono", "Consolas", monospace;
}

.smart-table .col-id {
  width: 82px;
  font-family: "Cascadia Mono", "Consolas", monospace;
}

.smart-table .col-date {
  width: 124px;
}

.smart-table .col-actions {
  width: 150px;
}

.smart-table .col-status,
.smart-table .col-version {
  width: 116px;
}

.smart-table .col-type {
  width: 148px;
}

.smart-table .col-person,
.smart-table .col-department,
.smart-table .col-contact {
  width: 220px;
  max-width: 280px;
}

.smart-table .col-title {
  width: auto;
}

.smart-table .col-tags {
  width: 180px;
}

.cell-truncate {
  display: block;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.cell-clamp {
  display: -webkit-box;
  overflow: hidden;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  line-clamp: 2;
}

.cell-mono {
  font-family: "Cascadia Mono", "Consolas", monospace;
  font-size: 0.86rem;
}

.tag-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  max-width: 190px;
}

.tag-chip {
  display: inline-flex;
  align-items: center;
  max-width: 120px;
  padding: 4px 8px;
  border-radius: 999px;
  color: #0b2d57;
  background: var(--ksl-navy-soft);
  font-size: 0.76rem;
  font-weight: 800;
}

.tag-chip-more {
  color: #6f151b;
  background: var(--ksl-gold-soft);
}

.column-chooser {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin: 10px 0 0;
}

.column-chooser label {
  display: inline-flex;
  gap: 6px;
  align-items: center;
  min-height: 32px;
  padding: 6px 9px;
  border: 1px solid var(--ksl-line);
  border-radius: var(--radius);
  background: var(--ksl-card);
  font-size: 0.82rem;
}

.column-chooser input {
  width: auto;
  min-height: auto;
}

.row-expand-btn {
  width: 34px;
  height: 34px;
  padding: 0;
}

.row-expand-btn i {
  transition: transform 0.18s ease;
}

tr.is-expanded .row-expand-btn i {
  transform: rotate(90deg);
}

.smart-table [data-hidden-column="true"] {
  display: none !important;
}

th,
td {
  padding: clamp(9px, 0.7vw, 14px) clamp(9px, 0.8vw, 15px);
  border-bottom: 1px solid var(--ksl-line);
  text-align: left;
  vertical-align: middle;
  overflow-wrap: anywhere;
}

th {
  color: #fff;
  background: linear-gradient(180deg, var(--ksl-navy), #092545);
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  position: sticky;
  top: 0;
  z-index: 1;
}

.table-wrap > table:not(.smart-table) tbody tr:nth-child(even) {
  background: rgba(234, 241, 248, 0.34);
}

.table-wrap > table:not(.smart-table) tbody tr:hover {
  background: var(--row-hover);
}

@media (max-width: 720px) {
  table[data-responsive-table="true"] {
    min-width: 0;
  }

  table[data-responsive-table="true"] thead {
    display: none;
  }

  table[data-responsive-table="true"],
  table[data-responsive-table="true"] tbody,
  table[data-responsive-table="true"] tr,
  table[data-responsive-table="true"] td {
    display: block;
    width: 100%;
  }

  table[data-responsive-table="true"] tr {
    margin: 0 0 12px;
    overflow: hidden;
    border: 1px solid var(--ksl-line);
    border-radius: var(--radius);
    background: var(--ksl-card);
    box-shadow: var(--shadow-sm);
  }

  table[data-responsive-table="true"] td {
    display: grid;
    grid-template-columns: minmax(96px, 34%) minmax(0, 1fr);
    gap: 10px;
    align-items: start;
    border-bottom: 1px solid var(--ksl-line);
  }

  table[data-responsive-table="true"] td::before {
    content: attr(data-label);
    color: var(--ksl-muted);
    font-size: 0.72rem;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 0.03em;
  }

  table[data-responsive-table="true"] td[colspan] {
    display: block;
  }

  table[data-responsive-table="true"] td[colspan]::before {
    content: none;
  }

  table[data-responsive-table="true"] td:last-child {
    border-bottom: 0;
  }
}

tr:last-child td {
  border-bottom: 0;
}

tbody tr:hover {
  background: var(--row-hover);
}

tbody tr:nth-child(even) {
  background: rgba(11, 45, 87, 0.025);
}

html[data-theme="dark"] tbody tr:nth-child(even) {
  background: rgba(255, 255, 255, 0.025);
}

canvas {
  width: 100% !important;
  max-height: 340px;
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 26px;
  padding: 4px 9px;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 800;
  white-space: nowrap;
}

.pill-approved,
.pill-success {
  color: #0f6b39;
  background: #e8f6ee;
}

.pill-pending,
.pill-warning {
  color: #905f12;
  background: #fff4d6;
}

.pill-declined,
.pill-danger {
  color: #9d2f2f;
  background: #fdeaea;
}

.pill-info {
  color: #0b4f78;
  background: #e8f3fa;
}

html[data-theme="dark"] .pill-info {
  color: #c8e9ff;
  background: #143852;
}

html[data-theme="dark"] .pill-warning {
  color: #ffe6a3;
  background: #3a2b10;
}

html[data-theme="dark"] .pill-success,
html[data-theme="dark"] .pill-approved {
  color: #bdf2cf;
  background: #123923;
}

html[data-theme="dark"] .pill-danger,
html[data-theme="dark"] .pill-declined {
  color: #ffd1d1;
  background: #3c1719;
}

.actions {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.pagination {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-top: 18px;
}

.pagination a {
  min-width: 36px;
  min-height: 36px;
  display: inline-grid;
  place-items: center;
  color: var(--ksl-ink);
  background: #fff;
  border: 1px solid var(--ksl-line);
  border-radius: var(--radius);
  text-decoration: none;
}

.pagination a.active {
  color: #fff;
  background: var(--ksl-maroon);
  border-color: var(--ksl-maroon);
}

.alert {
  border-radius: var(--radius);
  padding: 12px 14px;
  margin-bottom: 16px;
  border: 1px solid var(--ksl-line);
  background: #fff;
}

.alert-success {
  color: #0f6b39;
  background: #e8f6ee;
  border-color: #bce5ca;
}

.alert-danger {
  color: #9d2f2f;
  background: #fdeaea;
  border-color: #f5c1c1;
}

.alert-info {
  color: #135d86;
  background: #e8f3fa;
  border-color: #b9dced;
}

.tabs {
  display: inline-flex;
  padding: 4px;
  border: 1px solid var(--ksl-line);
  border-radius: var(--radius);
  background: #fff;
}

.tab {
  border: 0;
  background: transparent;
  border-radius: 6px;
  padding: 9px 13px;
  color: var(--ksl-muted);
  cursor: pointer;
  font-weight: 750;
}

.tab.active {
  color: #fff;
  background: var(--ksl-maroon);
}

.drop-zone {
  display: grid;
  place-items: center;
  min-height: 144px;
  border: 2px dashed #c9d1df;
  border-radius: var(--radius);
  background: #fbfcff;
  color: var(--ksl-muted);
  text-align: center;
  padding: 18px;
  cursor: pointer;
}

.drop-zone.is-dragover {
  border-color: var(--ksl-navy-700);
  background: var(--ksl-navy-soft);
}

.drop-zone i {
  display: block;
  color: var(--ksl-maroon);
  font-size: 1.65rem;
  margin-bottom: 6px;
}

.activity-list,
.calendar-list {
  display: grid;
  gap: 10px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.activity-item,
.calendar-item {
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr);
  gap: 10px;
  align-items: start;
  padding: 10px;
  border: 1px solid var(--ksl-line);
  border-radius: var(--radius);
  background: var(--ksl-card);
}

.activity-item:not(:has(i)) {
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
}

.activity-item:not(:has(i)) > span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.activity-item:not(:has(i)) > small {
  min-width: 0;
  overflow-wrap: anywhere;
}

.activity-item i,
.calendar-date {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: var(--radius);
  background: var(--ksl-navy-soft);
  color: var(--ksl-navy);
  font-weight: 800;
}

.activity-item b,
.calendar-item b {
  display: block;
}

.activity-item small,
.calendar-item small {
  color: var(--ksl-muted);
}

.dashboard-balance-grid {
  align-items: stretch;
}

.dashboard-equal-card {
  display: flex;
  min-height: 560px;
  flex-direction: column;
}

.dashboard-equal-card .activity-list {
  flex: 1 1 auto;
  align-content: start;
}

.dashboard-calendar-card .quick-actions {
  margin-top: auto !important;
  padding-top: 18px;
}

.dashboard-calendar-widget {
  display: grid;
  gap: 10px;
  width: 100%;
  max-width: 380px;
  min-height: 0;
  margin: 0 auto;
  padding: 12px;
  border: 1px solid #dfe5ec;
  border-radius: 6px;
  background: #fff;
  box-shadow: 0 6px 18px rgba(15, 35, 55, 0.05);
}

.calendar-toolbar {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr) 28px;
  align-items: center;
  gap: 8px;
}

.calendar-toolbar h3 {
  margin: 0;
  color: #5b6573;
  font-size: 0.92rem;
  font-weight: 850;
  text-align: center;
}

.calendar-nav-btn {
  display: inline-grid;
  place-items: center;
  width: 22px;
  height: 22px;
  margin: 0 auto;
  border: 1px solid #cfd6df;
  border-radius: 50%;
  color: #a7b0bc;
  background: #fff;
  font-size: 0.68rem;
  cursor: pointer;
  transition: border-color 0.18s ease, color 0.18s ease, background 0.18s ease;
}

.calendar-nav-btn:hover,
.calendar-nav-btn:focus-visible {
  border-color: var(--ksl-navy);
  color: var(--ksl-navy);
  background: #f4f7fb;
}

.calendar-subtoolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 8px;
  color: var(--ksl-muted);
  font-size: 0.72rem;
  font-weight: 800;
}

.calendar-system-toggle {
  display: inline-grid;
  grid-template-columns: 1fr 1fr;
  overflow: hidden;
  min-height: 24px;
  border: 1px solid #d8dee7;
  border-radius: 999px;
  background: #f8fafc;
}

.calendar-system-toggle button {
  min-width: 34px;
  border: 0;
  color: var(--ksl-muted);
  background: transparent;
  font: inherit;
  font-size: 0.68rem;
  font-weight: 900;
  cursor: pointer;
}

.calendar-system-toggle button.active {
  color: #fff;
  background: #4f83f1;
}

.calendar-today-link {
  border: 0;
  color: var(--ksl-navy);
  background: transparent;
  font: inherit;
  font-size: 0.72rem;
  font-weight: 900;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.calendar-month-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 4px 6px;
  min-width: 0;
}

.calendar-month-grid.slide-next {
  animation: calendar-slide-next 0.22s ease-out;
}

.calendar-month-grid.slide-prev {
  animation: calendar-slide-prev 0.22s ease-out;
}

.calendar-month-grid.slide-refresh {
  animation: calendar-refresh 0.18s ease-out;
}

.calendar-weekday {
  min-height: 26px;
  color: #626d7c;
  font-size: 0.76rem;
  font-weight: 900;
  text-align: center;
}

.calendar-day {
  display: grid;
  place-items: center;
  min-width: 0;
  min-height: 28px;
  padding: 3px 2px;
  border: 0;
  border-radius: 4px;
  color: #2d3748;
  background: transparent;
  font: inherit;
  font-size: 0.78rem;
  font-weight: 850;
  line-height: 1;
}

.calendar-day:not(.muted-day) {
  cursor: default;
}

.calendar-day.is-today {
  color: #fff;
  background: #5b8df7;
  box-shadow: 0 5px 12px rgba(91, 141, 247, 0.3);
}

.calendar-day-note {
  display: none;
}

.muted-day {
  color: #c1c8d2;
}

@keyframes calendar-slide-next {
  from { opacity: 0.3; transform: translateX(18px); }
  to { opacity: 1; transform: translateX(0); }
}

@keyframes calendar-slide-prev {
  from { opacity: 0.3; transform: translateX(-18px); }
  to { opacity: 1; transform: translateX(0); }
}

@keyframes calendar-refresh {
  from { opacity: 0.35; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

@media (prefers-reduced-motion: reduce) {
  .calendar-month-grid.slide-next,
  .calendar-month-grid.slide-prev,
  .calendar-month-grid.slide-refresh {
    animation: none;
  }
}

html[data-theme="dark"] .dashboard-calendar-widget,
html[data-theme="dark"] .calendar-system-toggle {
  background: #0d2038;
  border-color: #29415e;
}

html[data-theme="dark"] .calendar-toolbar h3 {
  color: var(--ksl-ink);
}

html[data-theme="dark"] .calendar-day {
  color: var(--ksl-ink);
  background: transparent;
}

html[data-theme="dark"] .calendar-nav-btn {
  color: #b7c3d4;
  background: #102946;
  border-color: #3b536e;
}

html[data-theme="dark"] .calendar-weekday,
html[data-theme="dark"] .calendar-subtoolbar {
  color: #b7c3d4;
}

html[data-theme="dark"] .muted-day {
  color: #64758b;
}

html[data-theme="dark"] .calendar-day.is-today {
  color: #fff;
  background: #5b8df7;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(15, 23, 42, 0.54);
}

.modal-backdrop.open {
  display: flex;
}

.modal-panel {
  width: min(760px, 96vw);
  max-height: 90vh;
  overflow: auto;
  background: #fff;
  border-radius: var(--radius);
  box-shadow: var(--shadow-md);
}

.modal-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  padding: 18px 20px;
  border-bottom: 1px solid var(--ksl-line);
}

.modal-body {
  padding: 20px;
}

.password-meter {
  height: 8px;
  overflow: hidden;
  border-radius: 999px;
  background: #edf0f5;
}

.password-meter span {
  display: block;
  width: 0;
  height: 100%;
  background: var(--ksl-danger);
  transition: width 0.2s ease, background 0.2s ease;
}

.toast-stack {
  position: fixed;
  top: 18px;
  right: 18px;
  z-index: 200;
  display: grid;
  gap: 10px;
}

.toast {
  width: min(360px, calc(100vw - 36px));
  padding: 12px 14px;
  border-radius: var(--radius);
  color: var(--ksl-ink);
  background: #fff;
  border-left: 4px solid var(--ksl-navy);
  box-shadow: var(--shadow-md);
}

.login-page {
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  color: var(--ksl-ink);
  background:
    radial-gradient(circle at 12% 16%, rgba(199, 160, 68, 0.2), transparent 30%),
    linear-gradient(125deg, #003366 0%, #082344 58%, #6f151b 100%);
  overflow: hidden;
}

html[data-theme="dark"] .login-page {
  background:
    radial-gradient(circle at 12% 16%, rgba(210, 103, 112, 0.16), transparent 30%),
    linear-gradient(125deg, #050d18, #10233d 55%, #27080c);
}

.login-hero {
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-height: 100vh;
  padding: clamp(20px, 4vw, 48px);
  color: #fff;
  position: relative;
  overflow: hidden;
}

.login-hero-inner {
  position: relative;
  z-index: 1;
}

.login-hero::after {
  content: "";
  position: absolute;
  right: -120px;
  bottom: -140px;
  width: 360px;
  height: 360px;
  border: 54px solid rgba(255, 255, 255, 0.08);
  border-radius: 50%;
}

.login-hero h1 {
  margin: 0;
  max-width: 720px;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(2rem, 4vw, 4.2rem);
  line-height: 1;
  letter-spacing: 0;
  overflow-wrap: anywhere;
}

.login-hero .eyebrow {
  color: #f6d983;
}

.login-hero p {
  max-width: 620px;
  color: #f4f8ff;
  font-size: 0.98rem;
}

.login-panel-wrap {
  display: grid;
  place-items: center;
  min-height: 100vh;
  padding: 12px;
  background: #ffffff;
}

.login-panel {
  width: min(560px, 100%);
  max-height: calc(100vh - 24px);
  overflow-y: auto;
  padding: clamp(18px, 2.4vw, 26px);
  background: #fff;
  border: 1px solid #c7a044;
  border-radius: var(--radius);
  box-shadow: 0 18px 45px rgba(0, 51, 102, 0.18);
}

html[data-theme="dark"] .login-panel,
html[data-theme="dark"] .login-panel-wrap {
  color: var(--ksl-ink);
}

html[data-theme="dark"] .login-panel-wrap {
  background:
    linear-gradient(180deg, rgba(8, 22, 40, 0.96), rgba(11, 30, 52, 0.92)),
    #081628;
}

html[data-theme="dark"] .login-panel {
  background: #0d2038;
  border-color: #e7c66b;
  box-shadow: 0 18px 48px rgba(0, 0, 0, 0.38);
}

.login-illustration {
  display: none;
  width: 100%;
  max-height: 150px;
  object-fit: contain;
  margin-bottom: 18px;
}

.login-feature-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-top: 22px;
  max-width: 680px;
}

.login-feature {
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr);
  gap: 10px;
  align-items: start;
  padding: 12px;
  border: 1px solid rgba(246, 217, 131, 0.48);
  border-radius: var(--radius);
  color: #ffffff;
  background: rgba(0, 51, 102, 0.42);
  backdrop-filter: blur(10px);
}

.login-feature i {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  color: #3e0b10;
  background: #f3d47a;
  border-radius: var(--radius);
}

.login-feature b,
.login-feature small {
  display: block;
}

.login-feature b {
  color: #ffffff;
}

.login-feature small {
  color: #f5fbff;
}

.login-logo {
  display: grid;
  place-items: center;
  margin: 0 auto 16px;
}

.login-logo img {
  width: 96px;
  height: 96px;
  object-fit: contain;
  padding: 9px;
  border: 3px solid #c7a044;
  border-radius: 50%;
  background: #ffffff;
  box-shadow: 0 14px 34px rgba(0, 51, 102, 0.18);
}

.login-panel h2 {
  margin: 0 0 6px;
  color: var(--ksl-navy);
  font-size: 1.32rem;
}

.login-panel .subtitle {
  margin: 0 0 12px;
  color: var(--ksl-navy);
}

.login-credentials-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.login-session-note {
  margin-top: 12px;
  color: #003366;
  background: #fff9e8;
  border-color: #c7a044;
}

.login-social .btn {
  color: #003366;
  background: #ffffff;
  border-color: #003366;
}

.login-social .btn:hover {
  color: #ffffff;
  background: #003366;
}

.login-panel label {
  color: var(--ksl-maroon-dark);
}

.login-panel input {
  color: var(--ksl-navy);
  background: #ffffff;
  border-color: #003366;
}

.login-panel input::placeholder {
  color: #7a1118;
}

html[data-theme="dark"] .login-panel h2,
html[data-theme="dark"] .login-panel .subtitle,
html[data-theme="dark"] .login-panel label {
  color: #ffffff;
}

html[data-theme="dark"] .login-panel input {
  color: #ffffff;
  background: #003366;
  border-color: #e7c66b;
}

html[data-theme="dark"] .login-panel input::placeholder {
  color: #ffe6a3;
}

html[data-theme="dark"] .login-session-note {
  color: #ffffff;
  background: #003366;
  border-color: #e7c66b;
}

html[data-theme="dark"] .login-social .btn {
  color: #ffffff;
  background: #003366;
  border-color: #e7c66b;
}

.login-work-areas {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  max-width: 680px;
  margin-top: 18px;
}

.login-work-areas span {
  padding: 7px 10px;
  border: 1px solid rgba(246, 217, 131, 0.72);
  border-radius: 999px;
  color: #fff9e8;
  background: rgba(0, 51, 102, 0.38);
  font-size: 0.82rem;
  font-weight: 800;
}

.login-help-note {
  display: flex;
  gap: 8px;
  align-items: flex-start;
  margin: 18px 0 0;
  padding: 12px;
  color: #5b2730;
  background: #fff6df;
  border: 1px solid #ecd18b;
  border-radius: var(--radius);
  font-size: 0.9rem;
}

.login-help-note a {
  color: #003366;
  font-weight: 800;
}

html[data-theme="dark"] .login-help-note {
  color: #ffe6a3;
  background: #352b16;
  border-color: #6d5a25;
}

html[data-theme="dark"] .login-help-note a {
  color: #ffffff;
}

.quick-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.user-table-wrap {
  box-shadow: var(--shadow-md);
}

.user-table th,
.user-table td {
  vertical-align: top;
}

.user-table:not(.smart-table) td:last-child {
  min-width: 360px;
}

.user-cell {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 10px;
  align-items: center;
}

.user-cell b,
.user-cell small {
  display: block;
}

.user-cell small {
  color: var(--ksl-muted);
}

.avatar-sm {
  width: 32px;
  height: 32px;
  flex-basis: 32px;
  font-size: 0.82rem;
}

.muted {
  color: var(--ksl-muted);
}

.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;
}

@media (max-width: 1100px) {
  .grid-4,
  .grid-3,
  .filter-bar {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 860px) {
  .mobile-menu-toggle {
    display: inline-flex !important;
  }

  body.sidebar-open .mobile-menu-toggle,
  .sidebar.is-open ~ .main-shell .mobile-menu-toggle {
    display: none !important;
  }

  .app-shell,
  .login-page {
    grid-template-columns: 1fr;
  }

  .login-page {
    overflow: auto;
  }

  .login-panel {
    max-height: none;
  }

  .topbar {
    grid-template-columns: auto minmax(0, 1fr);
  }

  .topbar-actions {
    grid-column: 1 / -1;
    justify-content: flex-start;
  }

  .topbar-search,
  .topbar-actions form,
  .topbar-actions > .profile-block {
    flex: 1 1 100%;
    max-width: none;
  }

  .sidebar {
    position: static;
    height: auto;
  }

  .main-shell {
    min-height: 100vh;
  }

  .section-head {
    align-items: flex-start;
    flex-direction: column;
  }

  .content {
    padding: 18px;
  }

  .portal-hero {
    grid-template-columns: 1fr;
    gap: 14px;
    padding: 22px;
  }

  .portal-hero h2 {
    max-width: none;
    font-size: clamp(1.45rem, 7vw, 2rem);
    line-height: 1.12;
  }

  .portal-hero img {
    width: min(100%, 320px);
    max-height: 165px;
    margin: 0 auto;
  }

  .grid-2,
  .grid-3,
  .grid-4,
  .form-grid,
  .form-grid-3,
  .filter-bar {
    grid-template-columns: 1fr;
  }

  .user-document-search .filter-bar {
    grid-template-columns: 1fr;
  }

  .user-document-search .form-field.full {
    grid-column: 1 / -1;
  }

  .login-hero {
    min-height: 46vh;
  }

  .smart-table {
    min-width: 0;
    table-layout: auto;
  }

  .smart-table thead {
    display: none;
  }

  .smart-table,
  .smart-table tbody,
  .smart-table tr,
  .smart-table td {
    display: block;
    width: 100%;
  }

  .smart-table tr {
    margin: 0 0 12px;
    border: 1px solid var(--ksl-line);
    border-radius: var(--radius);
    background: var(--ksl-card);
    box-shadow: var(--shadow-sm);
  }

  .smart-table td {
    display: none;
    border-bottom: 1px solid var(--ksl-line);
    padding: 10px 12px;
  }

  .smart-table td.mobile-primary,
  .smart-table td.mobile-actions,
  .smart-table td.col-expand,
  .smart-table tr.is-expanded td {
    display: block;
  }

  .smart-table td.col-expand {
    border-bottom: 0;
    padding-bottom: 0;
  }

  .smart-table td:not(.col-expand)::before {
    content: attr(data-label);
    display: block;
    margin-bottom: 4px;
    color: var(--ksl-muted);
    font-size: 0.74rem;
    font-weight: 800;
    text-transform: uppercase;
  }

  .smart-table td.mobile-actions {
    border-bottom: 0;
  }

  .smart-table .actions {
    justify-content: flex-start;
  }

  .cell-truncate {
    white-space: normal;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    line-clamp: 2;
  }
}

/* 2026 final-fit pass: compact shell, iframe-safe content, and purpose folders. */
html,
body {
  max-width: 100%;
  overflow-x: clip;
}

.app-shell {
  grid-template-columns: 264px minmax(0, 1fr);
}

.sidebar {
  padding: 18px 14px;
}

.brand-lockup {
  grid-template-columns: 48px minmax(0, 1fr);
  padding-bottom: 16px;
}

.brand-lockup img {
  width: 48px;
  height: 48px;
}

.nav-group {
  margin-top: 14px;
}

.nav-link {
  min-height: 36px;
  gap: 10px;
  margin-bottom: 2px;
  padding: 7px 10px;
  font-size: 0.88rem;
}

.main-shell,
.content,
.card,
.card-pad,
.section-head,
.form-grid,
.filter-bar,
.quick-actions,
.table-wrap,
.portal-frame {
  min-width: 0;
  max-width: 100%;
}

.content {
  padding: clamp(16px, 2vw, 24px);
  overflow-x: clip;
}

.topbar {
  min-height: 70px;
  padding: 12px 20px;
}

@media (max-width: 1500px) {
  .topbar {
    grid-template-columns: minmax(0, 1fr);
  }

  .topbar-actions {
    display: grid;
    grid-template-columns: minmax(180px, 1fr) auto auto minmax(260px, 340px);
    grid-column: 1 / -1;
    width: 100%;
  }

  .topbar-search,
  .topbar-actions form,
  .topbar-actions > .profile-block {
    width: 100%;
    max-width: none;
  }
}

@media (max-width: 1100px) {
  .topbar-actions {
    grid-template-columns: minmax(160px, 1fr) auto auto;
  }

  .topbar-actions > .profile-block {
    grid-column: 1 / -1;
  }
}

.card-pad {
  padding: clamp(14px, 1.6vw, 18px);
}

.filter-bar {
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
}

.table-wrap {
  container-type: inline-size;
}

th,
td {
  padding: 8px 10px;
  line-height: 1.3;
}

th {
  font-size: 0.76rem;
}

.table-wrap .btn-sm,
.user-table .btn-sm {
  min-height: 28px;
  padding: 5px 8px;
  font-size: 0.76rem;
}

.dashboard-calendar-widget {
  flex: 1 1 auto;
  width: 100%;
  max-width: none;
  min-height: 388px;
  margin: 0;
  padding: 16px;
  grid-template-rows: auto auto minmax(0, 1fr);
}

.calendar-month-grid {
  align-content: stretch;
  grid-auto-rows: minmax(38px, 1fr);
}

.calendar-day {
  min-height: 38px;
  border-radius: 7px;
}

.dashboard-calendar-card .quick-actions {
  padding-top: 12px;
}

/* 2026-08-30: roomier branded calendar and compact document register. */
.dashboard-calendar-widget {
  gap: 12px;
  min-height: 420px;
  padding: 18px;
  border-color: rgba(0, 51, 102, 0.16);
  border-radius: 12px;
  background:
    linear-gradient(180deg, rgba(234, 241, 248, 0.78), rgba(255, 255, 255, 0.98) 34%),
    var(--ksl-card);
  box-shadow: 0 16px 36px rgba(16, 32, 51, 0.09);
}

.calendar-toolbar {
  grid-template-columns: 36px minmax(0, 1fr) 36px;
  gap: 12px;
}

.calendar-toolbar h3 {
  color: var(--ksl-navy);
  font-size: clamp(1.05rem, 1vw + 0.72rem, 1.3rem);
  letter-spacing: -0.02em;
}

.calendar-nav-btn {
  width: 32px;
  height: 32px;
  border-color: rgba(0, 51, 102, 0.2);
  color: var(--ksl-navy);
  background: var(--ksl-card);
  font-size: 0.78rem;
  box-shadow: 0 5px 12px rgba(16, 32, 51, 0.07);
}

.calendar-subtoolbar {
  justify-content: space-between;
  padding: 7px 10px;
  border: 1px solid rgba(0, 51, 102, 0.1);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.7);
  font-size: 0.78rem;
}

.calendar-system-toggle {
  min-height: 28px;
}

.calendar-system-toggle button {
  min-width: 40px;
  font-size: 0.74rem;
}

.calendar-system-toggle button.active {
  background: var(--ksl-navy);
}

.calendar-month-grid {
  gap: 6px;
  grid-auto-rows: minmax(44px, 1fr);
}

.calendar-weekday {
  display: grid;
  min-height: 30px;
  place-items: center;
  color: var(--ksl-navy);
  font-size: 0.8rem;
  letter-spacing: 0.04em;
}

.calendar-day {
  min-height: 44px;
  padding: 5px 3px;
  border: 1px solid rgba(0, 51, 102, 0.08);
  border-radius: 9px;
  color: var(--ksl-ink);
  background: rgba(255, 255, 255, 0.78);
  font-size: clamp(0.96rem, 0.35vw + 0.88rem, 1.1rem);
  font-weight: 800;
  line-height: 1;
  transition: transform 0.16s ease, border-color 0.16s ease, box-shadow 0.16s ease;
}

button.calendar-day:not(.is-today):hover,
button.calendar-day:not(.is-today):focus-visible {
  z-index: 1;
  border-color: rgba(0, 51, 102, 0.32);
  box-shadow: 0 7px 16px rgba(16, 32, 51, 0.1);
  transform: translateY(-1px);
}

.calendar-day:nth-child(7n + 1):not(.muted-day),
.calendar-day:nth-child(7n):not(.muted-day) {
  color: var(--ksl-maroon);
  background: rgba(248, 243, 229, 0.76);
}

.calendar-day.muted-day {
  border-color: transparent;
  color: #9ba7b6;
  background: transparent;
  font-weight: 650;
}

.calendar-day.is-today,
html[data-theme="dark"] .calendar-day.is-today {
  color: #fff;
  border-color: var(--ksl-maroon);
  background: linear-gradient(145deg, var(--ksl-maroon), var(--ksl-maroon-dark));
  box-shadow: 0 8px 18px rgba(122, 17, 24, 0.28), inset 0 0 0 2px rgba(199, 160, 68, 0.55);
  font-size: 1.08rem;
}

html[data-theme="dark"] .dashboard-calendar-widget {
  background: linear-gradient(180deg, rgba(22, 42, 69, 0.94), rgba(13, 32, 56, 0.98));
}

html[data-theme="dark"] .calendar-subtoolbar,
html[data-theme="dark"] .calendar-day {
  background: rgba(16, 43, 76, 0.78);
  border-color: rgba(142, 186, 255, 0.14);
}

html[data-theme="dark"] .calendar-day.muted-day {
  color: #64758b;
  background: transparent;
  border-color: transparent;
}

.repo-table-wrap {
  overflow-x: hidden;
}

.classic-repository-table {
  width: 100%;
  min-width: 0;
  table-layout: fixed;
}

.classic-repository-table .repo-col-ref { width: 13%; }
.classic-repository-table .repo-col-document { width: 27%; }
.classic-repository-table .repo-col-parties { width: 23%; }
.classic-repository-table .repo-col-date { width: 13%; }
.classic-repository-table .repo-col-status { width: 11%; }
.classic-repository-table .repo-col-actions { width: 13%; }

.classic-repository-table th,
.classic-repository-table td {
  width: auto !important;
}

.classic-repository-table td {
  padding: 7px 8px;
  vertical-align: middle;
  overflow-wrap: anywhere;
}

.classic-repository-table tbody tr {
  height: 74px;
}

.repo-meta-line,
.repo-date-cell small,
.repo-file-meta {
  display: block;
  margin-top: 4px;
  line-height: 1.2;
}

.repo-inline-meta {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 6px;
  margin-top: 4px;
  color: var(--ksl-muted);
}

.repo-inline-meta .pill {
  flex: 0 0 auto;
  padding: 3px 7px;
  font-size: 0.68rem;
}

.repo-inline-meta small {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.repo-party-cell {
  font-size: 0.8rem;
}

.repo-party-line {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  gap: 5px;
  align-items: baseline;
}

.repo-party-line + .repo-party-line {
  margin-top: 3px;
}

.repo-party-line b {
  color: var(--ksl-muted);
  font-size: 0.68rem;
  text-transform: uppercase;
}

.repo-date-cell b {
  white-space: nowrap;
  font-size: 0.8rem;
}

.repo-action-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(28px, 1fr));
  gap: 4px;
  align-items: stretch;
}

.repo-action-grid .btn {
  min-width: 0;
  min-height: 28px;
  padding: 4px 5px;
}

.repo-action-label {
  display: none;
}

.repo-file-meta {
  text-align: center;
  font-size: 0.66rem;
}

@media (min-width: 761px) and (max-width: 1120px) {
  .classic-repository-table {
    display: table;
  }

  .classic-repository-table thead {
    display: table-header-group;
  }

  .classic-repository-table tbody {
    display: table-row-group;
  }

  .classic-repository-table tr {
    display: table-row;
    width: auto !important;
    margin: 0;
    border: 0;
    border-radius: 0;
    box-shadow: none;
    overflow: visible;
  }

  .classic-repository-table td {
    display: table-cell;
    width: auto !important;
    border-bottom: 1px solid var(--ksl-line);
  }

  .classic-repository-table td::before {
    content: none;
  }
}

@media (max-width: 760px) {
  .classic-repository-table colgroup {
    display: none;
  }

  .classic-repository-table tbody tr {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 0;
    height: auto;
    overflow: visible;
    margin-bottom: 10px;
  }

  .classic-repository-table td {
    display: block;
    min-width: 0;
    padding: 8px 10px;
  }

  .classic-repository-table td::before {
    display: block;
    margin-bottom: 4px;
  }

  .classic-repository-table .repo-subject-cell,
  .classic-repository-table .repo-party-cell,
  .classic-repository-table .repo-actions-cell {
    grid-column: 1 / -1;
  }

  .repo-action-grid {
    grid-template-columns: repeat(auto-fit, minmax(82px, 1fr));
  }

  .repo-action-label {
    display: inline;
  }
}

@media (max-width: 520px) {
  .dashboard-calendar-widget {
    min-height: 390px;
    padding: 12px;
  }

  .calendar-month-grid {
    gap: 4px;
    grid-auto-rows: minmax(40px, 1fr);
  }

  .calendar-day {
    min-height: 40px;
    font-size: 0.92rem;
  }

  .classic-repository-table tr {
    grid-template-columns: minmax(0, 1fr);
  }

  .classic-repository-table td {
    grid-column: 1;
  }
}

@media (max-width: 680px) {
  .topbar {
    padding: 12px 16px;
  }

  .topbar-actions {
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 8px;
  }

  .topbar-search,
  .topbar-actions form {
    grid-column: 1 / -1;
    min-width: 0;
  }

  .topbar-actions .view-controls {
    grid-column: 1;
    min-width: 0;
  }

  .topbar-actions > button[data-open-modal] {
    grid-column: 2;
    min-width: 92px;
    white-space: nowrap;
  }

  .topbar-actions > .profile-block {
    grid-column: 1 / -1;
  }
}

.compact-section-head {
  margin-bottom: 10px;
}

.repository-folder-section {
  margin: 0 0 18px;
}

.repository-folder-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 10px;
}

.repository-folder-card {
  display: grid;
  grid-template-columns: 40px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  min-width: 0;
  padding: 12px;
  border: 1px solid var(--ksl-line);
  border-radius: var(--radius);
  color: var(--ksl-ink);
  background: var(--ksl-card);
  box-shadow: var(--shadow-sm);
  text-decoration: none;
}

.repository-folder-card:hover,
.repository-folder-card:focus-visible {
  border-color: var(--ksl-gold);
  transform: translateY(-1px);
}

.repository-folder-card b,
.repository-folder-card small {
  display: block;
  min-width: 0;
  overflow-wrap: anywhere;
}

.repository-folder-card small {
  margin-top: 3px;
  color: var(--ksl-muted);
}

.repository-folder-icon {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 10px;
  color: var(--ksl-maroon);
  background: var(--ksl-gold-soft);
}

.repository-path {
  display: inline-flex;
  gap: 5px;
  align-items: center;
  margin-top: 6px;
  color: var(--ksl-muted);
  font-size: 0.72rem;
  overflow-wrap: anywhere;
}

.repository-management-table {
  table-layout: fixed;
}

.repository-management-table th:nth-child(1) { width: 22%; }
.repository-management-table th:nth-child(2) { width: 14%; }
.repository-management-table th:nth-child(3) { width: 34%; }
.repository-management-table th:nth-child(4) { width: 20%; }
.repository-management-table th:nth-child(5) { width: 10%; }

.user-action-menu summary {
  list-style: none;
}

.user-action-menu summary::-webkit-details-marker {
  display: none;
}

.user-action-menu[open] .actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 4px;
  margin-top: 6px;
}

.user-action-menu .actions form,
.user-action-menu .actions .btn {
  width: 100%;
  margin: 0;
}

.user-table th,
.user-table td {
  padding: 7px 8px;
}

.user-table .avatar-sm {
  width: 28px;
  height: 28px;
  flex-basis: 28px;
  font-size: 0.74rem;
}

.user-table .user-cell {
  gap: 7px;
}

@media (max-width: 1120px) {
  .user-table.smart-table {
    min-width: 0;
    table-layout: auto;
  }

  .user-table.smart-table thead {
    display: none;
  }

  .user-table.smart-table,
  .user-table.smart-table tbody,
  .user-table.smart-table td {
    display: block;
    width: 100%;
  }

  .user-table.smart-table tr {
    display: grid;
    grid-template-columns: 58px minmax(160px, 1fr) auto 36px;
    align-items: center;
    margin: 0 0 8px;
    overflow: hidden;
    border: 1px solid var(--ksl-line);
    border-radius: var(--radius);
    background: var(--ksl-card);
    box-shadow: var(--shadow-sm);
  }

  .user-table.smart-table td {
    display: none;
    padding: 7px 10px;
    border-bottom: 1px solid var(--ksl-line);
  }

  .user-table.smart-table td.mobile-primary,
  .user-table.smart-table td.mobile-actions,
  .user-table.smart-table td.col-expand {
    display: block;
    width: auto;
    border: 0;
  }

  .user-table.smart-table td.col-expand {
    grid-column: 4;
    grid-row: 1;
    padding: 7px;
  }

  .user-table.smart-table td[data-col="id"] {
    grid-column: 1;
    grid-row: 1;
  }

  .user-table.smart-table td[data-col="name"] {
    grid-column: 2;
    grid-row: 1;
  }

  .user-table.smart-table td.mobile-actions {
    grid-column: 3;
    grid-row: 1;
  }

  .user-table.smart-table tr.is-expanded td:not(.mobile-primary):not(.mobile-actions):not(.col-expand) {
    display: grid;
    grid-column: 1 / -1;
    grid-template-columns: minmax(112px, 22%) minmax(0, 1fr);
    gap: 10px;
  }

  .user-table.smart-table td:not(.col-expand)::before {
    content: attr(data-label);
    display: block;
    margin-bottom: 3px;
    color: var(--ksl-muted);
    font-size: 0.68rem;
    font-weight: 800;
    text-transform: uppercase;
  }

  .user-table.smart-table td.mobile-primary::before,
  .user-table.smart-table td.mobile-actions::before {
    display: none;
  }

  .user-table.smart-table td.mobile-actions {
    border-bottom: 0;
  }

  .repository-management-table {
    table-layout: auto;
  }
}

@media (max-width: 620px) {
  .user-table.smart-table tr {
    grid-template-columns: 58px minmax(0, 1fr) 36px;
  }

  .user-table.smart-table td[data-col="name"] {
    grid-column: 2;
  }

  .user-table.smart-table td.col-expand {
    grid-column: 3;
  }

  .user-table.smart-table td.mobile-actions {
    grid-column: 1 / -1;
    grid-row: 2;
    padding-top: 0;
  }
}

@media (max-width: 860px) {
  .app-shell {
    grid-template-columns: 1fr;
  }

  .dashboard-calendar-widget {
    min-height: 350px;
  }
}

.outlook-setup-card,
.outlook-connect-card,
.outlook-account-bar {
  display: flex;
  gap: 16px;
  align-items: center;
  justify-content: space-between;
}

.outlook-setup-card {
  display: block;
}

.outlook-setup-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 10px;
  margin: 16px 0;
}

.outlook-setup-grid > div {
  min-width: 0;
  padding: 12px;
  border: 1px solid var(--ksl-line);
  border-radius: var(--radius);
  background: var(--ksl-bg);
}

.outlook-setup-grid b,
.outlook-setup-grid code,
.outlook-account-bar b,
.outlook-account-bar small {
  display: block;
  min-width: 0;
  overflow-wrap: anywhere;
}

.outlook-setup-grid code,
.outlook-account-bar small {
  margin-top: 4px;
  color: var(--ksl-muted);
}

.outlook-mark {
  display: grid;
  place-items: center;
  flex: 0 0 54px;
  width: 54px;
  height: 54px;
  border-radius: 14px;
  color: #fff;
  background: #0878d1;
  font-size: 1.45rem;
}

.outlook-workspace {
  align-items: start;
  margin-top: 14px;
}

.outlook-message-list {
  display: grid;
  gap: 8px;
}

.outlook-message {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  min-width: 0;
  padding: 10px 12px;
  border: 1px solid var(--ksl-line);
  border-radius: var(--radius);
  background: var(--ksl-card);
}

.outlook-message.is-unread {
  border-left: 4px solid var(--ksl-maroon);
  background: color-mix(in srgb, var(--ksl-gold-soft) 42%, var(--ksl-card));
}

.outlook-message b,
.outlook-message small {
  display: block;
}

.outlook-message small,
.outlook-message p {
  color: var(--ksl-muted);
}

.outlook-message p {
  display: -webkit-box;
  margin: 5px 0 0;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  font-size: 0.84rem;
}

.outlook-attachments {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--ksl-line);
}

.outlook-attachments h3 {
  flex: 1 0 100%;
  margin: 0;
}

@media (max-width: 680px) {
  .outlook-connect-card,
  .outlook-account-bar,
  .outlook-message {
    align-items: stretch;
    grid-template-columns: 1fr;
    flex-direction: column;
  }
}

@media (max-width: 560px) {
  .login-feature-grid,
  .login-credentials-grid {
    grid-template-columns: 1fr;
  }

  .appearance-control {
    grid-template-columns: auto 1fr auto;
  }

  .appearance-control strong {
    grid-column: 1 / -1;
    text-align: left;
  }
}

/* Final density overrides are intentionally below the legacy compatibility rules. */
.table-wrap,
.repo-table-wrap {
  width: 100%;
  min-width: 0;
  max-width: 100%;
}

.classic-repository-table tbody tr {
  height: auto;
  min-height: 52px;
}

.classic-repository-table td,
.user-table.smart-table td,
.user-table td {
  padding-top: 5px;
  padding-bottom: 5px;
  line-height: 1.15;
}

.classic-repository-table .repo-actions-cell {
  padding: 4px 5px;
}

.classic-repository-table .repo-action-grid {
  grid-template-columns: repeat(4, minmax(22px, 1fr));
  gap: 3px;
}

.classic-repository-table .repo-action-grid .btn {
  min-height: 24px;
  padding: 2px 3px;
  font-size: 0.72rem;
}

.classic-repository-table .repo-file-meta {
  margin-top: 3px;
  font-size: 0.62rem;
}

.dashboard-calendar-widget {
  width: 100%;
  min-height: 450px;
}

.calendar-month-grid {
  grid-auto-rows: minmax(50px, 1fr);
}

.calendar-day {
  min-height: 50px;
  font-size: clamp(1.06rem, 0.42vw + 0.96rem, 1.22rem);
}

@media (max-width: 760px) {
  .dashboard-calendar-widget {
    min-height: 410px;
  }

  .calendar-month-grid {
    grid-auto-rows: minmax(43px, 1fr);
  }

  .calendar-day {
    min-height: 43px;
    font-size: 1rem;
  }

  .classic-repository-table .repo-action-grid {
    grid-template-columns: repeat(4, minmax(34px, 1fr));
  }
}

/* Final visibility guard: .btn is also display:inline-flex, so this must come last. */
.mobile-menu-toggle {
  display: none !important;
}

@media (max-width: 860px) {
  .mobile-menu-toggle {
    display: inline-flex !important;
  }

  body.sidebar-open .mobile-menu-toggle,
  .sidebar.is-open ~ .main-shell .mobile-menu-toggle {
    display: none !important;
  }
}

/* KSL brand mark and compact account menu. */
.brand-lockup img,
.login-logo img {
  padding: 0;
  object-fit: cover;
  object-position: center;
  background: #ffffff;
}

.brand-lockup img {
  width: 50px;
  height: 50px;
  border: 2px solid rgba(255, 255, 255, 0.86);
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.22);
}

.login-logo img {
  width: 112px;
  height: 112px;
  border: 4px solid var(--ksl-gold);
  box-shadow: 0 16px 36px rgba(0, 51, 102, 0.22);
}

.topbar-actions > .account-menu {
  position: relative;
  z-index: 20;
  flex: 0 0 auto;
  min-width: 224px;
}

.account-menu summary {
  list-style: none;
}

.account-menu summary::-webkit-details-marker {
  display: none;
}

.account-menu-trigger {
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr) 20px;
  gap: 10px;
  align-items: center;
  min-height: 48px;
  padding: 5px 8px;
  color: var(--ksl-ink);
  background: linear-gradient(145deg, color-mix(in srgb, var(--ksl-card) 94%, #ffffff), var(--ksl-card));
  border: 1px solid var(--ksl-line);
  border-radius: 14px;
  box-shadow: 0 7px 22px rgba(11, 45, 87, 0.09);
  cursor: pointer;
  transition: border-color 160ms ease, box-shadow 160ms ease, transform 160ms ease;
}

.account-menu-trigger:hover,
.account-menu-trigger:focus-visible,
.account-menu[open] .account-menu-trigger {
  border-color: color-mix(in srgb, var(--ksl-gold) 72%, var(--ksl-line));
  box-shadow: 0 10px 28px rgba(11, 45, 87, 0.15);
  outline: none;
}

.account-menu-trigger:active {
  transform: translateY(1px);
}

.account-menu-trigger img,
.account-menu-trigger .avatar {
  width: 38px;
  height: 38px;
  min-width: 38px;
  border: 2px solid color-mix(in srgb, var(--ksl-gold) 62%, #ffffff);
  border-radius: 50%;
  object-fit: cover;
  box-shadow: 0 3px 10px rgba(11, 45, 87, 0.16);
}

.account-menu-identity {
  min-width: 0;
}

.account-menu-identity b,
.account-menu-identity small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.account-menu-identity b {
  font-size: 0.8rem;
  line-height: 1.25;
}

.account-menu-identity small {
  margin-top: 2px;
  color: var(--ksl-muted);
  font-size: 0.68rem;
}

.account-menu-chevron {
  color: var(--ksl-muted);
  font-size: 0.7rem;
  transition: transform 180ms ease;
}

.account-menu[open] .account-menu-chevron {
  transform: rotate(180deg);
}

.account-menu-panel {
  position: absolute;
  top: calc(100% + 9px);
  right: 0;
  width: min(340px, calc(100vw - 32px));
  padding: 12px;
  color: var(--ksl-ink);
  background: color-mix(in srgb, var(--ksl-card) 97%, #ffffff);
  border: 1px solid var(--ksl-line);
  border-radius: 16px;
  box-shadow: 0 22px 55px rgba(11, 45, 87, 0.22);
  animation: account-menu-in 150ms ease-out;
}

@keyframes account-menu-in {
  from { opacity: 0; transform: translateY(-5px) scale(0.985); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.account-menu-heading {
  display: grid;
  grid-template-columns: 10px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  padding: 4px 4px 11px;
  border-bottom: 1px solid var(--ksl-line);
}

.account-menu-heading b,
.account-menu-heading small {
  display: block;
  overflow-wrap: anywhere;
}

.account-menu-heading small {
  margin-top: 2px;
  color: var(--ksl-muted);
  font-size: 0.7rem;
}

.account-status-dot {
  width: 9px;
  height: 9px;
  background: var(--ksl-success);
  border: 2px solid color-mix(in srgb, var(--ksl-success) 20%, var(--ksl-card));
  border-radius: 50%;
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--ksl-success) 14%, transparent);
}

.account-session-meta {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin: 10px 0;
}

.account-session-meta div {
  min-width: 0;
  padding: 8px;
  background: color-mix(in srgb, var(--ksl-navy-soft) 40%, var(--ksl-card));
  border-radius: 10px;
}

.account-session-meta dt {
  margin-bottom: 3px;
  color: var(--ksl-muted);
  font-size: 0.62rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.account-session-meta dd {
  margin: 0;
  overflow: hidden;
  font-size: 0.69rem;
  font-weight: 700;
  line-height: 1.25;
  overflow-wrap: anywhere;
}

.account-menu-links {
  display: grid;
  gap: 3px;
}

.account-menu-links a {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  gap: 9px;
  align-items: center;
  min-height: 48px;
  padding: 7px 9px;
  color: var(--ksl-ink);
  text-decoration: none;
  border-radius: 10px;
  transition: color 150ms ease, background-color 150ms ease, transform 150ms ease;
}

.account-menu-links a:hover,
.account-menu-links a:focus-visible {
  color: var(--ksl-navy);
  background: color-mix(in srgb, var(--ksl-navy-soft) 56%, var(--ksl-card));
  outline: none;
  transform: translateX(2px);
}

.account-menu-links i {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  color: var(--ksl-navy);
  background: color-mix(in srgb, var(--ksl-navy-soft) 70%, var(--ksl-card));
  border-radius: 9px;
}

.account-menu-links b,
.account-menu-links small {
  display: block;
}

.account-menu-links b {
  font-size: 0.76rem;
}

.account-menu-links small {
  margin-top: 2px;
  color: var(--ksl-muted);
  font-size: 0.66rem;
}

.account-menu-links .account-menu-logout {
  margin-top: 4px;
  color: var(--ksl-danger);
  border-top: 1px solid var(--ksl-line);
  border-radius: 0 0 10px 10px;
}

.account-menu-links .account-menu-logout i {
  color: var(--ksl-danger);
  background: color-mix(in srgb, var(--ksl-danger) 10%, var(--ksl-card));
}

html[data-theme="dark"] .account-menu-panel,
html[data-theme="dark"] .account-menu-trigger {
  box-shadow: 0 20px 48px rgba(0, 0, 0, 0.34);
}

@media (max-width: 1100px) {
  .topbar-actions > .account-menu {
    grid-column: 1 / -1;
    justify-self: end;
  }
}

@media (min-width: 1281px) and (max-width: 1500px) {
  .topbar-actions-user {
    grid-template-columns: minmax(180px, 1fr) auto auto auto minmax(224px, 260px);
  }
}

@media (min-width: 1101px) and (max-width: 1280px) {
  .topbar-actions-user {
    grid-template-columns: minmax(180px, 1fr) auto auto auto;
  }

  .topbar-actions-user > .account-menu {
    grid-column: 1 / -1;
    justify-self: end;
  }
}

@media (max-width: 680px) {
  .topbar-actions > .account-menu {
    width: 100%;
    min-width: 0;
    justify-self: stretch;
  }

  .account-menu-trigger {
    width: 100%;
  }

  .account-menu-panel {
    right: 0;
    width: min(100%, 340px);
  }
}

@media (max-width: 420px) {
  .account-session-meta {
    grid-template-columns: 1fr;
  }
}

/* Notification center */
.notification-center-page,
.management-report-page {
  max-width: 1540px;
  margin-inline: auto;
}

.notification-hero,
.management-report-hero {
  position: relative;
  display: flex;
  gap: 24px;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 18px;
  padding: clamp(22px, 3vw, 34px);
  overflow: hidden;
  color: #fff;
  background:
    radial-gradient(circle at 88% 15%, rgba(199, 160, 68, 0.28), transparent 31%),
    linear-gradient(125deg, #062f5a 0%, #0b477f 60%, #64131a 100%);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 16px;
  box-shadow: 0 18px 42px rgba(0, 51, 102, 0.2);
}

.notification-hero::after,
.management-report-hero::after {
  content: "";
  position: absolute;
  right: -62px;
  bottom: -80px;
  width: 230px;
  height: 230px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 50%;
  box-shadow: 0 0 0 34px rgba(255, 255, 255, 0.035), 0 0 0 70px rgba(255, 255, 255, 0.025);
  pointer-events: none;
}

.notification-hero-copy {
  position: relative;
  z-index: 1;
  display: flex;
  gap: 17px;
  align-items: center;
  min-width: 0;
}

.notification-hero-icon {
  display: grid;
  flex: 0 0 auto;
  place-items: center;
  width: 58px;
  height: 58px;
  color: #fff2bd;
  font-size: 1.35rem;
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 16px;
  backdrop-filter: blur(8px);
}

.notification-hero .eyebrow,
.management-report-hero .eyebrow {
  margin-bottom: 5px;
  color: #f4d987;
}

.notification-hero h1,
.management-report-hero h1 {
  margin: 0;
  color: #fff;
  font-size: clamp(1.55rem, 3vw, 2.25rem);
  letter-spacing: -0.035em;
}

.notification-hero p:not(.eyebrow),
.management-report-hero p:not(.eyebrow) {
  max-width: 760px;
  margin: 7px 0 0;
  color: rgba(255, 255, 255, 0.78);
}

.notification-hero-action,
.management-report-actions {
  position: relative;
  z-index: 1;
  flex: 0 0 auto;
}

.notification-hero .btn-primary,
.management-report-hero .btn-primary {
  color: #15314e;
  background: #f2d275;
  border-color: #f2d275;
}

.notification-summary-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 18px;
}

.notification-summary-card {
  display: flex;
  gap: 13px;
  align-items: center;
  min-width: 0;
  padding: 16px;
  background: var(--ksl-card);
  border: 1px solid var(--ksl-line);
  border-radius: 12px;
  box-shadow: var(--shadow-sm);
}

.notification-summary-card > span {
  display: grid;
  flex: 0 0 auto;
  place-items: center;
  width: 42px;
  height: 42px;
  color: var(--ksl-navy);
  background: var(--ksl-navy-soft);
  border-radius: 12px;
}

.notification-summary-card.is-primary > span { color: var(--ksl-maroon); background: var(--ksl-red-soft); }
.notification-summary-card.is-warning > span { color: var(--ksl-warning); background: var(--ksl-gold-soft); }
.notification-summary-card strong,
.notification-summary-card small { display: block; }
.notification-summary-card strong { color: var(--ksl-ink); font-size: 1.45rem; line-height: 1; }
.notification-summary-card small { margin-top: 5px; color: var(--ksl-muted); font-size: 0.74rem; }

.notification-workspace {
  overflow: hidden;
  border-radius: 14px;
}

.notification-toolbar {
  display: flex;
  gap: 16px;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  background: color-mix(in srgb, var(--ksl-navy-soft) 38%, var(--ksl-card));
  border-bottom: 1px solid var(--ksl-line);
}

.notification-filter-tabs {
  display: flex;
  gap: 5px;
  min-width: 0;
  overflow-x: auto;
  scrollbar-width: thin;
}

.notification-filter-tabs button {
  display: inline-flex;
  gap: 7px;
  align-items: center;
  min-height: 36px;
  padding: 7px 11px;
  color: var(--ksl-muted);
  font-weight: 800;
  white-space: nowrap;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 9px;
  cursor: pointer;
}

.notification-filter-tabs button span {
  display: inline-grid;
  place-items: center;
  min-width: 21px;
  height: 21px;
  padding-inline: 5px;
  color: var(--ksl-muted);
  font-size: 0.67rem;
  background: var(--ksl-card);
  border: 1px solid var(--ksl-line);
  border-radius: 999px;
}

.notification-filter-tabs button.active {
  color: var(--ksl-navy);
  background: var(--ksl-card);
  border-color: var(--ksl-line);
  box-shadow: 0 5px 14px rgba(16, 32, 51, 0.06);
}

.notification-search {
  position: relative;
  flex: 0 1 310px;
}

.notification-search i {
  position: absolute;
  top: 50%;
  left: 12px;
  color: var(--ksl-muted);
  transform: translateY(-50%);
}

.notification-search input {
  width: 100%;
  min-height: 38px;
  padding-left: 35px;
  background: var(--ksl-card);
}

.notification-feed { display: grid; padding: 5px 16px 16px; }

.notification-card {
  display: grid;
  grid-template-columns: 46px minmax(0, 1fr);
  gap: 14px;
  padding: 17px 3px;
  border-bottom: 1px solid var(--ksl-line);
}

.notification-card[hidden] { display: none; }
.notification-card:last-of-type { border-bottom: 0; }
.notification-card.is-read { opacity: 0.72; }
.notification-card.is-unread { opacity: 1; }

.notification-type-icon {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  color: var(--ksl-navy);
  background: var(--ksl-navy-soft);
  border-radius: 12px;
}

.notification-type-icon.is-document { color: var(--ksl-maroon); background: var(--ksl-red-soft); }
.notification-type-icon.is-workflow { color: var(--ksl-warning); background: var(--ksl-gold-soft); }

.notification-card-body { min-width: 0; }
.notification-card-head { display: flex; gap: 14px; align-items: flex-start; justify-content: space-between; }
.notification-card-labels { display: flex; gap: 7px; align-items: center; margin-bottom: 4px; }
.notification-event-label { color: var(--ksl-navy); font-size: 0.67rem; font-weight: 900; letter-spacing: 0.06em; text-transform: uppercase; }
.notification-new-dot { padding: 2px 6px; color: #fff; font-size: 0.62rem; font-weight: 900; background: var(--ksl-maroon); border-radius: 999px; }
.notification-card h2 { margin: 0; color: var(--ksl-ink); font-size: 0.96rem; line-height: 1.35; }
.notification-card p { margin: 6px 0 0; color: var(--ksl-muted); font-size: 0.8rem; line-height: 1.55; }

.notification-card time {
  flex: 0 0 auto;
  color: var(--ksl-ink);
  font-size: 0.72rem;
  font-weight: 800;
  text-align: right;
}

.notification-card time small { display: block; margin-top: 2px; color: var(--ksl-muted); font-size: 0.65rem; font-weight: 600; }
.notification-card-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 12px; }
.notification-card-actions form { margin: 0; }
.btn-quiet { color: var(--ksl-muted); background: transparent; border-color: transparent; }
.btn-quiet:hover { color: var(--ksl-navy); background: var(--ksl-navy-soft); }
.notification-read-state { color: var(--ksl-success); font-size: 0.72rem; font-weight: 800; }

.notification-empty-state,
.management-empty {
  display: grid;
  justify-items: center;
  padding: 34px 18px;
  color: var(--ksl-muted);
  text-align: center;
}

.notification-empty-state[hidden] { display: none; }
.notification-empty-state > i,
.management-empty > i { margin-bottom: 10px; color: var(--ksl-navy); font-size: 1.6rem; }
.notification-empty-state h2 { margin: 0; color: var(--ksl-ink); font-size: 1rem; }
.notification-empty-state p { margin: 5px 0 0; }

/* Management reports */
.management-report-hero { align-items: flex-end; }
.management-report-actions { display: flex; flex-wrap: wrap; gap: 9px; justify-content: flex-end; }
.management-report-hero .btn-outline { color: #fff; background: rgba(255, 255, 255, 0.08); border-color: rgba(255, 255, 255, 0.3); }

.management-kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 18px;
}

.management-kpi {
  display: flex;
  gap: 14px;
  align-items: center;
  min-height: 128px;
  padding: 18px;
  background: var(--ksl-card);
  border: 1px solid var(--ksl-line);
  border-radius: 14px;
  box-shadow: var(--shadow-sm);
}

.management-kpi-icon {
  display: grid;
  flex: 0 0 auto;
  place-items: center;
  width: 48px;
  height: 48px;
  color: var(--ksl-navy);
  font-size: 1rem;
  background: var(--ksl-navy-soft);
  border-radius: 13px;
}

.management-kpi.is-risk .management-kpi-icon { color: var(--ksl-danger); background: var(--ksl-red-soft); }
.management-kpi.is-retention .management-kpi-icon { color: var(--ksl-warning); background: var(--ksl-gold-soft); }
.management-kpi small,
.management-kpi strong,
.management-kpi p { display: block; }
.management-kpi small { color: var(--ksl-muted); font-size: 0.69rem; font-weight: 900; letter-spacing: 0.045em; text-transform: uppercase; }
.management-kpi strong { margin-top: 3px; color: var(--ksl-ink); font-size: 1.35rem; line-height: 1.1; }
.management-kpi p { margin: 5px 0 0; color: var(--ksl-muted); font-size: 0.7rem; line-height: 1.4; }

.management-kpi-ring {
  position: relative;
  display: grid;
  flex: 0 0 auto;
  place-items: center;
  width: 64px;
  height: 64px;
  background: conic-gradient(var(--ksl-success) calc(var(--kpi-progress) * 1%), var(--ksl-line) 0);
  border-radius: 50%;
}

.management-kpi-ring::before { content: ""; position: absolute; inset: 7px; background: var(--ksl-card); border-radius: 50%; }
.management-kpi-ring span { position: relative; z-index: 1; color: var(--ksl-ink); font-size: 0.78rem; font-weight: 900; }

.management-insight-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(320px, 0.75fr);
  gap: 16px;
  margin-bottom: 18px;
}

.management-panel,
.management-audit-panel { padding: 20px; border-radius: 14px; }
.management-panel-head,
.management-audit-head { display: flex; gap: 16px; align-items: flex-start; justify-content: space-between; margin-bottom: 17px; }
.management-panel-kicker { display: block; margin-bottom: 4px; color: var(--ksl-maroon); font-size: 0.66rem; font-weight: 900; letter-spacing: 0.08em; text-transform: uppercase; }
.management-panel h2,
.management-audit-head h2 { margin: 0; color: var(--ksl-ink); font-size: 1.06rem; }
.management-panel-head p,
.management-audit-head p { margin: 5px 0 0; color: var(--ksl-muted); font-size: 0.75rem; }
.management-panel-badge { display: inline-flex; gap: 7px; align-items: center; flex: 0 0 auto; padding: 6px 9px; color: var(--ksl-navy); font-size: 0.68rem; font-weight: 800; background: var(--ksl-navy-soft); border-radius: 999px; }

.management-workload-list { display: grid; gap: 13px; }
.management-workload-row { display: grid; grid-template-columns: minmax(180px, 0.8fr) minmax(100px, 1fr) 34px; gap: 13px; align-items: center; }
.management-workload-person { display: flex; gap: 10px; align-items: center; min-width: 0; }
.management-workload-person > span { display: grid; flex: 0 0 auto; place-items: center; width: 34px; height: 34px; color: var(--ksl-navy); font-weight: 900; background: var(--ksl-navy-soft); border-radius: 10px; }
.management-workload-person b,
.management-workload-person small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.management-workload-person b { color: var(--ksl-ink); font-size: 0.76rem; }
.management-workload-person small { margin-top: 2px; color: var(--ksl-muted); font-size: 0.67rem; }
.management-workload-meter { height: 8px; overflow: hidden; background: var(--ksl-navy-soft); border-radius: 999px; }
.management-workload-meter span { display: block; width: var(--workload-width); height: 100%; background: linear-gradient(90deg, var(--ksl-navy), var(--ksl-gold)); border-radius: inherit; }
.management-workload-row > strong { color: var(--ksl-ink); font-size: 0.82rem; text-align: right; }

.compliance-watchlist { display: grid; gap: 10px; }
.compliance-watch-item { display: grid; grid-template-columns: 40px minmax(0, 1fr) 18px; gap: 11px; align-items: center; padding: 12px; color: inherit; text-decoration: none; background: color-mix(in srgb, var(--ksl-bg) 60%, var(--ksl-card)); border: 1px solid var(--ksl-line); border-radius: 11px; transition: border-color 150ms ease, transform 150ms ease; }
.compliance-watch-item:hover { border-color: var(--ksl-gold); transform: translateY(-1px); }
.compliance-watch-item > span { display: grid; place-items: center; width: 38px; height: 38px; color: var(--ksl-navy); background: var(--ksl-navy-soft); border-radius: 10px; }
.compliance-watch-item.is-risk > span { color: var(--ksl-danger); background: var(--ksl-red-soft); }
.compliance-watch-item.is-warning > span { color: var(--ksl-warning); background: var(--ksl-gold-soft); }
.compliance-watch-item b,
.compliance-watch-item small { display: block; }
.compliance-watch-item b { color: var(--ksl-ink); font-size: 0.75rem; }
.compliance-watch-item small { margin-top: 3px; color: var(--ksl-muted); font-size: 0.66rem; line-height: 1.4; }
.compliance-watch-item > i { color: var(--ksl-muted); font-size: 0.72rem; }

.management-audit-head { padding: 20px 20px 0; }
.management-audit-panel { padding: 0; overflow: hidden; }
.management-filter-bar { display: grid; grid-template-columns: repeat(3, minmax(140px, 1fr)) auto; gap: 11px; align-items: end; padding: 16px 20px; background: color-mix(in srgb, var(--ksl-navy-soft) 40%, var(--ksl-card)); border-block: 1px solid var(--ksl-line); }
.management-filter-action .btn { width: 100%; }
.management-audit-table { border: 0; border-radius: 0; }
.management-audit-table table { table-layout: fixed; min-width: 940px; }
.management-audit-table th { padding-block: 10px; font-size: 0.66rem; }
.management-audit-table td { padding-block: 9px; font-size: 0.72rem; vertical-align: top; }
.management-audit-table th:nth-child(1) { width: 122px; }
.management-audit-table th:nth-child(2) { width: 132px; }
.management-audit-table th:nth-child(3) { width: 100px; }
.management-audit-table th:nth-child(4) { width: 140px; }
.management-audit-table th:nth-child(5) { width: 120px; }
.management-audit-table th:nth-child(6) { width: 116px; }
.management-audit-table time,
.management-audit-table time small { display: block; white-space: nowrap; }
.management-audit-table time { color: var(--ksl-ink); font-weight: 800; }
.management-audit-table time small { margin-top: 2px; color: var(--ksl-muted); font-size: 0.64rem; font-weight: 600; }
.management-action-label { display: inline-block; padding: 4px 7px; color: var(--ksl-navy); font-size: 0.65rem; font-weight: 800; background: var(--ksl-navy-soft); border-radius: 6px; }

/* Browser-based OCR assistant */
.ocr-control-row { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; justify-content: space-between; margin-top: 12px; }
.ocr-control-row .switch { margin: 0; }
.ocr-assistant { display: grid; gap: 11px; margin-top: 12px; padding: 14px; background: color-mix(in srgb, var(--ksl-navy-soft) 48%, var(--ksl-card)); border: 1px solid color-mix(in srgb, var(--ksl-navy) 24%, var(--ksl-line)); border-radius: 12px; }
.ocr-assistant[hidden] { display: none; }
.ocr-assistant-head { display: flex; gap: 10px; align-items: center; }
.ocr-assistant-icon { display: grid; flex: 0 0 auto; place-items: center; width: 38px; height: 38px; color: var(--ksl-navy); background: var(--ksl-card); border: 1px solid var(--ksl-line); border-radius: 10px; }
.ocr-assistant-head b,
.ocr-assistant-head small { display: block; }
.ocr-assistant-head b { color: var(--ksl-ink); font-size: 0.78rem; }
.ocr-assistant-head small { margin-top: 2px; color: var(--ksl-muted); font-size: 0.68rem; line-height: 1.4; }
.ocr-progress { height: 7px; overflow: hidden; background: var(--ksl-card); border: 1px solid var(--ksl-line); border-radius: 999px; }
.ocr-progress span { display: block; width: 0; height: 100%; background: linear-gradient(90deg, var(--ksl-navy), var(--ksl-gold)); border-radius: inherit; transition: width 180ms ease; }
.ocr-status { margin: 0; color: var(--ksl-ink); font-size: 0.72rem; font-weight: 700; }
.ocr-result { display: grid; gap: 7px; }
.ocr-result[hidden] { display: none; }
.ocr-result label { color: var(--ksl-muted); font-size: 0.67rem; font-weight: 800; text-transform: uppercase; }
.ocr-result textarea { min-height: 112px; max-height: 220px; resize: vertical; background: var(--ksl-card); }
.ocr-privacy { margin: 0; color: var(--ksl-muted); font-size: 0.64rem; line-height: 1.45; }
.ocr-privacy i { margin-right: 5px; color: var(--ksl-success); }

@media (max-width: 1050px) {
  .notification-summary-grid,
  .management-kpi-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .management-insight-grid { grid-template-columns: 1fr; }
}

@media (max-width: 760px) {
  .notification-hero,
  .management-report-hero { align-items: flex-start; flex-direction: column; }
  .notification-hero-action,
  .notification-hero-action .btn,
  .management-report-actions { width: 100%; }
  .management-report-actions .btn { flex: 1 1 190px; }
  .notification-toolbar { align-items: stretch; flex-direction: column; }
  .notification-search { flex-basis: auto; }
  .notification-card-head { flex-direction: column; }
  .notification-card time { text-align: left; }
  .management-filter-bar { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .management-filter-action { grid-column: 1 / -1; }
}

@media (max-width: 520px) {
  .notification-summary-grid,
  .management-kpi-grid { grid-template-columns: 1fr; }
  .notification-hero-copy { align-items: flex-start; }
  .notification-hero-icon { width: 46px; height: 46px; border-radius: 12px; }
  .notification-card { grid-template-columns: 38px minmax(0, 1fr); gap: 10px; }
  .notification-type-icon { width: 38px; height: 38px; }
  .management-workload-row { grid-template-columns: minmax(0, 1fr) 30px; }
  .management-workload-meter { grid-column: 1 / -1; grid-row: 2; }
  .management-filter-bar { grid-template-columns: 1fr; }
  .management-filter-action { grid-column: auto; }
  .management-panel-head,
  .management-audit-head { align-items: flex-start; flex-direction: column; }
}
