/**
 * Portal clean UI — flat, minimal chrome for employee + admin shells.
 * Loads after inline theme styles; refines tokens and removes glossy / skeuomorphic chrome.
 */

/* —— Design tokens —— */
[data-theme="light"] {
  --portal-font-family: "Times New Roman", Times, "Liberation Serif", serif;
  /* Medium scale: 16px root; body at 1rem for readable serif UI */
  --portal-font-size-root: 16px;
  --portal-font-size-body: 1rem;
  --portal-font-size-sm: 0.875rem;
  --portal-font-size-xs: 0.8125rem;
  --portal-font-size-lg: 1.125rem;
  --portal-font-size-xl: 1.375rem;
  --portal-font-size-2xl: 1.5rem;
  --portal-line-height: 1.5;
  --portal-link: #4C75A3;
  --portal-link-hover: #3d6288;
  /* VK.com-style sidebar nav label blue */
  --sidebar-nav: #5181b8;
  --vk-nav-hover: #2a5885;
  --vk-nav-active-bg: #dae2eb;
  --vk-nav-active-border: #c5d0dc;
  --thread-top: #f8fafc;
  --thread-bottom: #f1f5f9;
  --nav-top: #ffffff;
  --nav-mid: #ffffff;
  --nav-bottom: #f8fafc;
  --nav-stroke: #e2e8f0;
  --bubble-in-top: #ffffff;
  --bubble-in-mid: #ffffff;
  --bubble-in-bottom: #ffffff;
  --bubble-in-stroke: #e2e8f0;
  --bubble-out-top: #3b82f6;
  --bubble-out-mid: #2563eb;
  --bubble-out-bottom: #1d4ed8;
  --bubble-out-stroke: #1e40af;
  --bg: #f1f5f9;
  --surface: #f8fafc;
  --panel: #ffffff;
  --border: #e2e8f0;
  --border-strong: #cbd5e1;
  --text: #0f172a;
  --muted: #64748b;
  --accent-muted: #eff6ff;
  --btn-primary-bg: #2563eb;
  --btn-primary-fg: #ffffff;
  --btn-surface-bg: #ffffff;
  --btn-surface-bg-hover: #f8fafc;
  --btn-surface-border: #e2e8f0;
  --btn-surface-border-hover: #cbd5e1;
  --btn-surface-fg: #0f172a;
  --btn-surface-fg-hover: #0f172a;
  --input-bg: #ffffff;
  --shadow: 0 1px 2px rgba(15, 23, 42, 0.05), 0 1px 3px rgba(15, 23, 42, 0.08);
  --radius: 8px;
  --radius-sm: 6px;
  --pill-bg: #f1f5f9;
  --tab-top: #ffffff;
  --tab-bottom: #f8fafc;
  --scrollbar-thumb: #cbd5e1;
  --scrollbar-thumb-hover: #94a3b8;
}

[data-theme="dark"] {
  --portal-font-family: "Times New Roman", Times, "Liberation Serif", serif;
  --portal-font-size-root: 16px;
  --portal-font-size-body: 1rem;
  --portal-font-size-sm: 0.875rem;
  --portal-font-size-xs: 0.8125rem;
  --portal-font-size-lg: 1.125rem;
  --portal-font-size-xl: 1.375rem;
  --portal-font-size-2xl: 1.5rem;
  --portal-line-height: 1.5;
  --portal-link: #4C75A3;
  --portal-link-hover: #6a94c0;
  --sidebar-nav: #6d9ecf;
  --vk-nav-hover: #93bce8;
  --vk-nav-active-bg: rgba(109, 158, 207, 0.2);
  --vk-nav-active-border: rgba(109, 158, 207, 0.35);
  --thread-top: #0f172a;
  --thread-bottom: #0f172a;
  --nav-top: #1e293b;
  --nav-mid: #1e293b;
  --nav-bottom: #1e293b;
  --nav-stroke: #334155;
  --bubble-in-top: #1e293b;
  --bubble-in-mid: #1e293b;
  --bubble-in-bottom: #1e293b;
  --bubble-in-stroke: #334155;
  --bubble-out-top: #60a5fa;
  --bubble-out-mid: #3b82f6;
  --bubble-out-bottom: #2563eb;
  --bubble-out-stroke: #1d4ed8;
  --bg: #0f172a;
  --surface: #1e293b;
  --panel: #1e293b;
  --border: #334155;
  --border-strong: #475569;
  --text: #f1f5f9;
  --muted: #94a3b8;
  --accent-muted: rgba(59, 130, 246, 0.12);
  --btn-primary-bg: #3b82f6;
  --btn-primary-fg: #ffffff;
  --btn-surface-bg: #1e293b;
  --btn-surface-bg-hover: #334155;
  --btn-surface-border: #475569;
  --btn-surface-border-hover: #64748b;
  --btn-surface-fg: #f1f5f9;
  --btn-surface-fg-hover: #ffffff;
  --input-bg: #0f172a;
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.25);
  --radius: 8px;
  --radius-sm: 6px;
  --pill-bg: #334155;
  --tab-top: #1e293b;
  --tab-bottom: #0f172a;
  --scrollbar-thumb: #475569;
  --scrollbar-thumb-hover: #64748b;
}

/* —— Typography & page —— */
html {
  font-size: var(--portal-font-size-root, 16px);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

html,
body {
  font-family: var(--portal-font-family) !important;
  font-size: var(--portal-font-size-body, 1rem) !important;
  line-height: var(--portal-line-height, 1.5) !important;
}

button,
input,
select,
textarea,
optgroup {
  font-family: inherit;
  font-size: var(--portal-font-size-body, 1rem);
}

.btn {
  font-size: 0.9375rem !important;
}

.side-link,
.side-link--link,
.side-aux {
  font-size: 1rem !important;
}

.topbar__title {
  font-size: var(--portal-font-size-lg, 1.125rem) !important;
  font-weight: 600 !important;
  text-transform: none !important;
  letter-spacing: -0.01em !important;
}

[data-theme="light"] body {
  background-image: none !important;
  background-color: var(--bg) !important;
}

[data-theme="dark"] body {
  background: var(--bg) !important;
}

a {
  color: var(--portal-link, #4C75A3);
}

a:hover {
  color: var(--portal-link-hover, #3d6288);
}

/* —— Shell: sidebar & top bar (flat) —— */
[data-theme="light"] .sidebar__brand::after,
[data-theme="dark"] .sidebar__brand::after,
[data-theme="light"] .topbar::after,
[data-theme="dark"] .topbar::after {
  display: none !important;
}

[data-theme="light"] .sidebar,
[data-theme="dark"] .sidebar {
  background: var(--panel) !important;
  border-right: 1px solid var(--border) !important;
  box-shadow: none !important;
}

[data-theme="light"] .sidebar__brand,
[data-theme="dark"] .sidebar__brand {
  background: var(--panel) !important;
  border-bottom: 1px solid var(--border) !important;
  box-shadow: none !important;
}

[data-theme="light"] .sidebar__brand .brand-logos__block,
[data-theme="dark"] .sidebar__brand .brand-logos__block {
  background: #0a0a0c !important;
  border-color: rgba(255, 255, 255, 0.12) !important;
}

[data-theme="light"] .sidebar__bottom,
[data-theme="dark"] .sidebar__bottom {
  border-top: 1px solid var(--border) !important;
}

[data-theme="light"] .topbar,
[data-theme="dark"] .topbar {
  background: var(--panel) !important;
  border-bottom: 1px solid var(--border) !important;
  box-shadow: none !important;
  color: var(--text) !important;
}

[data-theme="light"] .topbar__title,
[data-theme="dark"] .topbar__title {
  color: var(--text) !important;
  text-shadow: none !important;
  font-weight: 600 !important;
  letter-spacing: -0.01em;
}

[data-theme="light"] .topbar .btn-signout,
[data-theme="light"] .topbar .sidebar-toggle,
[data-theme="dark"] .topbar .btn-signout,
[data-theme="dark"] .topbar .sidebar-toggle,
[data-theme="light"] .sidebar-toggle,
[data-theme="dark"] .sidebar-toggle {
  color: var(--text) !important;
  background: var(--panel) !important;
  border: 1px solid var(--border) !important;
  box-shadow: none !important;
  text-shadow: none !important;
  border-radius: var(--radius-sm) !important;
}

[data-theme="light"] .topbar .btn-signout:hover,
[data-theme="light"] .topbar .sidebar-toggle:hover,
[data-theme="dark"] .topbar .btn-signout:hover,
[data-theme="dark"] .topbar .sidebar-toggle:hover,
[data-theme="light"] .sidebar-toggle:hover,
[data-theme="dark"] .sidebar-toggle:hover {
  background: var(--surface) !important;
  border-color: var(--border-strong) !important;
  color: var(--text) !important;
}

/* Top-right header: VK classic nav blue (matches sidebar links) */
[data-theme="light"] .topbar-notif,
[data-theme="dark"] .topbar-notif {
  color: var(--sidebar-nav, #5181b8) !important;
  background: transparent !important;
  border: 1px solid transparent !important;
  border-radius: var(--radius-sm) !important;
  font-weight: 400 !important;
  box-shadow: none !important;
}

[data-theme="light"] .topbar-notif:hover,
[data-theme="dark"] .topbar-notif:hover {
  color: var(--vk-nav-hover, #2a5885) !important;
  background: rgba(81, 129, 184, 0.1) !important;
  border-color: transparent !important;
}

[data-theme="dark"] .topbar-notif:hover {
  background: rgba(109, 158, 207, 0.14) !important;
}

[data-theme="light"] .topbar-notif.is-active,
[data-theme="dark"] .topbar-notif.is-active {
  color: var(--vk-nav-hover, #2a5885) !important;
  background: var(--vk-nav-active-bg, #dae2eb) !important;
  border-color: var(--vk-nav-active-border, #c5d0dc) !important;
}

[data-theme="light"] .topbar-notif:focus-visible,
[data-theme="dark"] .topbar-notif:focus-visible {
  outline: 2px solid var(--sidebar-nav, #5181b8) !important;
  outline-offset: 2px;
}

[data-theme="light"] .topbar-profile__trigger,
[data-theme="dark"] .topbar-profile__trigger {
  color: var(--sidebar-nav, #5181b8) !important;
  background: transparent !important;
  border: 1px solid transparent !important;
  border-radius: var(--radius-sm) !important;
  box-shadow: none !important;
}

[data-theme="light"] .topbar-profile__trigger:hover,
[data-theme="dark"] .topbar-profile__trigger:hover {
  color: var(--vk-nav-hover, #2a5885) !important;
  background: rgba(81, 129, 184, 0.1) !important;
  border-color: transparent !important;
}

[data-theme="dark"] .topbar-profile__trigger:hover {
  background: rgba(109, 158, 207, 0.14) !important;
}

[data-theme="light"] .topbar-profile__trigger:focus-visible,
[data-theme="dark"] .topbar-profile__trigger:focus-visible {
  outline: 2px solid var(--sidebar-nav, #5181b8) !important;
  outline-offset: 2px;
}

[data-theme="light"] .topbar-profile__photo,
[data-theme="dark"] .topbar-profile__photo {
  background: var(--pill-bg, #f1f5f9) !important;
  border: 1px solid var(--border) !important;
}

[data-theme="light"] .topbar-profile__fallback,
[data-theme="dark"] .topbar-profile__fallback {
  background: var(--sidebar-nav, #5181b8) !important;
  color: #fff !important;
}

[data-theme="light"] .topbar-profile__chev,
[data-theme="dark"] .topbar-profile__chev {
  opacity: 0.85;
}

[data-theme="light"] .topbar-profile__trigger-emp,
[data-theme="dark"] .topbar-profile__trigger-emp {
  color: var(--muted) !important;
}

[data-theme="light"] .topbar-profile__menu-item,
[data-theme="dark"] .topbar-profile__menu-item {
  color: var(--sidebar-nav, #5181b8) !important;
}

[data-theme="light"] .topbar-profile__menu-item:hover,
[data-theme="dark"] .topbar-profile__menu-item:hover {
  color: var(--vk-nav-hover, #2a5885) !important;
  background: rgba(81, 129, 184, 0.1) !important;
}

[data-theme="dark"] .topbar-profile__menu-item:hover {
  background: rgba(109, 158, 207, 0.14) !important;
}

[data-theme="light"] .topbar-profile__menu-item#logoutBtn,
[data-theme="dark"] .topbar-profile__menu-item#logoutBtn {
  color: var(--muted) !important;
}

[data-theme="light"] .topbar-profile__menu-item#logoutBtn:hover,
[data-theme="dark"] .topbar-profile__menu-item#logoutBtn:hover {
  color: var(--text) !important;
  background: var(--accent-muted) !important;
}

/* —— Navigation —— */
[data-theme="light"] .side-link,
[data-theme="light"] .side-link--link,
[data-theme="light"] .side-aux,
[data-theme="dark"] .side-link,
[data-theme="dark"] .side-link--link,
[data-theme="dark"] .side-aux {
  color: var(--sidebar-nav, #5181b8) !important;
  border-radius: var(--radius-sm) !important;
}

[data-theme="light"] .side-link:hover,
[data-theme="light"] .side-link.active,
[data-theme="light"] .side-link--link:hover,
[data-theme="light"] .side-aux:hover,
[data-theme="dark"] .side-link:hover,
[data-theme="dark"] .side-link.active,
[data-theme="dark"] .side-link--link:hover,
[data-theme="dark"] .side-aux:hover {
  color: var(--text) !important;
  background: var(--accent-muted) !important;
}

[data-theme="light"] .side-link.active,
[data-theme="dark"] .side-link.active {
  border-left-color: var(--sidebar-nav, #5181b8) !important;
  font-weight: 500;
}

/* —— Cards & login —— */
[data-theme="light"] .card,
[data-theme="dark"] .card,
[data-theme="light"] .login-card,
[data-theme="dark"] .login-card {
  background: var(--panel) !important;
  border: 1px solid var(--border) !important;
  box-shadow: var(--shadow) !important;
}

.login-card h1 {
  font-size: 1.125rem !important;
  font-weight: 600 !important;
  letter-spacing: -0.02em !important;
  margin-bottom: 1rem !important;
}

.main {
  padding: 1.25rem 1.35rem !important;
}

@media (min-width: 768px) {
  .main {
    padding: 1.5rem 1.75rem !important;
  }
}

/* —— Forms —— */
label {
  text-transform: none !important;
  letter-spacing: 0 !important;
  font-size: var(--portal-font-size-sm, 0.8125rem) !important;
  font-weight: 500 !important;
  color: var(--text) !important;
  margin-bottom: 0.375rem !important;
}

[data-theme="light"] input,
[data-theme="light"] select,
[data-theme="light"] textarea,
[data-theme="dark"] input,
[data-theme="dark"] select,
[data-theme="dark"] textarea {
  border-radius: var(--radius-sm) !important;
  border-color: var(--border) !important;
  box-shadow: none !important;
}

[data-theme="light"] input:focus,
[data-theme="light"] select:focus,
[data-theme="light"] textarea:focus,
[data-theme="dark"] input:focus,
[data-theme="dark"] select:focus,
[data-theme="dark"] textarea:focus {
  border-color: var(--bubble-out-mid) !important;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15) !important;
}

[data-theme="dark"] input:focus,
[data-theme="dark"] select:focus,
[data-theme="dark"] textarea:focus {
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.22) !important;
}

/* —— Buttons —— */
[data-theme="light"] .btn.primary,
[data-theme="dark"] .btn.primary {
  background: var(--btn-primary-bg) !important;
  border-color: var(--bubble-out-bottom) !important;
  box-shadow: none !important;
  text-shadow: none !important;
  font-weight: 500 !important;
}

[data-theme="light"] .btn.primary:hover,
[data-theme="dark"] .btn.primary:hover {
  filter: brightness(1.05) !important;
}

[data-theme="light"] .btn:not(.primary):not(.ghost),
[data-theme="dark"] .btn:not(.primary):not(.ghost) {
  background: var(--panel) !important;
  border-color: var(--border) !important;
  box-shadow: none !important;
}

[data-theme="light"] .btn:not(.primary):not(.ghost):hover,
[data-theme="dark"] .btn:not(.primary):not(.ghost):hover {
  background: var(--surface) !important;
  border-color: var(--border-strong) !important;
}

.btn {
  border-radius: var(--radius-sm) !important;
  font-weight: 500 !important;
}

.btn.ghost {
  border-color: transparent !important;
}

.btn.ghost:hover {
  background: var(--accent-muted) !important;
}

/* —— Tables —— */
table {
  border-collapse: collapse;
}

th {
  font-weight: 600 !important;
  font-size: var(--portal-font-size-sm, 0.8125rem) !important;
  text-transform: none !important;
  letter-spacing: 0 !important;
  color: var(--muted) !important;
}

/* —— Task / ticket toolbars (shared CSS file) —— */
.tm-tab {
  text-transform: none !important;
  letter-spacing: 0 !important;
  font-size: var(--portal-font-size-sm, 0.8125rem) !important;
  font-weight: 500 !important;
  border-radius: var(--radius-sm) !important;
}

.tm-tab.is-active {
  background: var(--accent-muted) !important;
  color: var(--portal-link, #4C75A3) !important;
  border-color: var(--border) !important;
}

.tm-task-card,
.tm-series-card {
  border-radius: var(--radius) !important;
  box-shadow: none !important;
}

/* —— Modals —— */
.modal-dialog {
  border-radius: var(--radius) !important;
  border: 1px solid var(--border) !important;
  box-shadow: 0 8px 30px rgba(15, 23, 42, 0.12) !important;
}

[data-theme="dark"] .modal-dialog {
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.45) !important;
}

.modal-head h2 {
  font-weight: 600 !important;
  letter-spacing: -0.02em !important;
}

/* —— Muted text —— */
.muted {
  color: var(--muted) !important;
  font-size: var(--portal-font-size-sm, 0.8125rem) !important;
}

.small {
  font-size: var(--portal-font-size-sm, 0.8125rem) !important;
}

/* Task / ticket tables & cards */
.tm-data-table th,
.tm-data-table td,
.tm-table-compact th,
.tm-table-compact td,
.data-table th,
.data-table td {
  font-size: var(--portal-font-size-sm, 0.8125rem) !important;
}

.tm-table-title,
.tm-table-cell--title .tm-table-title {
  font-size: 0.875rem !important;
  font-weight: 500 !important;
}

.tm-task-card__title,
.tm-series-card__title {
  font-size: 0.875rem !important;
  font-weight: 500 !important;
  line-height: 1.35 !important;
}

.kv-k,
.tm-detail-tags-block__title {
  font-size: var(--portal-font-size-xs, 0.75rem) !important;
}

/* —— Section headings in main (exclude compact .page-title labels) —— */
.main h2:not(.page-title),
.main .section-title:not(.page-title) {
  font-weight: 600;
  font-size: 1.0625rem !important;
  letter-spacing: -0.01em;
  color: var(--text);
}

.main h3:not(.page-title) {
  font-size: 1rem !important;
  font-weight: 600 !important;
}

#appView h2.page-title,
#appView h3.page-title,
.main h2.page-title,
.main h3.page-title {
  font-size: 0.8125rem !important;
  font-weight: 600 !important;
  text-transform: uppercase !important;
  letter-spacing: 0.06em !important;
  color: var(--muted) !important;
}

/* Dashboard widget headings */
.dash-analytics-card__title,
.dash-active-work-card__head .page-title,
.dash-done-trend-card__head .page-title,
.dash-active-work-section__label,
.dash-active-work-metrics__title,
.dash-active-deployments-card__head .page-title,
.dash-job-panel__head {
  font-size: 0.875rem !important;
  font-weight: 600 !important;
  text-transform: none !important;
  letter-spacing: 0.01em !important;
  color: var(--text) !important;
}

.dash-analytics-kpi__v,
.dash-active-work-metric__v {
  font-size: 1.125rem !important;
}

.tm-section-title {
  font-size: 0.9375rem !important;
  font-weight: 600 !important;
}

/* —— Dashboard —— */
.dash-bar,
.dash-banner,
.dash-footnote,
.dash-hint {
  font-size: var(--portal-font-size-sm, 0.875rem) !important;
}

.kv-k {
  font-size: var(--portal-font-size-xs, 0.8125rem) !important;
}

.kv-v {
  font-size: var(--portal-font-size-body, 1rem) !important;
}

/* —— Deployment / active-dep modals —— */
.active-dep-modal__title {
  font-size: var(--portal-font-size-lg, 1.125rem) !important;
  font-weight: 600 !important;
}

.active-dep-modal__field label {
  font-size: var(--portal-font-size-sm, 0.875rem) !important;
}

.active-dep-modal__panel input,
.active-dep-modal__panel select,
.active-dep-modal__panel textarea {
  font-size: var(--portal-font-size-body, 1rem) !important;
}

/* —— Work desk / timesheet report (full viewport) —— */
#tsPdfModal.active-dep-modal.hidden {
  display: none !important;
}

#tsPdfModal.active-dep-modal--report-fullpage:not(.hidden),
#tsPdfModal.active-dep-modal--report:not(.active-dep-modal--report-wide):not(.hidden) {
  position: fixed !important;
  inset: 0 !important;
  z-index: 120 !important;
  display: flex !important;
  flex-direction: column !important;
  align-items: stretch !important;
  justify-content: stretch !important;
  padding: 0 !important;
  width: 100vw !important;
  height: 100vh !important;
  max-width: none !important;
  box-sizing: border-box !important;
}

#tsPdfModal.active-dep-modal {
  padding: 0 !important;
  align-items: stretch !important;
  justify-content: stretch !important;
}

#tsPdfModal.active-dep-modal--report-wide {
  padding: 1rem !important;
  align-items: center !important;
  justify-content: center !important;
  width: auto !important;
  height: auto !important;
}

#tsPdfModal.active-dep-modal--report-fullpage .active-dep-modal__panel,
#tsPdfModal.active-dep-modal--report:not(.active-dep-modal--report-wide) .active-dep-modal__panel {
  flex: 1 1 auto !important;
  align-self: stretch !important;
  width: 100% !important;
  max-width: none !important;
  min-width: 0 !important;
  height: 100% !important;
  max-height: none !important;
  border-radius: 0 !important;
  border: none !important;
  box-shadow: none !important;
  padding: 0 !important;
  overflow: hidden !important;
  display: flex !important;
  flex-direction: column !important;
}

#tsPdfModal.active-dep-modal--report-wide .active-dep-modal__panel {
  flex: 0 1 auto !important;
  align-self: center !important;
  width: 100% !important;
  max-width: min(72rem, 98vw) !important;
  height: auto !important;
  max-height: min(94vh, 56rem) !important;
  border-radius: var(--radius) !important;
  border: 1px solid var(--border) !important;
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.35) !important;
  padding: 1rem 1.1rem 1.1rem !important;
  overflow: auto !important;
}

#tsPdfModal .dash-report-shell {
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  min-height: 0;
  height: 100%;
}

#tsPdfModal .dash-report-shell__head {
  flex-shrink: 0;
  margin: 0;
  padding: 1rem 1.5rem;
  border-bottom: 1px solid var(--border);
}

#tsPdfModal .dash-report-shell__controls {
  flex-shrink: 0;
  padding: 1rem 1.5rem 1.25rem;
  border-bottom: 1px solid var(--border);
}

#tsPdfModal .dash-report-desc {
  margin: 0;
  font-size: var(--portal-font-size-body, 1rem) !important;
  line-height: var(--portal-line-height, 1.5);
  max-width: 52rem;
}

#tsPdfModal .dash-report-form {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: flex-start;
  gap: 1rem 1.5rem;
  margin-top: 1rem;
  width: 100%;
}

#tsPdfModal .dash-report-form__dates {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem 1.25rem;
  flex: 1 1 22rem;
  min-width: 0;
  max-width: 40rem;
}

#tsPdfModal .dash-report-form__dates .active-dep-modal__field {
  flex: 1 1 11rem;
  min-width: 10rem;
  margin-bottom: 0;
}

#tsPdfModal .dash-report-form__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.625rem;
  align-items: center;
  margin: 0;
  padding: 0;
  flex: 1 1 auto;
}

#tsPdfModal .dash-report-preview {
  flex: 1 1 auto;
  min-height: 0;
  margin: 0;
  border: 0;
  border-radius: 0;
  display: flex;
  flex-direction: column;
}

#tsPdfModal .dash-report-preview__label {
  font-size: var(--portal-font-size-sm, 0.875rem) !important;
  font-weight: 600 !important;
  padding: 0.625rem 1rem;
}

#tsPdfModal .dash-report-preview__frame {
  flex: 1 1 auto;
  min-height: 16rem;
  height: auto;
}

#tsPdfModal .dash-report-status {
  margin: 0.625rem 0 0;
  font-size: var(--portal-font-size-sm, 0.875rem) !important;
}

#tsPdfModal .active-dep-modal__title {
  font-size: var(--portal-font-size-xl, 1.375rem) !important;
}

/* Sidebar nav pills — minimum readable size */
.wd-presence-pill--nav-sub {
  font-size: 0.8125rem !important;
}

/* —— Portal typography normalization (employee + admin shells) —— */
#appView,
#adminApp,
.admin-shell {
  font-size: var(--portal-font-size-body, 1rem);
}

#appView .muted,
#adminApp .muted,
.admin-shell .muted,
.small,
.note {
  font-size: var(--portal-font-size-sm, 0.875rem) !important;
  line-height: var(--portal-line-height, 1.5) !important;
}

#appView label,
#adminApp label,
.admin-shell label,
.active-dep-modal__field label {
  font-size: var(--portal-font-size-sm, 0.875rem) !important;
}

#appView input,
#appView select,
#appView textarea,
#adminApp input,
#adminApp select,
#adminApp textarea {
  font-size: var(--portal-font-size-body, 1rem) !important;
}

.side-nav__badge,
.tm-sm-btn,
.tm-tab,
.dash-tab,
.wd-presence-pill,
[class*="__badge"],
[class*="__count"]:not(.dash-tab__count) {
  font-size: 0.8125rem !important;
}

.dash-tab,
.tm-tab {
  font-size: 0.9375rem !important;
}

.kv-k,
.tm-detail-tags-block__title,
.dash-presence-card .kv-k {
  font-size: var(--portal-font-size-xs, 0.8125rem) !important;
  letter-spacing: 0.04em !important;
}

.kv-v,
.dash-presence-card .kv-v {
  font-size: var(--portal-font-size-body, 1rem) !important;
}

.topbar__title {
  font-size: 1.0625rem !important;
}

.card-title {
  font-size: 1rem !important;
  font-weight: 600 !important;
}

/* Task/ticket list titles — keep compact (override any main h2 rules) */
#appView .tm-table-title,
#appView .tm-table-cell--title .tm-table-title,
#appView .tm-task-card__title,
#appView .tm-series-card__title {
  font-size: 0.875rem !important;
  font-weight: 500 !important;
  text-transform: none !important;
  letter-spacing: normal !important;
  color: var(--text) !important;
}

/* Floor for micro copy in dashboard cards and tables */
#appView .dash-presence-card,
#appView .dash-kpi,
#appView .tm-task-card,
#appView .tm-series-card,
#appView .data-table,
#appView .tm-data-table {
  font-size: var(--portal-font-size-body, 1rem);
}

#appView .dash-presence-card [style*="font-size"],
#appView .dash-kpi [style*="font-size"] {
  font-size: inherit !important;
}
