:root {
  /* Azure DevOps-inspired light theme */
  --bg: #f5f5f5;
  --surface: #ffffff;
  --surface-raised: #faf9f8;
  --surface-hover: #f3f2f1;
  --heading: #201f1e;
  --primary-soft: #deecf9;
  --sidebar: #fafafa;
  --sidebar-hover: #eaeaea;
  --sidebar-active: #e6f2fb;
  --primary: #0078d4;
  --primary-dark: #106ebe;
  --primary-darker: #005a9e;
  --text: #201f1e;
  --muted: #605e5c;
  --border: #e1dfdd;
  --border-strong: #8a8886;
  --danger: #d13438;
  --success: #107c10;
  --warning: #c19c00;
  --radius: 0px;
  --topbar-bg: #ffffff;
}

/* Dark mode lives in one block near the end of this file. */

* {
  box-sizing: border-box;
}

body,
button,
input,
select,
textarea,
h1,
h2,
h3,
h4,
h5,
h6 {
  font-family: "Segoe UI", -apple-system, BlinkMacSystemFont, "Roboto", sans-serif;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
}

a {
  color: inherit;
  text-decoration: none;
}

/* Layout */
.app-shell {
  display: flex;
  min-height: 100vh;
}

.sidebar {
  width: 272px;
  flex-shrink: 0;
  background: var(--sidebar);
  color: var(--text);
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow: hidden;
  border-right: 1px solid var(--border);
  box-shadow: 1px 0 0 rgba(0, 0, 0, 0.02);
}

/* Two-column sidebar (SmartHR-style) */
.sidebar.two-col {
  width: auto;
  flex-direction: row;
  align-items: stretch;
  overflow: visible;
  z-index: 30;
}

.sidebar.two-col.is-collapsed {
  width: 64px;
}

.sidebar.two-col.is-expanded {
  width: 296px;
}

.sidebar-rail {
  width: 64px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 10px 0 12px;
  background: var(--surface);
  border-right: 1px solid var(--border);
  z-index: 40;
  overflow: visible;
  position: relative;
  height: 100vh;
  max-height: 100vh;
}

.sidebar-mark {
  position: relative;
  width: 44px;
  height: 44px;
  padding: 0;
  margin-bottom: 10px;
  border: none;
  background: transparent;
  border-radius: 10px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  overflow: visible;
}

.sidebar-mark:hover {
  background: var(--sidebar-hover);
}

.sidebar-mark-img {
  width: 36px;
  height: 36px;
  object-fit: contain;
  border-radius: 50%;
  display: block;
}

.sidebar-rail-mods {
  flex: 1 1 auto;
  min-height: 0;
  width: 100%;
  overflow-x: visible;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 4px 0;
  scrollbar-width: thin;
}

.sidebar-rail-tools {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding-top: 8px;
  margin-top: 0;
  border-top: 1px solid var(--border);
  flex-shrink: 0;
  overflow: visible;
  position: relative;
  z-index: 5;
  background: var(--surface);
}

.sidebar-rail-btn {
  position: relative;
  width: 44px;
  height: 44px;
  padding: 0;
  border: none;
  border-radius: 10px;
  background: transparent;
  color: #323130;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  overflow: visible;
}

.sidebar-rail-btn:hover,
.sidebar-rail-btn.open {
  background: var(--sidebar-hover);
  color: #201f1e;
}

.sidebar-rail-btn.active {
  background: var(--sidebar-active);
  color: var(--primary);
}

.sidebar-rail-ico {
  position: relative;
  width: 22px;
  height: 22px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  line-height: 1;
  color: inherit;
}

.sidebar-rail-ico .nav-ico-svg,
.sidebar-rail-ico svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
}

.sidebar-rail-badge {
  position: absolute;
  top: -6px;
  right: -8px;
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  border-radius: 999px;
  background: var(--danger);
  color: #fff;
  font-size: 10px;
  font-weight: 600;
  line-height: 16px;
  text-align: center;
}

.sidebar-rail-tip {
  position: absolute;
  left: calc(100% + 12px);
  top: 50%;
  transform: translateY(-50%);
  white-space: nowrap;
  padding: 7px 11px;
  border-radius: 6px;
  background: #201f1e;
  color: #fff;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.01em;
  pointer-events: none;
  opacity: 0;
  visibility: hidden;
  z-index: 1000;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.22);
  display: flex;
  flex-direction: column;
  gap: 2px;
  max-width: 220px;
  line-height: 1.25;
}

.sidebar-rail-tip::before {
  content: "";
  position: absolute;
  left: -5px;
  top: 50%;
  transform: translateY(-50%);
  border: 5px solid transparent;
  border-right-color: #201f1e;
}

.sidebar-rail-tip.is-floating {
  position: fixed;
  left: auto;
  transform: translateY(-50%);
  opacity: 1;
  visibility: visible;
  z-index: 5000;
}

.sidebar-rail-tip-sub {
  font-size: 11px;
  opacity: 0.8;
  font-weight: 400;
}

.sidebar-rail-btn:hover .sidebar-rail-tip,
.sidebar-rail-btn:focus-visible .sidebar-rail-tip,
.sidebar-mark:hover .sidebar-rail-tip,
.sidebar-mark:focus-visible .sidebar-rail-tip {
  opacity: 1;
  visibility: visible;
}

.sidebar-rail-more {
  position: relative;
  display: flex;
  justify-content: center;
  width: 100%;
  flex-shrink: 0;
  overflow: visible;
  z-index: 6;
}

.sidebar-rail-tray {
  position: fixed;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 2px;
  padding: 8px;
  min-width: 196px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.16);
  z-index: 4000;
  pointer-events: auto;
}

.sidebar-rail-btn[aria-expanded="true"] > .sidebar-rail-tip {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.sidebar-rail-tray .sidebar-rail-btn,
.sidebar-rail-tray .theme-picker.is-compact,
.sidebar-rail-tray .notif-bell.is-compact {
  width: 100%;
  justify-content: flex-start;
}

.sidebar-rail-tray .sidebar-rail-btn {
  height: 40px;
  padding: 0 10px;
  gap: 10px;
  border-radius: 4px;
}

.sidebar-rail-tray .sidebar-rail-tip {
  position: static;
  transform: none;
  opacity: 1;
  visibility: visible;
  background: none;
  color: inherit;
  box-shadow: none;
  padding: 0;
  font-weight: 600;
  font-size: 13px;
  max-width: none;
  white-space: nowrap;
}

.sidebar-rail-tray .sidebar-rail-tip::before,
.sidebar-rail-tray .sidebar-rail-tip-sub {
  display: none;
}

.sidebar-rail-user {
  position: relative;
}

.sidebar-rail-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--primary);
  color: #fff;
  font-size: 12px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.sidebar-rail-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.sidebar-rail-user-menu {
  position: absolute;
  left: calc(100% + 8px);
  bottom: 0;
  min-width: 200px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 4px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.16);
  padding: 6px;
  z-index: 50;
}

.sidebar-rail-user-meta {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 8px 10px 6px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 4px;
}

.sidebar-rail-user-meta strong {
  font-size: 13px;
  font-weight: 600;
}

.notif-bell.is-compact {
  position: relative;
}

.notif-bell.is-compact .bell-pop {
  left: calc(100% + 8px);
  right: auto;
  top: auto;
  bottom: 0;
}

.sidebar-panel {
  width: 232px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  min-width: 0;
  background: var(--sidebar);
  overflow: hidden;
  position: relative;
  z-index: 1;
}

.sidebar.two-col .sidebar-nav {
  padding: 8px 0 16px;
  overflow-y: auto;
  flex: 1;
  min-height: 0;
}

.sidebar.two-col .nav-section {
  margin: 6px 10px 6px;
  padding: 8px 10px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--heading);
  background: color-mix(in srgb, var(--primary) 8%, #fff);
  border-radius: 4px;
  border-left: 3px solid var(--primary);
  line-height: 1.3;
}

.sidebar.two-col .nav-link {
  margin: 1px 8px;
  padding: 8px 10px;
  gap: 10px;
  font-size: 12.5px;
  font-weight: 500;
  border-radius: 4px;
  width: calc(100% - 16px);
  color: #323130;
  border-left: 3px solid transparent;
  transition: background 0.15s ease, color 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
  box-sizing: border-box;
}

.sidebar.two-col .nav-link:hover {
  background: color-mix(in srgb, var(--primary) 10%, var(--sidebar));
  color: var(--primary-darker, #005a9e);
  border-left-color: color-mix(in srgb, var(--primary) 55%, transparent);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--primary) 14%, transparent);
}

.sidebar.two-col .nav-link.active {
  background: var(--sidebar-active);
  color: var(--primary-darker, #005a9e);
  border-left-color: var(--primary);
  font-weight: 600;
}

.sidebar.two-col .nav-link:hover .nav-ico,
.sidebar.two-col .nav-link.active .nav-ico {
  color: var(--primary);
}

.sidebar.two-col .nav-ico {
  width: 18px;
  height: 18px;
  color: #605e5c;
  flex-shrink: 0;
}

.sidebar.two-col .nav-label {
  font-weight: 500;
  letter-spacing: 0.01em;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sidebar-rail-btn {
  transition: background 0.15s ease, color 0.15s ease, box-shadow 0.15s ease, transform 0.12s ease;
}

.sidebar-rail-btn:hover {
  background: color-mix(in srgb, var(--primary) 12%, var(--sidebar));
  color: var(--primary-darker, #005a9e);
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--primary) 22%, transparent);
  transform: translateY(-1px);
}

.sidebar-rail-btn.active {
  background: var(--sidebar-active);
  color: var(--primary);
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--primary) 35%, transparent);
}

.sidebar.two-col .nav-link-btn {
  width: calc(100% - 16px);
}

.sidebar.two-col .nav-ico--sm {
  width: 16px;
  height: 16px;
}

.sidebar.two-col .nav-ico-svg {
  width: 16px;
  height: 16px;
  stroke-width: 2;
}

.sidebar.two-col .nav-children .nav-link.nav-child {
  padding-left: 36px;
  font-size: 12px;
  font-weight: 500;
}

.sidebar.two-col .nav-parent-row {
  padding-right: 6px;
}

.topbar.topbar--slim {
  height: 36px;
  min-height: 36px;
  padding: 0 14px;
}

.topbar.topbar--slim .topbar-left {
  flex: 1;
  gap: 10px;
}

.topbar.topbar--slim .title {
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  line-height: 1.2;
}

.topbar.topbar--slim .back-btn {
  min-height: 26px;
  height: 26px;
  padding: 0 8px;
  font-size: 12px;
}

.theme-picker.is-compact,
.notif-bell.is-compact {
  position: relative;
  display: flex;
  justify-content: center;
  width: 100%;
  flex-shrink: 0;
}

.theme-picker.is-compact .theme-picker-panel {
  left: calc(100% + 8px);
  right: auto;
  top: auto;
  bottom: 0;
  min-width: 260px;
}


.sidebar-nav {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 10px 0 20px;
  /* Distinct ultra-thin scrollbar — only visible when menus overflow */
  scrollbar-width: thin;
  scrollbar-color: #a19f9d transparent;
}

.sidebar-nav::-webkit-scrollbar {
  width: 3px;
}

.sidebar-nav::-webkit-scrollbar-track {
  background: transparent;
}

.sidebar-nav::-webkit-scrollbar-thumb {
  background: #a19f9d;
  border-radius: 999px;
}

.sidebar-nav::-webkit-scrollbar-thumb:hover {
  background: #605e5c;
}

.sidebar-nav::-webkit-scrollbar-corner {
  background: transparent;
}

.sidebar .brand {
  padding: 18px 20px;
  min-height: 64px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: flex-start;
  flex-shrink: 0;
}

.sidebar .brand-logo {
  display: block;
  height: 40px;
  width: auto;
  max-width: 180px;
  object-fit: contain;
}

.company-logo-thumb {
  height: 28px;
  width: auto;
  max-width: 72px;
  object-fit: contain;
  display: block;
}

.company-logo-preview {
  display: block;
  margin-top: 10px;
  height: 48px;
  width: auto;
  max-width: 200px;
  object-fit: contain;
}

.nav-section {
  padding: 18px 20px 8px;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
  font-weight: 700;
  line-height: 1.2;
}

.nav-group + .nav-group {
  border-top: 1px solid #ededed;
  margin-top: 8px;
  padding-top: 4px;
}

.nav-parent-row {
  display: flex;
  align-items: center;
  gap: 2px;
  padding-right: 10px;
}

.nav-parent-link {
  flex: 1;
  min-width: 0;
  font-weight: 500;
  color: inherit;
  background: none;
  border: none;
  border-left: 3px solid transparent;
  text-align: left;
  cursor: pointer;
}

.nav-caret-btn {
  flex-shrink: 0;
  width: 28px;
  height: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: none;
  background: none;
  color: var(--muted);
  cursor: pointer;
  border-radius: 4px;
  transition: transform 0.2s ease, background 0.15s ease, color 0.15s ease;
}

.nav-caret-btn:hover {
  background: var(--sidebar-hover);
  color: var(--text);
}

.nav-caret-btn.open {
  transform: rotate(90deg);
}

.nav-ico {
  width: 22px;
  height: 22px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  color: var(--muted);
}

.nav-ico-svg {
  display: block;
  width: 20px;
  height: 20px;
  flex-shrink: 0;
}

.ui-line-ico {
  display: block;
  flex-shrink: 0;
}

.nav-label {
  flex: 1;
  min-width: 0;
  line-height: 1.35;
  letter-spacing: 0.01em;
}

.nav-bullet {
  width: 22px;
  height: 22px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.nav-bullet::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #a19f9d;
}

.nav-link.active .nav-ico {
  color: var(--primary);
}

.nav-link.active .nav-bullet::before {
  background: var(--primary);
}

.nav-children {
  padding-left: 0;
  border-left: none;
  margin-left: 0;
  overflow: hidden;
  animation: navSlideDown 0.2s ease;
}

.nav-children .nav-link.nav-child {
  padding-left: 50px;
  font-weight: 500;
  font-size: 13.5px;
  color: var(--muted);
}

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

.nav-children .nav-link {
  padding-top: 8px;
  padding-bottom: 8px;
  font-size: 13.5px;
  font-weight: 400;
  color: var(--muted);
}

.title-project {
  color: var(--primary, #6366f1);
  font-weight: 600;
}

.scope-tag {
  margin-left: 10px;
  padding: 2px 10px;
  font-size: 12px;
  font-weight: 500;
  border-radius: 2px;
  background: var(--primary-soft);
  color: var(--primary-darker, #005a9e);
  vertical-align: middle;
}

.link-title {
  background: none;
  border: none;
  padding: 0;
  font: inherit;
  color: var(--primary, #6366f1);
  cursor: pointer;
  text-align: left;
}

.link-title:hover {
  text-decoration: underline;
}

/* Sidebar items rendered as buttons (module launchers / Home) */
.nav-link-btn {
  width: calc(100% - 16px);
  box-sizing: border-box;
  font: inherit;
  color: inherit;
  text-align: left;
  background: none;
  border: none;
  border-left: 3px solid transparent;
  appearance: none;
  cursor: pointer;
}

/* ---------------------- Work Items (Azure-like) ------------------------- */
.wi-panel {
  padding: 0;
  overflow: visible;
}

.wi-new {
  position: relative;
}

.wi-caret {
  font-size: 10px;
  opacity: 0.85;
}

.wi-new-menu {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  z-index: 30;
  min-width: 200px;
  background: var(--surface);
  border: 1px solid var(--border, #e5e7eb);
  border-radius: 4px;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.14);
  padding: 6px;
}

.wi-new-item {
  display: flex;
  align-items: center;
  gap: 9px;
  width: 100%;
  background: none;
  border: none;
  padding: 8px 10px;
  border-radius: 6px;
  font-size: 13.5px;
  cursor: pointer;
  color: var(--text);
}

.wi-new-item:hover {
  background: var(--surface-hover);
}

/* Work Item full-page form — Azure DevOps–style add/edit */
.panel.wif {
  padding: 0;
  background: var(--surface);
  border: none;
  border-radius: 0;
  box-shadow: none;
}

.wif {
  padding: 0;
}

.wif-ado {
  border: none;
  border-radius: 0;
  overflow: visible;
  display: flex;
  flex-direction: column;
  background: var(--surface);
  box-shadow: none;
}

.wif-fixed {
  flex-shrink: 0;
  background: var(--surface);
  z-index: 5;
  border-bottom: 1px solid var(--border);
}

.wif-scroll {
  flex: 1;
  min-height: 0;
  overflow: visible;
  background: var(--surface);
}

.wif-pagebar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  border-bottom: 1px solid var(--border);
  background: var(--surface);
}

.wif-pagebar-left {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.wif-page-title {
  margin: 0;
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
  letter-spacing: -0.01em;
  line-height: 1.2;
}

.wif-back-link {
  border: none;
  background: none;
  padding: 0;
  margin: 0;
  font-size: 12px;
  color: var(--primary);
  cursor: pointer;
  text-align: left;
  width: fit-content;
}

.wif-back-link:hover {
  text-decoration: underline;
}

.wif-actions {
  display: flex;
  gap: 8px;
  flex-shrink: 0;
  align-items: center;
}

.wif-actions .wi-new-menu {
  left: auto;
  right: 0;
}

.wif-banner-error {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin: 0;
  padding: 6px 12px;
  background: #fde7e9;
  border-bottom: 1px solid #f1aeb5;
  color: #a4262c;
  font-size: 12px;
}

.wif-banner-success {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin: 0;
  padding: 6px 12px;
  background: #dff6dd;
  border-bottom: 1px solid #9fd89f;
  color: #0b6a0b;
  font-size: 12px;
}

.wif-banner-type {
  font-weight: 700;
  letter-spacing: 0.02em;
}

.wif-banner-msg {
  font-weight: 500;
}

.wif-readonly-note {
  margin: 0;
  padding: 4px 12px;
  font-size: 12px;
  color: var(--muted);
  border-bottom: 1px solid var(--border);
}

.wif-title-block {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px 4px;
  background: var(--surface);
}

.wif-type-icon {
  width: 22px;
  height: 22px;
  font-size: 10px;
  border-radius: 2px;
  flex-shrink: 0;
  margin-top: 0;
}

.wif-title-input {
  flex: 1;
  min-width: 0;
  height: 34px;
  border: 1px solid var(--border-strong);
  border-radius: 2px;
  box-shadow: none;
  font-size: 16px;
  font-weight: 400;
  line-height: 1.2;
  padding: 4px 10px;
  outline: none;
  background: var(--surface);
  color: var(--text);
}

.wif-title-input::placeholder {
  color: var(--muted);
  font-weight: 400;
}

.wif-title-input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 1px var(--primary);
}

.wif-identity {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px 16px;
  padding: 2px 12px 6px;
  border-bottom: 1px solid var(--border);
}

.wif-identity-assignee {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 200px;
  max-width: 320px;
}

.wif-identity-avatar {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #c8c6c4;
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  overflow: hidden;
}

.wif-identity-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.wif-identity-assignee-field {
  flex: 1;
  min-width: 0;
}

.wif-identity-assignee-field .ss-control {
  border: none;
  background: transparent;
  padding: 4px 0;
  min-height: 28px;
  box-shadow: none;
}

.wif-identity-assignee-field .ss-control:hover,
.wif-identity-assignee-field .ss.open .ss-control {
  background: var(--surface-hover);
  border-radius: 2px;
  padding-left: 6px;
  padding-right: 6px;
}

.wif-identity-meta {
  font-size: 13px;
}

.wif-area-path {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  max-width: min(320px, 42vw);
}

.wif-area-path-label {
  flex-shrink: 0;
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
}

.wif-area-path-value {
  display: inline-block;
  min-width: 0;
  max-width: 100%;
  padding: 2px 8px;
  border-radius: 2px;
  background: var(--surface-hover);
  color: var(--text);
  font-size: 12px;
  font-weight: 500;
  line-height: 1.4;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.wif-tag-link {
  border: none;
  background: none;
  color: var(--primary);
  font-size: 13px;
  cursor: pointer;
  padding: 0;
}

.wif-tag-link:disabled {
  opacity: 0.55;
  cursor: default;
}

/* Azure gray state / classification bar */
.wif-statebar {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px 12px;
  padding: 6px 12px;
  background: var(--surface-hover);
  border-bottom: none;
}

.wif-compact-field {
  margin: 0;
  min-width: 0;
}

.wif-compact-field > label {
  display: block;
  font-size: 11px;
  font-weight: 600;
  color: var(--muted);
  margin-bottom: 2px;
}

.wif-compact-field .ss-control,
.wif-compact-field select,
.wif-readonly-chip {
  width: 100%;
  min-height: 30px;
  height: 30px;
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: 2px;
  font-size: 12px;
  padding-top: 2px;
  padding-bottom: 2px;
}

.wif-readonly-chip {
  display: flex;
  align-items: center;
  padding: 2px 8px;
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.wif-cols {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(240px, 300px) minmax(240px, 300px);
  gap: 0;
  align-items: stretch;
  background: var(--surface);
  border-top: 1px solid var(--border);
}

.wif-cols.wif-cols-task-compact {
  grid-template-columns: minmax(240px, 360px);
  justify-content: start;
}

.wif-cols.wif-cols-task-compact .wif-col-details {
  border-right: none;
}

.wif-col {
  min-width: 0;
  min-height: 100%;
  display: flex;
  flex-direction: column;
  background: var(--surface);
}

.wif-col-main {
  padding: 0 0 16px;
  border-right: 1px solid var(--border);
  overflow: visible;
}

.wif-proofs {
  margin-top: 0;
  padding: 10px 12px 8px;
  border-top: none;
  overflow: visible;
  max-width: 100%;
  box-sizing: border-box;
}

.wif-col-details,
.wif-col-related {
  padding: 0 0 16px;
  border-right: 1px solid var(--border);
}

.wif-col-related {
  border-right: none;
}

.wif-pane-head {
  display: flex;
  align-items: center;
  min-height: 34px;
  margin: 0;
  padding: 8px 12px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text);
  background: var(--surface);
  border-bottom: 2px solid var(--primary);
  box-sizing: border-box;
}

.wif-pane-head-sub {
  margin-top: 4px;
  border-bottom-color: var(--border-strong);
  border-bottom-width: 1px;
  min-height: 30px;
  padding-top: 10px;
}

.wif-pane-empty {
  margin: 0;
  padding: 8px 12px;
  font-size: 12px;
}

.wif-related-hint {
  margin: 4px 0 0;
  font-size: 11px;
  padding: 0;
}

.wif-section {
  margin-bottom: 0;
}

.wif-section-main {
  padding: 10px 12px 8px;
  margin-bottom: 0;
}

.wif-section-side {
  padding: 10px 12px 8px;
  margin-bottom: 0;
  border-bottom: 1px solid var(--border);
  background: var(--surface);
}

.wif-section-side:last-child {
  border-bottom: none;
}

.wif-section h4 {
  margin: 0 0 8px;
  font-size: 12px;
  font-weight: 600;
  text-transform: none;
  letter-spacing: 0;
  color: var(--muted);
  border-bottom: none;
  padding-bottom: 0;
  display: flex;
  align-items: center;
  gap: 6px;
}

.wif-section-side h4 {
  font-size: 12px;
  color: var(--muted);
}

.wif-stack-padded {
  padding: 8px 12px 0;
}

.wif-hide-label > label {
  display: none;
}

.wif-proofs {
  margin-top: 0;
  padding: 10px 12px 8px;
  border-top: none;
}

.wif-proofs-hint {
  margin: 0 0 10px;
  font-size: 11px;
}

.wif-discussion {
  margin: 0;
}

.wif-discussion .wif-ado-textarea {
  min-height: 72px;
}

.wif-discussion-note {
  margin: 6px 0 0;
  font-size: 11px;
}

.wif-discussion-actions {
  display: flex;
  justify-content: flex-end;
  margin-top: 8px;
}

.wif-comment-list {
  list-style: none;
  margin: 0 0 12px;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-height: 280px;
  overflow-y: auto;
}

.wif-comment {
  padding: 8px 10px;
  border: 1px solid var(--border);
  background: var(--surface-hover);
}

.wif-comment-head {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 4px;
  font-size: 12px;
}

.wif-comment-body {
  font-size: 13px;
  white-space: pre-wrap;
  word-break: break-word;
  color: var(--text);
}

.wif-mention-wrap {
  position: relative;
}

.wif-mention-menu {
  position: absolute;
  z-index: 40;
  left: 0;
  right: 0;
  top: calc(100% + 2px);
  margin: 0;
  padding: 4px 0;
  list-style: none;
  background: var(--surface);
  border: 1px solid var(--border-strong);
  box-shadow: 0 8px 24px rgba(16, 24, 40, 0.12);
  max-height: 220px;
  overflow-y: auto;
}

.wif-mention-item {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  width: 100%;
  border: none;
  background: transparent;
  padding: 8px 12px;
  text-align: left;
  cursor: pointer;
  font-size: 13px;
  color: var(--text);
}

.wif-mention-item:hover,
.wif-mention-item.active {
  background: var(--surface-hover);
}

.wif-mention-name {
  font-weight: 600;
}

.wif-tinymce {
  width: 100%;
}

.wif-tinymce .tox-tinymce {
  border-radius: 2px !important;
  border-color: var(--border-strong) !important;
  width: 100% !important;
}

.wif-ado-field {
  margin: 0;
  gap: 4px;
}

.wif-ado-field + .wif-ado-field {
  margin-top: 10px;
}

.wif-req-dot {
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #a4262c;
  flex-shrink: 0;
}

.wif-stack {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.wif-stack .field {
  margin: 0;
}

.wif-stack .field > label,
.wif-ado-field > label {
  font-size: 11px;
  font-weight: 600;
  color: var(--muted);
  margin-bottom: 2px;
}

.wif-stack .field input,
.wif-stack .field .ss-control {
  min-height: 30px;
  height: 30px;
  font-size: 12px;
  padding-top: 2px;
  padding-bottom: 2px;
  border-color: var(--border-strong);
}

.wif-stack .field input:hover,
.wif-stack .field .ss-control:hover {
  border-color: var(--border-strong);
}

.wif-stack .field input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 1px var(--primary);
}

.wif-ado-textarea {
  width: 100%;
  min-height: 72px;
  border: 1px solid var(--border-strong);
  border-radius: 2px;
  background: var(--surface);
  padding: 8px 10px;
  font-size: 12px;
  line-height: 1.4;
  resize: vertical;
  color: var(--text);
}

.wif-ado-textarea:hover {
  border-color: var(--border-strong);
  background: var(--surface);
}

.wif-ado-textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 1px var(--primary);
  background: var(--surface);
}

.wif-ado-textarea::placeholder {
  color: var(--muted);
}

.wif-ado-textarea:disabled {
  opacity: 0.75;
  cursor: not-allowed;
}

.wif-desc-rich {
  min-height: 120px;
  max-height: 420px;
  overflow-y: auto;
  white-space: pre-wrap;
  word-break: break-word;
  resize: vertical;
}

.wif-desc-rich:empty::before,
.wif-desc-rich[data-empty="1"]::before {
  content: attr(data-placeholder);
  color: var(--muted);
  pointer-events: none;
}

.wif-desc-rich:focus {
  outline: none;
}

.wif-desc-rich-readonly {
  cursor: default;
  resize: none;
}

.wif-desc-inline-img {
  display: block;
  max-width: 100%;
  height: auto;
  margin: 8px 0;
  border: 1px solid var(--border);
  border-radius: 2px;
  background: var(--surface-hover);
}

.wif-discussion-note {
  margin: 4px 0 0;
  font-size: 11px;
}

.wif-proofs {
  margin-top: 4px;
  padding-top: 0;
  border-top: none;
}

.wif-proofs-hint {
  margin: 0 0 8px;
  font-size: 11px;
}

.wif-paste-hint {
  margin: 6px 0 0;
  font-size: 11px;
}

.wif-paste-hint kbd {
  display: inline-block;
  padding: 0 4px;
  border: 1px solid var(--border-strong);
  border-radius: 2px;
  background: var(--surface-hover);
  font-size: 10px;
  font-family: Consolas, "Courier New", monospace;
}

.wif-paste-zone {
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin: 0 0 12px;
  padding: 12px 14px;
  border: 1px dashed var(--border-strong);
  border-radius: 2px;
  background: var(--surface);
  color: var(--muted);
  font-size: 12px;
  cursor: text;
  outline: none;
}

.wif-paste-zone strong {
  color: var(--text);
  font-size: 12px;
}

.wif-paste-zone:focus,
.wif-paste-zone.wif-paste-active,
.wif-ado-textarea.wif-paste-active {
  border-color: var(--primary);
  box-shadow: 0 0 0 1px var(--primary);
  background: color-mix(in srgb, var(--primary) 6%, var(--surface));
}

.wif-paste-previews {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 8px;
}

.wif-paste-preview {
  margin: 0;
  width: 120px;
}

.wif-paste-preview img,
.wif-proof-thumb {
  display: block;
  width: 100%;
  max-width: 160px;
  max-height: 100px;
  object-fit: cover;
  border: 1px solid var(--border);
  border-radius: 2px;
  background: var(--surface-hover);
}

.wif-paste-preview figcaption {
  margin-top: 4px;
  font-size: 11px;
  color: var(--muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.wif-proof-thumb-link {
  display: inline-block;
  margin-top: 8px;
}

.wif-proof-row {
  display: flex;
  flex-wrap: wrap;
  align-items: end;
  gap: 8px 10px;
  margin-bottom: 12px;
  padding: 0;
  background: transparent;
  border: none;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
}

.wif-proof-row .field {
  margin: 0;
  min-width: 0;
  gap: 4px;
}

.wif-proof-name {
  flex: 1 1 140px;
  min-width: 0;
}

.wif-proof-file {
  flex: 1 1 160px;
  min-width: 0;
}

.wif-proof-row .field > label {
  font-size: 11px;
  font-weight: 600;
  color: var(--muted);
  margin: 0;
}

.wif-proof-name input {
  width: 100%;
  height: 30px;
  min-height: 30px;
  padding: 4px 8px;
  border: 1px solid var(--border-strong);
  border-radius: 2px;
  background: var(--surface);
  font-size: 12px;
  color: var(--text);
  box-shadow: none;
  box-sizing: border-box;
}

.wif-proof-name input:hover {
  border-color: var(--border-strong);
}

.wif-proof-name input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 1px var(--primary);
}

.wif-proof-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  min-height: 30px;
  min-width: 0;
}

.wif-file-pick {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 30px;
  padding: 0 12px;
  border: 1px solid var(--border-strong);
  border-radius: 2px;
  background: var(--surface);
  color: var(--text);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  flex-shrink: 0;
  margin: 0;
}

.wif-file-pick:hover {
  background: var(--surface-hover);
  border-color: var(--border-strong);
}

.wif-file-name {
  flex: 1 1 80px;
  min-width: 0;
  font-size: 12px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.wif-proof-remove {
  flex: 0 0 auto;
  height: 30px;
  white-space: nowrap;
  align-self: end;
  margin: 0;
}

.wif-add-proof {
  height: 30px;
  margin-top: 2px;
}

.wif-stack .field input:disabled,
.wif-stack .field textarea:disabled {
  background: var(--surface-hover);
  color: var(--muted);
  cursor: not-allowed;
  opacity: 1;
}

.wif-approval-note {
  margin: 4px 0 0;
  padding: 0;
  font-size: 11px;
}

.wif-error {
  margin: 8px 16px 0;
}

/* Sprint form — 2-column ADO layout */
.sprint-cols {
  grid-template-columns: minmax(0, 1.35fr) minmax(280px, 1fr);
}

.sprint-col-main {
  min-width: 0;
  padding: 12px 16px 16px;
}

.sprint-col-side {
  min-width: 0;
  padding: 0 0 16px;
  background: var(--surface);
}

.sprint-dates {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px 12px;
}

.sprint-form .wif-title-input {
  border-color: var(--border-strong);
}

.sprint-form .wif-stack .field > label {
  font-size: 11px;
  font-weight: 600;
  color: var(--muted);
}

.sprint-form .sms {
  border-color: var(--border-strong);
  border-radius: 2px;
}

.sprint-form .sms:focus-within {
  border-color: var(--primary);
  box-shadow: 0 0 0 1px var(--primary);
}

.sprint-form .sms-search {
  font-size: 12px;
  min-height: 30px;
  padding: 4px 8px;
}

.sprint-form .sms-chip {
  font-size: 11px;
  padding: 2px 6px;
  border-radius: 2px;
  background: var(--surface-hover);
  border: none;
}

.sprint-form .wif-section-side {
  border-bottom: none;
}

.sprint-field-hint {
  margin: 4px 0 0;
  font-size: 11px;
}

/* Resource Allocation form */
.alloc-cols {
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
}

.alloc-col {
  min-width: 0;
  padding: 0 0 16px;
}

.alloc-form .wif-section-side {
  border-bottom: none;
}

.alloc-form .wif-stack .field > label {
  font-size: 11px;
  font-weight: 600;
  color: var(--muted);
}

.alloc-pair {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px 12px;
}

.alloc-check {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 2px 0 4px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text);
  cursor: pointer;
  user-select: none;
}

.alloc-check input[type="checkbox"] {
  width: 16px;
  height: 16px;
  min-height: 0;
  margin: 0;
  accent-color: #0078d4;
  cursor: pointer;
}

.alloc-form .wif-title-input {
  border-color: var(--border-strong);
  cursor: default;
  background: var(--surface-raised);
}

.alloc-form .wif-title-input:focus {
  border-color: var(--border-strong);
  box-shadow: none;
}

@media (max-width: 960px) {
  .alloc-cols,
  .alloc-pair {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 1100px) {
  .wif-cols {
    grid-template-columns: minmax(0, 1fr) minmax(220px, 1fr);
  }

  .wif-col-related {
    grid-column: 1 / -1;
  }

  .sprint-cols {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 960px) {
  .wif-statebar {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .wif-cols {
    grid-template-columns: 1fr;
  }

  .wif-col-related {
    grid-column: auto;
  }

  .wif-proof-row {
    flex-direction: column;
    align-items: stretch;
  }

  .wif-proof-name,
  .wif-proof-file {
    flex: 1 1 auto;
    width: 100%;
  }

  .wif-proof-remove {
    width: fit-content;
    align-self: flex-start;
  }

  .sprint-cols {
    grid-template-columns: 1fr;
  }

  .sprint-dates {
    grid-template-columns: 1fr;
  }
}

.table-wrap {
  width: 100%;
  overflow-x: auto;
}

.wi-toolbar {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border, #e5e7eb);
  background: var(--surface-raised);
}

.wi-filters {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-left: auto;
}

.wi-filters select,
.wi-search {
  height: 36px;
  min-height: 36px;
  border: 1px solid #d1d5db;
  border-radius: 4px;
  padding: 6px 12px;
  font-size: 0.875rem;
  background-color: #f3f4f6;
  box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
}

.wi-filters .ss {
  min-width: 160px;
  max-width: 220px;
}

.wi-filters .ss-control {
  height: auto;
  min-height: 36px;
  padding: 6px 12px;
  font-size: 0.875rem;
  box-sizing: border-box;
}

.wi-date-field {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.wi-date-field span {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
  line-height: 1;
}

.wi-date-field input[type="date"] {
  height: 36px;
  min-height: 36px;
  border: 1px solid #d1d5db;
  border-radius: 4px;
  padding: 6px 12px;
  font-size: 0.875rem;
  background-color: #f3f4f6;
  color: inherit;
  box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
}

.wi-cell-long {
  max-width: 220px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.col-picker {
  position: relative;
}

.col-picker-panel {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  z-index: 40;
  width: 260px;
  max-height: 360px;
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 4px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.14);
}

.col-picker-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 8px 10px 4px;
}

.col-picker-hint {
  margin: 0 10px 6px;
  font-size: 11px;
}

.col-picker-list {
  list-style: none;
  margin: 0;
  padding: 0 0 8px;
  overflow: auto;
  max-height: 280px;
}

.col-picker-item {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  cursor: grab;
}

.col-picker-item:hover {
  background: var(--surface-hover);
}

.col-picker-item.is-on label {
  font-weight: 600;
}

.col-picker-grip {
  color: var(--muted);
  font-size: 12px;
  letter-spacing: -2px;
  user-select: none;
  width: 14px;
}

.col-picker-item label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  cursor: pointer;
  min-width: 0;
}

.sortable-th.is-draggable {
  cursor: grab;
}

.wi-search {
  min-width: 200px;
}

.wi-table {
  width: 100%;
  border-collapse: collapse;
}

.wi-table th {
  text-align: left;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  color: var(--muted);
  padding: 6px 10px;
  border-bottom: 1px solid var(--border, #e5e7eb);
  background: var(--surface-raised);
  white-space: nowrap;
  line-height: 1.2;
}

.wi-table td {
  padding: 4px 10px;
  border-bottom: 1px solid #f0f0f3;
  font-size: 12.5px;
  vertical-align: middle;
  line-height: 1.25;
  white-space: nowrap;
}

.wi-table td.wi-title {
  white-space: nowrap;
  max-width: 280px;
  overflow: hidden;
  text-overflow: ellipsis;
}

.wi-table tr:hover td {
  background: var(--surface-hover);
}

.wi-table td:last-child {
  white-space: nowrap;
}

.wi-table td:last-child .btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  vertical-align: middle;
  min-height: 32px;
  height: 32px;
  padding: 0 12px;
  font-size: 13px;
  line-height: 1;
  margin: 0 2px 0 0;
}

.wi-type {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 12px;
  white-space: nowrap;
}

.wi-type-box {
  width: 16px;
  height: 16px;
  border-radius: 3px;
  color: #fff;
  font-size: 9px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.wi-title {
  color: var(--text);
  font-weight: 500;
  cursor: pointer;
}

.wi-title:hover {
  color: var(--primary, #6366f1);
  text-decoration: underline;
}

.wi-state {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  white-space: nowrap;
  font-size: 12px;
}

.wi-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  display: inline-block;
  flex-shrink: 0;
}

/* ---------------------- Project Summary (Azure-like) -------------------- */
.proj-summary {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

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

.ps-title {
  display: flex;
  align-items: center;
  gap: 14px;
}

.ps-title h1 {
  margin: 0;
  font-size: 24px;
}

.ps-logo {
  width: 48px;
  height: 48px;
  border-radius: 10px;
  background: linear-gradient(135deg, #6366f1, #8b5cf6);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 18px;
}

.ps-head-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.ps-grid {
  display: grid;
  grid-template-columns: 2fr 1.2fr;
  gap: 18px;
}

.ps-members {
  grid-column: 1 / -1;
}

.ps-about h3,
.ps-stats h3,
.ps-members h3 {
  margin-top: 0;
}

.ps-meta {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 14px;
  margin-top: 16px;
}

.ps-meta-label {
  display: block;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--muted);
}

.ps-meta-value {
  display: block;
  font-weight: 600;
  margin-top: 2px;
}

.ps-stat-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.ps-stat {
  background: rgba(99, 102, 241, 0.06);
  border-radius: 10px;
  padding: 14px;
  text-align: center;
}

.ps-stat-link {
  border: 1px solid transparent;
  cursor: pointer;
  font: inherit;
  color: inherit;
  width: 100%;
  transition: background 0.15s ease, border-color 0.15s ease, transform 0.12s ease;
}

.ps-stat-link:hover {
  background: rgba(0, 120, 212, 0.1);
  border-color: rgba(0, 120, 212, 0.25);
  transform: translateY(-1px);
}

.ps-type-link {
  border: none;
  cursor: pointer;
  font: inherit;
}

.ps-type-link:hover {
  text-decoration: underline;
}

.ps-stat-num {
  font-size: 26px;
  font-weight: 700;
  color: var(--primary, #6366f1);
}

.ps-stat-label {
  font-size: 12px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.ps-bytype {
  margin-top: 14px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.ps-avatars {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 13px;
  font-weight: 600;
}

@media (max-width: 880px) {
  .ps-grid {
    grid-template-columns: 1fr;
  }
}

.nav-link {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 18px;
  margin: 1px 8px;
  font-size: 14px;
  font-weight: 500;
  color: var(--text);
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
  border-left: 3px solid transparent;
  border-radius: 6px;
}

.nav-link:hover {
  background: var(--surface-hover);
  color: var(--text);
}

.nav-link.active {
  background: var(--primary-soft);
  color: var(--primary-darker);
  border-left-color: var(--primary);
  font-weight: 600;
}

.nav-link.sub {
  padding-left: 42px;
  font-size: 13.5px;
  color: var(--muted);
}

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

.topbar {
  height: 64px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  position: sticky;
  top: 0;
  z-index: 5;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
}

.topbar-left {
  display: flex;
  align-items: center;
  gap: 14px;
}

.back-btn {
  box-sizing: border-box;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  min-height: 32px;
  height: 32px;
  background: none;
  border: 1px solid var(--border-strong);
  color: var(--text);
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  line-height: 1;
  padding: 0 12px;
  cursor: pointer;
  border-radius: 0;
  transition: background 0.15s ease, color 0.15s ease;
  vertical-align: middle;
  white-space: nowrap;
}

.back-btn:hover {
  background: var(--sidebar-hover);
  color: var(--primary-darker);
  border-color: var(--primary);
}

.back-arrow {
  font-size: 15px;
  line-height: 1;
}

.topbar .title {
  font-size: 16px;
  font-weight: 600;
  color: var(--text);
  letter-spacing: 0.01em;
}

.topbar .user {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 14px;
}

.badge {
  background: var(--primary-soft);
  color: var(--primary-darker);
  padding: 3px 10px;
  border-radius: 2px;
  font-size: 12px;
  font-weight: 600;
}

/* ---- User menu dropdown ---- */
.user-menu-wrap { position: relative; }
.user-menu-toggle {
  display: flex; align-items: center; gap: 8px;
  background: none; border: 1px solid var(--border); border-radius: 6px;
  padding: 4px 10px; cursor: pointer; color: inherit; font-size: 14px;
}
.user-menu-toggle:hover { background: var(--surface-hover); }
.user-avatar {
  width: 28px; height: 28px; border-radius: 50%;
  background: var(--primary); color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 13px;
  overflow: hidden; flex-shrink: 0;
}
.user-avatar-img {
  width: 100%; height: 100%; object-fit: cover; display: block;
}
.user-name { max-width: 120px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.user-caret { transition: transform .2s; }
.user-caret.open { transform: rotate(180deg); }
.user-dropdown {
  position: absolute; right: 0; top: calc(100% + 6px);
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 8px; box-shadow: 0 8px 24px rgba(0,0,0,.12);
  min-width: 180px; z-index: 500; padding: 4px 0;
}
.user-dropdown-item {
  display: flex; align-items: center; gap: 8px; width: 100%;
  padding: 9px 14px; border: none; background: none;
  font-size: 13px; cursor: pointer; color: var(--text);
}
.user-dropdown-item:hover { background: var(--surface-hover); }
.user-dropdown-item.logout { color: var(--danger, #d32f2f); }

/* ---- My Profile ---- */
.profile-page {
  max-width: 880px;
  margin: 0 auto;
  padding: 4px 4px 48px;
}
.profile-head { margin-bottom: 14px; }
.profile-head h1 {
  margin: 0 0 4px;
  font-size: 1.35rem;
  font-weight: 700;
  letter-spacing: -0.01em;
}
.profile-layout {
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.profile-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 0;
  padding: 18px 20px 20px;
}
.profile-section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border);
}
.profile-section-head h3 {
  margin: 0;
  font-size: 0.92rem;
  font-weight: 700;
}
.profile-lock,
.profile-edit-badge {
  font-size: 11px;
  font-weight: 650;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  padding: 3px 8px;
  border: 1px solid var(--border);
  color: var(--muted, #666);
  background: var(--surface-hover, #f5f5f5);
}
.profile-edit-badge {
  color: var(--primary);
  border-color: color-mix(in srgb, var(--primary) 35%, var(--border));
  background: color-mix(in srgb, var(--primary) 8%, transparent);
}
.profile-hero {
  display: flex;
  align-items: center;
  gap: 20px;
}
.profile-photo-btn {
  position: relative;
  width: 96px;
  height: 96px;
  border-radius: 50%;
  border: 2px solid var(--border);
  padding: 0;
  overflow: hidden;
  background: var(--surface-hover);
  cursor: pointer;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}
.profile-photo-btn:hover .profile-photo-hint { opacity: 1; }
.profile-photo-hint {
  position: absolute;
  inset: auto 0 0;
  padding: 4px 0;
  background: rgba(0, 0, 0, 0.55);
  color: #fff;
  font-size: 11px;
  font-weight: 600;
  opacity: 0;
  transition: opacity 0.15s ease;
}
.profile-photo-img { width: 100%; height: 100%; object-fit: cover; }
.profile-photo-fallback {
  font-size: 2.1rem;
  font-weight: 700;
  color: var(--primary);
}
.profile-hero-meta { min-width: 0; flex: 1; }
.profile-hero-meta h2 {
  margin: 0 0 4px;
  font-size: 1.25rem;
  font-weight: 700;
}
.profile-hero-sub {
  margin: 0 0 10px;
  color: var(--muted, #666);
  font-size: 13px;
}
.profile-hero-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 12px;
}
.profile-photo-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}
.profile-meta-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px 18px;
  margin: 0;
}
.profile-meta-grid > div {
  padding: 10px 12px;
  background: var(--surface-hover, #f7f7f7);
  border: 1px solid var(--border);
}
.profile-meta-grid dt {
  margin: 0 0 4px;
  font-size: 11px;
  font-weight: 650;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--muted, #666);
}
.profile-meta-grid dd {
  margin: 0;
  font-size: 14px;
  font-weight: 600;
  word-break: break-word;
}
.profile-save-bar {
  display: flex;
  justify-content: flex-end;
  padding: 4px 0 2px;
}
.profile-actions { margin-top: 14px; display: flex; gap: 10px; }
.profile-docs .profile-doc-upload { margin-bottom: 8px; }
.profile-pending-files {
  list-style: none;
  margin: 10px 0 0;
  padding: 8px 10px;
  border: 1px dashed var(--border);
  display: flex;
  flex-wrap: wrap;
  gap: 6px 12px;
  font-size: 12px;
}
.profile-pending-files li::before {
  content: "• ";
  color: var(--primary);
}
.profile-doc-list {
  list-style: none;
  margin: 16px 0 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
  border-top: 1px solid var(--border);
  padding-top: 14px;
}
.profile-doc-empty { padding: 4px 0; }
.profile-doc-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  background: var(--surface);
}
.profile-note { margin-top: 8px; }
.profile-page .form-grid label.span-2,
.profile-page .profile-actions.span-2 { grid-column: 1 / -1; }
.profile-page .form-grid label {
  display: flex;
  flex-direction: column;
  gap: 5px;
  font-size: 12px;
  font-weight: 600;
  color: var(--muted, #555);
}
.profile-page .form-grid input,
.profile-page .form-grid select,
.profile-page .form-grid textarea {
  font-weight: 500;
  color: var(--text);
}
.profile-page .alert {
  padding: 10px 12px;
  margin-bottom: 12px;
  font-size: 14px;
  border: 1px solid var(--border);
}
.profile-page .alert.error {
  background: color-mix(in srgb, var(--danger, #d32f2f) 10%, transparent);
  color: var(--danger, #d32f2f);
  border-color: color-mix(in srgb, var(--danger, #d32f2f) 35%, var(--border));
}
.profile-page .alert.success {
  background: color-mix(in srgb, #2e7d32 10%, transparent);
  color: #2e7d32;
  border-color: color-mix(in srgb, #2e7d32 35%, var(--border));
}
.profile-page .muted.small { font-size: 12px; margin: 0; }
@media (max-width: 640px) {
  .profile-hero { flex-direction: column; align-items: flex-start; }
  .profile-meta-grid { grid-template-columns: 1fr; }
}

/* ---- Change password modal ---- */
.cpw-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,.45);
  display: flex; align-items: center; justify-content: center; z-index: 9000;
}
.cpw-modal {
  background: var(--surface); border-radius: 10px;
  box-shadow: 0 12px 40px rgba(0,0,0,.2);
  width: 400px; max-width: 94vw; padding: 24px;
}
.cpw-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 16px; }
.cpw-header h3 { margin: 0; font-size: 17px; }
.cpw-close {
  background: none; border: none; font-size: 22px; cursor: pointer;
  color: var(--text-secondary); line-height: 1;
}
.cpw-close:hover { color: var(--text); }
.cpw-actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 18px; }

.content {
  padding: 24px;
  flex: 1;
  background: var(--surface-hover);
}

.content.content--flush {
  padding-top: 16px;
}

/* Cards / stats */
.cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 18px 20px;
  transition: box-shadow 0.18s ease, transform 0.18s ease;
}

.card:hover {
  box-shadow: 0 10px 28px rgba(15, 23, 42, 0.1), 0 2px 8px rgba(15, 23, 42, 0.06);
}

.card-clickable {
  cursor: pointer;
  transition: box-shadow 0.18s ease, transform 0.18s ease;
}

.card-clickable:hover {
  box-shadow: 0 14px 32px rgba(15, 23, 42, 0.12), 0 4px 10px rgba(15, 23, 42, 0.06);
  transform: translateY(-2px);
}

.card-link {
  margin-top: 8px;
  font-size: 12px;
  font-weight: 600;
  color: var(--primary);
}

.ra-filters {
  padding: 12px 16px;
  margin-bottom: 16px;
}

.ra-filters-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 16px;
  align-items: flex-end;
}

.ra-filters-row .field {
  margin: 0;
  min-width: 160px;
}

.ra-filters-hint {
  margin: 8px 0 0;
  font-size: 12px;
}

.ra-avail-table {
  width: 100%;
  border-collapse: collapse;
}

.ra-avail-group {
  border-top: 1px solid var(--border);
}

.ra-avail-summary td {
  padding: 12px 10px;
  vertical-align: middle;
}

.ra-avail-toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: none;
  border: none;
  padding: 0;
  font: inherit;
  font-weight: 600;
  color: var(--primary);
  cursor: pointer;
}

.ra-avail-toggle:hover {
  text-decoration: underline;
}

.ra-avail-caret {
  color: var(--muted);
  font-size: 12px;
  width: 12px;
}

.ra-avail-detail-row > td {
  padding: 0 10px 12px 42px;
  background: var(--surface-raised);
}

.ra-avail-detail {
  width: 100%;
  max-width: 520px;
  border-collapse: collapse;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
}

.ra-avail-detail th,
.ra-avail-detail td {
  padding: 8px 12px;
  text-align: left;
  font-size: 13px;
}

.ra-avail-detail thead th {
  background: var(--surface-hover);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
}

.ra-avail-detail tbody tr + tr td {
  border-top: 1px solid #f1f2f6;
}

.ra-avail-leave td {
  background: #fdf2f2;
  color: #922b21;
}

.ra-avail-weekend td {
  background: var(--surface-raised);
  color: var(--muted);
}

.proj-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.proj-card-compact {
  padding: 10px 14px !important;
}

.proj-strip {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
  min-height: 36px;
}

.proj-strip-name {
  font-size: 15px;
  font-weight: 700;
  flex: 1 1 160px;
  text-align: left;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.proj-strip-meta {
  display: inline-flex;
  align-items: baseline;
  gap: 6px;
  white-space: nowrap;
}

.proj-strip-label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.3px;
  color: var(--muted);
  font-weight: 600;
}

.proj-strip-value {
  font-size: 13px;
  color: var(--text);
}

.proj-strip-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
}

/* Projects list — clean table layout */
.pm-projects-page {
  max-width: 1180px;
}

.pm-projects-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
}

.pm-projects-header h1 {
  margin: 0;
  font-size: 22px;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--text);
}

.pm-projects-sub {
  margin: 4px 0 0;
  font-size: 13px;
  color: var(--muted);
}

.pm-projects-header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.pm-projects-panel {
  padding: 0;
  overflow: hidden;
}

.pm-projects-toolbar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  background: var(--surface-raised);
}

.pm-projects-search {
  flex: 1;
  min-width: 0;
  height: 34px;
  padding: 0 12px;
  border: 1px solid var(--border);
  background: var(--surface);
  font-size: 13px;
  color: var(--text);
}

.pm-projects-search:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 1px var(--primary);
}

.pm-projects-status-filter {
  width: 200px;
  flex-shrink: 0;
}

.pm-projects-table-wrap {
  overflow-x: auto;
}

.pm-projects-table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
}

.pm-projects-table th,
.pm-projects-table td {
  padding: 12px 16px;
  text-align: left;
  vertical-align: middle;
  border-bottom: 1px solid var(--border);
  font-size: 13px;
}

.pm-projects-table th {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
  background: var(--surface);
  white-space: nowrap;
}

.pm-projects-table tbody tr:last-child td {
  border-bottom: none;
}

.pm-projects-table tbody tr:hover td {
  background: var(--surface-hover);
}

.pm-projects-table th:nth-child(1),
.pm-projects-table td:nth-child(1) {
  width: 22%;
}

.pm-projects-table th:nth-child(2),
.pm-projects-table td:nth-child(2),
.pm-projects-table th:nth-child(3),
.pm-projects-table td:nth-child(3),
.pm-projects-table th:nth-child(4),
.pm-projects-table td:nth-child(4) {
  width: 14%;
}

.pm-projects-table th:nth-child(5),
.pm-projects-table td:nth-child(5) {
  width: 10%;
}

.pm-projects-actions-col,
.pm-projects-table th:nth-child(6),
.pm-projects-table td:nth-child(6) {
  width: 16%;
  min-width: 148px;
  text-align: right;
}

.pm-projects-name {
  display: block;
  max-width: 100%;
  padding: 0;
  border: none;
  background: none;
  color: var(--primary);
  font-size: 14px;
  font-weight: 600;
  text-align: left;
  cursor: pointer;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  text-decoration: none;
}

.pm-projects-name:hover {
  color: var(--primary-darker);
  text-decoration: underline;
}

.pm-projects-code {
  margin-top: 2px;
  font-size: 12px;
  color: var(--muted);
  font-family: Consolas, "Courier New", monospace;
}

.pm-projects-actions {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
  flex-wrap: nowrap;
  white-space: nowrap;
}

.pm-projects-link {
  display: inline-block;
  padding: 4px 10px;
  border: none;
  background: none;
  color: var(--primary);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  border-radius: 0;
  text-decoration: underline;
  text-underline-offset: 2px;
  line-height: 1.3;
}

.pm-projects-link + .pm-projects-link {
  border-left: 1px solid var(--border);
}

.pm-projects-link:hover {
  color: var(--primary-darker);
  background: transparent;
}

.pm-projects-link-primary {
  color: var(--primary-dark);
  font-weight: 700;
}

/* Compact professional action buttons (not badges) */
.ui-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 30px;
  padding: 0 10px;
  border-radius: 6px;
  border: none;
  background: #f3f2f1;
  color: var(--text, #323130);
  font-size: 12px;
  font-weight: 600;
  line-height: 1.2;
  cursor: pointer;
  text-decoration: none;
  white-space: nowrap;
  box-shadow: none;
  transition: background 0.15s ease, box-shadow 0.15s ease, transform 0.12s ease;
}

.ui-btn svg {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
  stroke-width: 2;
}

.ui-btn:hover:not(:disabled) {
  background: var(--surface-hover, #f3f2f1);
  box-shadow: 0 6px 16px rgba(15, 23, 42, 0.08);
}

.ui-btn:active:not(:disabled) {
  transform: translateY(1px);
}

.ui-btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.ui-btn--sm {
  min-height: 28px;
  padding: 0 8px;
  font-size: 12px;
  border-radius: 6px;
}

.ui-btn--icon {
  width: 32px;
  min-width: 32px;
  height: 32px;
  min-height: 32px;
  padding: 0;
  background: transparent !important;
  border: none;
  box-shadow: none;
}

.ui-btn--icon:hover:not(:disabled) {
  background: color-mix(in srgb, currentColor 12%, transparent) !important;
  box-shadow: none;
}

html[data-theme="dark"] .ui-btn--icon {
  background: transparent !important;
}

html[data-theme="dark"] .ui-btn--icon:hover:not(:disabled) {
  background: color-mix(in srgb, currentColor 18%, transparent) !important;
}

.ui-hover-tip {
  position: fixed;
  transform: translate(-50%, -100%);
  padding: 6px 10px;
  border-radius: 6px;
  background: #201f1e;
  color: #fff;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.01em;
  line-height: 1.2;
  white-space: nowrap;
  pointer-events: none;
  z-index: 5000;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.22);
}

.ui-hover-tip::after {
  content: "";
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  border: 5px solid transparent;
  border-top-color: #201f1e;
}

.ui-btn--edit,
.ui-btn--primary-soft {
  background: #e8f1fb;
  color: #185abc;
}

.ui-btn--invite,
.ui-btn--purple {
  background: #f3eaf8;
  color: #5b2c6f;
}

.ui-btn--docs,
.ui-btn--amber {
  background: #fbf3e0;
  color: #8a5a00;
}

.ui-btn--open,
.ui-btn--green {
  background: #e7f4ea;
  color: #0b6a0b;
}

.ui-btn--danger,
.ui-btn--delete {
  background: #fde7e9;
  color: #a4262c;
}

.ui-btn--neutral {
  background: #f3f2f1;
  color: #3b3a39;
}

.ui-btn--solid {
  background: var(--primary, #0078d4);
  border: none;
  color: #fff;
}

.ui-btn--solid:hover:not(:disabled) {
  background: var(--primary-dark, #106ebe);
  box-shadow: 0 6px 16px rgba(0, 120, 212, 0.22);
}

.report-total-row td {
  font-weight: 700;
  background: #f8fafc;
  border-top: 2px solid var(--border, #e2e8f0);
  color: var(--text, #1f2937);
}

.report-total-label {
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-size: 11px;
  color: var(--muted, #64748b);
}

.ui-alert {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin: 0 0 14px;
  padding: 10px 14px;
  border-radius: 10px;
  border: 1px solid transparent;
  font-size: 13px;
  line-height: 1.4;
}

.ui-alert-success {
  background: #e8f5e9;
  border-color: #a5d6a7;
  color: #1b5e20;
}

.ui-alert-error {
  background: #fdecea;
  border-color: #f5c6cb;
  color: #b71c1c;
}

.ui-alert-info {
  background: #e3f2fd;
  border-color: #90caf9;
  color: #0d47a1;
}

.ui-alert-warn {
  background: #fff8e1;
  border-color: #ffe082;
  color: #f57f17;
}

.ui-alert-close {
  border: none;
  background: transparent;
  color: inherit;
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
  opacity: 0.7;
  padding: 0 2px;
}

.ui-alert-close:hover {
  opacity: 1;
}

.pm-projects-panel {
  border-radius: 12px;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.04);
}

.pm-projects-table tfoot td {
  padding: 12px 14px;
}

.pm-projects-empty {
  padding: 48px 24px;
  text-align: center;
}

.pm-projects-empty h3 {
  margin: 0 0 6px;
  font-size: 16px;
  font-weight: 600;
}

.pm-projects-empty p {
  margin: 0 0 16px;
}

.pm-projects-empty .btn {
  margin-top: 4px;
}

@media (max-width: 900px) {
  .pm-projects-header {
    flex-direction: column;
  }

  .pm-projects-table th:nth-child(2),
  .pm-projects-table td:nth-child(2),
  .pm-projects-table th:nth-child(3),
  .pm-projects-table td:nth-child(3),
  .pm-projects-table th:nth-child(4),
  .pm-projects-table td:nth-child(4) {
    display: none;
  }

  .pm-projects-table th:nth-child(1),
  .pm-projects-table td:nth-child(1) {
    width: 40%;
  }

  .pm-projects-actions-col,
  .pm-projects-table th:nth-child(6),
  .pm-projects-table td:nth-child(6) {
    width: 45%;
    min-width: 0;
  }
}

.proj-card-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 12px;
}

.proj-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 10px 18px;
  margin-bottom: 12px;
}

.proj-grid-inline {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 32px;
}

.proj-grid-inline .proj-detail {
  min-width: 0;
}

.members-more {
  border: none;
  cursor: pointer;
  font: inherit;
  font-weight: 600;
}

.proj-detail {
  display: flex;
  flex-direction: column;
}

.proj-detail-label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  color: var(--muted);
  font-weight: 600;
}

.proj-detail-value {
  font-size: 14px;
  margin-top: 2px;
}

.proj-people {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  border-top: 1px solid var(--border);
  padding-top: 12px;
}

.proj-documents {
  border-top: 1px solid var(--border);
  padding-top: 12px;
  margin-top: 12px;
}

.proj-doc-list {
  list-style: none;
  margin: 8px 0 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.proj-doc-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 12px;
  background: var(--surface-raised);
  border: 1px solid var(--border);
  border-radius: 4px;
}

.proj-doc-name {
  font-size: 14px;
  font-weight: 500;
  word-break: break-word;
}

.chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 6px;
}

.alloc-head,
.alloc-row {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr 0.7fr;
  gap: 8px;
  align-items: center;
}

.alloc-head {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  color: var(--muted);
  font-weight: 600;
  padding: 4px 0;
  border-bottom: 1px solid var(--border);
}

.alloc-row {
  padding: 6px 0;
}

.alloc-row input {
  padding: 6px 8px;
}

.alloc-emp {
  font-size: 13px;
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.card .label {
  color: var(--muted);
  font-size: 13px;
}

.card .value {
  font-size: 28px;
  font-weight: 700;
  margin-top: 6px;
}

.dash-report {
  display: flex;
  flex-direction: column;
  gap: 18px;
  max-height: 65vh;
  overflow-y: auto;
  padding-right: 4px;
}

.dash-report-mini {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 10px;
}

.dash-report-mini-item {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 10px 12px;
  background: var(--surface-raised);
  border: 1px solid var(--border);
  border-radius: 4px;
}

.dash-report-mini-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

.dash-report-mini-value {
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--text);
}

.dash-report-section h4 {
  margin: 0 0 8px;
  font-size: 14px;
  color: var(--text);
}

.dash-modules {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 4px 0 8px;
}

.dash-module-btn {
  display: inline-flex;
  align-items: center;
  padding: 8px 14px;
  border: 1px solid var(--border-strong);
  border-radius: 2px;
  background: var(--surface);
  color: var(--text);
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.12s ease, border-color 0.12s ease, color 0.12s ease;
}

.dash-module-btn:hover {
  background: var(--primary-soft);
  border-color: var(--primary);
  color: var(--primary);
}

.panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
}

.panel-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}

.panel-header h2 {
  margin: 0;
  font-size: 18px;
}

/* Table */
table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

th,
td {
  text-align: left;
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
}

th {
  color: var(--muted);
  font-weight: 600;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.4px;
}

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

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

/* Buttons — one shared height across the app */
.btn {
  box-sizing: border-box;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 32px;
  height: 32px;
  border: 1px solid var(--primary);
  border-radius: 0;
  padding: 0 14px;
  font-size: 13px;
  font-weight: 600;
  line-height: 1;
  cursor: pointer;
  background: var(--primary);
  color: #fff;
  transition: background 0.12s ease, border-color 0.12s ease;
  vertical-align: middle;
  white-space: nowrap;
}

.btn:hover {
  background: var(--primary-dark);
  border-color: var(--primary-dark);
}

.btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.btn.secondary {
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--border-strong);
}

.btn.secondary:hover {
  background: var(--surface-hover);
}

.btn.danger {
  background: var(--danger);
  border-color: var(--danger);
}

.btn.danger:hover {
  background: #a4262c;
  border-color: #a4262c;
}

/* Same height as .btn — only slightly tighter horizontal padding */
.btn.small {
  min-height: 32px;
  height: 32px;
  padding: 0 12px;
  font-size: 13px;
  line-height: 1;
}

/* Forms */
.form-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 14px;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

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

.field label {
  font-size: 13px;
  color: var(--muted);
  font-weight: 600;
}

input:not([type="checkbox"]):not([type="radio"]):not([type="file"]):not([type="range"]):not([type="button"]):not([type="submit"]):not([type="reset"]):not([type="hidden"]):not([type="image"]),
select,
textarea {
  height: auto;
  min-height: 36px;
  padding: 6px 12px;
  border: 1px solid #d1d5db;
  border-radius: 4px;
  font-size: 0.875rem;
  line-height: 1.25rem;
  font-weight: 400;
  font-family: inherit;
  color: var(--heading, #201f1e);
  background-color: #f3f4f6;
  box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
}

select:not([multiple]) {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3E%3Cpath stroke='%236b7280' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='M6 8l4 4 4-4'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  background-size: 16px 16px;
  padding-right: 36px;
}

input:not([type="checkbox"]):not([type="radio"]):not([type="file"]):not([type="range"]):not([type="button"]):not([type="submit"]):not([type="reset"]):not([type="hidden"]):not([type="image"]):focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: var(--primary, #0078d4);
  box-shadow:
    0 0 0 3px color-mix(in srgb, var(--primary, #0078d4) 25%, transparent),
    0 1px 2px 0 rgba(0, 0, 0, 0.05);
}

input::placeholder,
textarea::placeholder {
  color: #6b7280;
}

.field label {
  color: var(--text);
}

/* ---- Consistent field sizing across the app ---- */
.field input,
.field select,
.field textarea,
.field .ss,
.field .sms {
  width: 100%;
}

.field input:not([type="checkbox"]):not([type="radio"]),
.field select,
.field .ss-control {
  height: auto;
  min-height: 36px;
}

.field input[type="checkbox"] {
  width: 18px;
  height: 18px;
  min-height: 0;
}

/* Description / any textarea keeps its own defined size */
.field textarea,
textarea {
  min-height: 84px;
  height: auto;
  resize: vertical;
}

/* CRM create/edit pages use the same bordered panel rhythm as EmployeeForm. */
.crm-resource-form {
  overflow: visible;
}

.crm-resource-form > .error {
  margin-bottom: 16px;
}

.crm-resource-form > h4 {
  margin: 0 0 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border);
  font-size: 14px;
}

.crm-resource-form .form-grid {
  align-items: start;
}

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

.crm-form-footer {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 24px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}

@media (max-width: 760px) {
  .crm-resource-form {
    padding: 16px;
  }

  .crm-resource-form .panel-header {
    align-items: flex-start;
    gap: 12px;
  }

  .crm-resource-form .form-grid {
    grid-template-columns: 1fr;
  }

  .crm-resource-form .field.full {
    grid-column: auto;
  }
}

/* Modal */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(17, 24, 39, 0.5);
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 40px 16px;
  z-index: 50;
  overflow-y: auto;
}

.modal {
  background: var(--surface);
  border-radius: 14px;
  width: 100%;
  max-width: 640px;
  padding: 24px;
}

.modal-wide {
  max-width: 920px;
}

.modal h3 {
  margin-top: 0;
}

.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 20px;
}

/* Login */
.login-wrap {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--surface-raised);
  background-image: radial-gradient(
      circle at 20% 20%,
      rgba(0, 120, 212, 0.06),
      transparent 40%
    ),
    radial-gradient(circle at 80% 80%, rgba(0, 120, 212, 0.05), transparent 40%);
}

.login-card {
  background: var(--surface);
  border-radius: 0;
  padding: 40px 36px;
  width: 380px;
  border: 1px solid var(--border);
  border-top: 3px solid var(--primary);
  box-shadow: 0 6.4px 14.4px rgba(0, 0, 0, 0.13), 0 1.2px 3.6px rgba(0, 0, 0, 0.11);
}

.login-brand {
  display: flex;
  justify-content: center;
  margin-bottom: 8px;
}

.login-logo {
  display: block;
  height: 52px;
  width: auto;
  max-width: 100%;
}

.login-card h1 {
  margin: 0 0 4px;
  font-size: 26px;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.login-card .sub {
  color: var(--muted);
  margin-bottom: 24px;
  font-size: 14px;
  text-align: center;
}

.login-credit {
  margin: 20px 0 0;
  text-align: center;
  font-size: 12px;
  color: var(--muted);
  letter-spacing: 0.01em;
}

.login-link-btn {
  background: none;
  border: none;
  padding: 0;
  color: var(--primary, #0a84ff);
  font-size: 13px;
  cursor: pointer;
  text-decoration: underline;
}

.login-link-btn:hover {
  opacity: 0.85;
}

.login-card .field {
  margin-bottom: 16px;
}

.error {
  color: var(--danger);
  font-size: 13px;
  margin-top: 8px;
}

.success {
  color: #166534;
  font-size: 13px;
  margin-top: 8px;
}

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

.pill {
  padding: 2px 9px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
}

.pill.green { background: #dcfce7; color: #166534; }
.pill.gray { background: var(--surface-hover); color: var(--muted); }
.pill.red { background: #fee2e2; color: #991b1b; }
.pill.amber { background: #fef3c7; color: #92400e; }

/* ===== Roles & Permissions ===== */
.roles-layout {
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr);
  gap: 20px;
  align-items: start;
  min-height: 420px;
}
.roles-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  border: 1px solid var(--border, #edebe9);
  border-radius: 10px;
  padding: 10px;
  background: var(--surface-raised);
  max-height: min(70vh, 640px);
  overflow-y: auto;
}
.roles-list-item {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  width: 100%;
  text-align: left;
  padding: 10px 12px;
  border: 1px solid transparent;
  border-radius: 4px;
  background: var(--surface);
  cursor: pointer;
  box-shadow: none;
  font: inherit;
  color: inherit;
}
.roles-list-item:hover {
  border-color: var(--border);
  background: var(--surface-raised);
}
.roles-list-item.active {
  border-color: var(--primary);
  background: var(--primary-soft);
  box-shadow: inset 0 0 0 1px var(--primary);
}
.roles-list-name {
  font-weight: 600;
  font-size: 14px;
  color: var(--text);
  line-height: 1.3;
}
.roles-list-meta {
  font-size: 12px;
  color: var(--muted);
  line-height: 1.3;
}
.roles-editor {
  border: 1px solid var(--border, #edebe9);
  border-radius: 10px;
  padding: 16px 18px;
  background: var(--surface);
  min-height: 320px;
}
.roles-editor-empty {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 240px;
  color: var(--muted);
  text-align: center;
  padding: 24px;
}
.roles-form-row {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  align-items: flex-end;
  margin-bottom: 8px;
}
@media (max-width: 900px) {
  .roles-layout {
    grid-template-columns: 1fr;
  }
  .roles-list {
    max-height: 220px;
    flex-direction: row;
    flex-wrap: wrap;
  }
  .roles-list-item {
    width: auto;
    min-width: 160px;
    flex: 1 1 160px;
  }
}

.access-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 14px;
}
.access-module {
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface);
  overflow: hidden;
}
.access-module.on {
  border-color: #c7d2fe;
  box-shadow: 0 0 0 1px #c7d2fe inset;
}
.access-module-head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  background: var(--surface-raised);
  cursor: pointer;
}
.access-module.on .access-module-head {
  background: var(--surface-hover);
}
.menu-perm-list {
  padding: 8px 6px 12px;
  border-top: 1px solid #f0f0f3;
}
.menu-perm-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 4px 8px;
  font-size: 13px;
  border-radius: 6px;
}
.menu-perm-row:hover {
  background: var(--surface-raised);
}
.menu-perm-name {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
}
.menu-perm-actions {
  display: flex;
  gap: 10px;
}
.menu-perm-act {
  display: flex;
  align-items: center;
  gap: 3px;
  font-size: 11px;
  color: var(--muted);
  cursor: pointer;
}
.menu-perm-group {
  font-weight: 600;
  color: var(--muted);
}

.rd-filters {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 14px;
}
.rd-filters .field { margin: 0; min-width: 160px; }
.rd-filters .rd-emp { min-width: 260px; flex: 1; }
.rd-filters .rd-actions { margin-left: auto; }

.tree-canvas {
  background:
    radial-gradient(circle at 1px 1px, rgba(79, 70, 229, 0.08) 1px, transparent 0)
      0 0 / 22px 22px,
    linear-gradient(135deg, #f5f7ff 0%, #eef1fb 100%);
  border: 1px solid #e3e7f5;
  border-radius: 12px;
  padding: 22px 20px;
  overflow-x: auto;
}

/* Hierarchy level palette — accent, tint, connector */
.tree .node.level-0,
.legend-item.level-0 { --level-accent: #1e3a8a; --level-bg: #eff6ff; --level-border: #bfdbfe; --level-stat: #dbeafe; }
.tree .node.level-1,
.legend-item.level-1 { --level-accent: #0f766e; --level-bg: #f0fdfa; --level-border: #99f6e4; --level-stat: #ccfbf1; }
.tree .node.level-2,
.legend-item.level-2 { --level-accent: #1d4ed8; --level-bg: #eff6ff; --level-border: #93c5fd; --level-stat: #dbeafe; }
.tree .node.level-3,
.legend-item.level-3 { --level-accent: #6d28d9; --level-bg: #f5f3ff; --level-border: #c4b5fd; --level-stat: #ede9fe; }
.tree .node.level-4,
.legend-item.level-4 { --level-accent: #b45309; --level-bg: #fffbeb; --level-border: #fcd34d; --level-stat: #fef3c7; }
.tree .node.level-5,
.legend-item.level-5 { --level-accent: #475569; --level-bg: #f8fafc; --level-border: #cbd5e1; --level-stat: #e2e8f0; }

.hierarchy-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 14px;
  margin-bottom: 18px;
  padding: 10px 14px;
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid #e3e7f5;
  border-radius: 4px;
}

.legend-item {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text);
}

.legend-swatch {
  width: 14px;
  height: 14px;
  border-radius: 4px;
  background: var(--level-bg);
  border: 2px solid var(--level-accent);
  flex-shrink: 0;
}

.level-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 26px;
  padding: 2px 6px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.4px;
  color: var(--level-accent);
  background: var(--level-bg);
  border: 1px solid var(--level-border);
  border-radius: 4px;
  flex-shrink: 0;
}

.tree {
  list-style: none;
  margin: 0;
  padding-left: 0;
}

/* Nested levels — connector color matches child level */
.tree .tree {
  margin-left: 16px;
  padding-left: 20px;
  border-left: 1.5px solid var(--level-accent, #c7cde8);
}

.tree .tree.tree-level-1 { --level-accent: #1e3a8a; }
.tree .tree.tree-level-2 { --level-accent: #0f766e; }
.tree .tree.tree-level-3 { --level-accent: #1d4ed8; }
.tree .tree.tree-level-4 { --level-accent: #6d28d9; }
.tree .tree.tree-level-5 { --level-accent: #b45309; }
.tree .tree.tree-level-6 { --level-accent: #475569; }

.tree li {
  position: relative;
  padding: 5px 0;
}

/* Horizontal connector from the vertical line to each child strip. */
.tree .tree > li::before {
  content: "";
  position: absolute;
  top: 22px;
  left: -20px;
  width: 20px;
  height: 1.5px;
  background: var(--level-accent, var(--border-strong));
}

.tree .node {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 8px;
  min-width: 280px;
  max-width: 520px;
  padding: 10px 12px;
  background: var(--level-bg, var(--surface));
  border: 1px solid var(--level-border, var(--border));
  border-left: 4px solid var(--level-accent, var(--primary));
  border-radius: 4px;
  box-shadow: 0 1px 2px rgba(16, 24, 40, 0.05);
  transition: box-shadow 0.12s ease, border-color 0.12s ease;
}

.node-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.node-title {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.tree .node strong {
  font-weight: 600;
  color: var(--text);
}

.node-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 12px;
}

.node-stat {
  display: inline-flex;
  align-items: baseline;
  gap: 6px;
  padding: 4px 8px;
  background: var(--level-stat, var(--surface-raised));
  border: 1px solid var(--level-border, var(--border));
  border-radius: 6px;
  font-size: 12px;
}

.node-stat-label {
  color: var(--muted);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.3px;
  font-size: 10px;
}

.node-stat-value {
  font-weight: 600;
  color: var(--text);
}

.node-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 14px;
  font-size: 12px;
  color: var(--muted);
}

.node-meta-label {
  font-weight: 600;
  color: var(--muted);
}

.tree .node:hover {
  border-color: var(--level-accent, var(--primary));
  box-shadow: 0 2px 10px color-mix(in srgb, var(--level-accent, var(--primary)) 18%, transparent);
}

/* Inactive branches: muted accent + dimmed strip. */
.tree .node.inactive {
  --level-accent: var(--muted);
  --level-bg: #f9fafb;
  --level-border: var(--border);
  --level-stat: #f3f4f6;
  opacity: 0.65;
}

.tree .node-actions {
  display: inline-flex;
  gap: 6px;
  flex-shrink: 0;
  opacity: 0;
  transition: opacity 0.12s ease-in-out;
}

.tree .node:hover .node-actions {
  opacity: 1;
}

.checkbox-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 0;
  border-bottom: 1px solid var(--border);
}

.multi-select-box {
  max-height: 180px;
  overflow-y: auto;
  border: 1px solid var(--border-strong);
  border-radius: 0;
  padding: 6px 10px;
  background: var(--surface);
}

/* Searchable single-select (combobox) */
.ss {
  position: relative;
}

.ss-control {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-height: 36px;
  border: 1px solid #d1d5db;
  border-radius: 4px;
  background-color: #f3f4f6;
  padding: 6px 12px;
  cursor: pointer;
  font-size: 0.875rem;
  color: var(--heading, #201f1e);
  box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
}

.ss-disabled .ss-control {
  cursor: not-allowed;
  background: var(--surface-hover);
  color: var(--muted);
  border-color: var(--border-strong);
}

.ss-caret {
  color: var(--muted);
  font-size: 12px;
}

.ss-pop {
  position: absolute;
  z-index: 30;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 0;
  box-shadow: 0 8px 24px rgba(16, 24, 40, 0.12);
  overflow: hidden;
}

.ss-pop.ss-pop-portal {
  right: auto;
  overflow: hidden;
  box-shadow: 0 8px 28px rgba(16, 24, 40, 0.18);
}

.ss-search {
  width: 100%;
  border: none;
  border-bottom: 1px solid var(--border);
  padding: 9px 12px;
  outline: none;
  border-radius: 0;
}

.ss-list {
  max-height: 220px;
  overflow-y: auto;
}

.ss-item {
  padding: 9px 12px;
  font-size: 14px;
  cursor: pointer;
  border-bottom: 1px solid #f1f2f6;
}

.ss-item:last-child {
  border-bottom: none;
}

.ss-item:hover {
  background: var(--surface-hover);
}

.ss-item.active {
  background: var(--surface-hover);
  font-weight: 600;
}

.ss-clear {
  color: var(--muted);
  font-style: italic;
}

.ss-empty {
  padding: 10px 12px;
  font-size: 13px;
}

/* Searchable multi-select */
.sms {
  position: relative;
  border: 1px solid var(--border-strong);
  border-radius: 0;
  background: var(--surface);
}

.sms-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 8px;
  border-bottom: 1px solid var(--border);
}

.sms-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--surface-hover);
  color: var(--primary-dark);
  border-radius: 999px;
  padding: 3px 6px 3px 10px;
  font-size: 12px;
  font-weight: 600;
}

.sms-chip button {
  border: none;
  background: rgba(79, 70, 229, 0.15);
  color: var(--primary-dark);
  border-radius: 50%;
  width: 18px;
  height: 18px;
  line-height: 1;
  cursor: pointer;
  font-size: 13px;
}

.sms-search {
  width: 100%;
  border: none;
  padding: 9px 12px;
  outline: none;
  border-radius: 0;
  background: transparent;
}

.sms-pop {
  position: absolute;
  z-index: 40;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 0;
  box-shadow: 0 8px 24px rgba(16, 24, 40, 0.12);
  overflow: hidden;
}

.sms-list {
  max-height: 220px;
  overflow-y: auto;
}

.sms-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  font-size: 14px;
  cursor: pointer;
  border-bottom: 1px solid #f1f2f6;
}

.sms-item:last-child {
  border-bottom: none;
}

.sms-item:hover {
  background: var(--surface-hover);
}

.sms-item input {
  width: 16px;
  height: 16px;
}

.sms-empty {
  padding: 10px 12px;
  font-size: 13px;
}

.multi-select-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 2px;
  font-size: 14px;
  cursor: pointer;
  border-bottom: 1px solid #f1f2f6;
}

.multi-select-item:last-child {
  border-bottom: none;
}

.multi-select-item input {
  width: 16px;
  height: 16px;
}

.spinner {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  padding: 48px 24px;
  min-height: 120px;
  color: var(--muted);
}

.page-fallback {
  padding: 28px 4px;
  min-height: 64px;
  color: var(--muted);
}

.toolbar {
  display: flex;
  gap: 10px;
  margin-bottom: 14px;
}

.toolbar input {
  flex: 1;
  max-width: 280px;
}

/* HRMS dashboards + leave workflow */
.card .value.green { color: #166534; }
.card .value.amber { color: #92400e; }
.card .value.red { color: #991b1b; }

.quick-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 4px 0 18px;
}

.dash-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(360px, 1fr));
  gap: 16px;
  margin-top: 16px;
}

.tabs {
  display: flex;
  gap: 8px;
}

.notif-list {
  list-style: none;
  margin: 0;
  padding: 0;
}
.notif-list li {
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
}
.notif-list li.unread {
  background: var(--surface-hover);
  padding-left: 10px;
  border-left: 3px solid #2563eb;
}

/* Notification bell */
.notif-bell {
  position: relative;
}
.bell-btn {
  position: relative;
  background: none;
  border: none;
  cursor: pointer;
  font-size: 18px;
  padding: 4px 6px;
  line-height: 1;
}
.bell-badge {
  position: absolute;
  top: -2px;
  right: -2px;
  background: #ef4444;
  color: #fff;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 700;
  min-width: 16px;
  height: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 4px;
}
.bell-pop {
  position: absolute;
  right: 0;
  top: 130%;
  width: 320px;
  max-height: 420px;
  overflow-y: auto;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.15);
  z-index: 50;
}
.bell-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
}
.link-btn {
  background: none;
  border: none;
  color: #2563eb;
  cursor: pointer;
  font-size: 12px;
}
.rd-emp-link {
  font-size: inherit;
  font-weight: 600;
  padding: 0;
  text-align: left;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  display: inline-block;
  vertical-align: bottom;
}
.rd-emp-link:hover {
  text-decoration: underline;
}

.rd-util-panel {
  overflow: hidden;
}
.rd-util-table-wrap {
  overflow-x: auto;
  margin: 0;
}
.rd-util-table {
  width: 100%;
  min-width: 920px;
  table-layout: fixed;
  border-collapse: collapse;
}
.rd-util-table th,
.rd-util-table td {
  vertical-align: middle;
  padding: 10px 12px;
}
.rd-util-table th {
  white-space: nowrap;
}
.rd-util-table th:nth-child(1),
.rd-util-table td.rd-num:first-child {
  width: 56px;
}
.rd-util-table th:nth-child(2),
.rd-util-table td.rd-emp-cell {
  width: 22%;
}
.rd-emp-cell {
  max-width: 0;
}
.rd-util-table .rd-num {
  text-align: right;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.rd-util-table .rd-util,
.rd-util-table .rd-unalloc {
  text-align: right;
  white-space: nowrap;
}
.rd-util-table .rd-util .rm-band,
.rd-util-table .rd-unalloc .pill {
  justify-content: flex-end;
}
.rd-util-table th:nth-child(n + 3) {
  text-align: right;
}
.bell-list .bell-item {
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
}
.bell-list .bell-item:hover {
  background: var(--surface-raised);
}
.bell-list .bell-item.unread {
  background: var(--surface-hover);
}
.bell-list .bell-item.is-chat.unread {
  background: var(--surface-hover);
  border-left: 3px solid #6264a7;
}
.bell-title {
  font-weight: 600;
  font-size: 13px;
}
.bell-msg {
  font-size: 12px;
  margin-top: 2px;
}
.bell-empty {
  padding: 18px 14px;
  text-align: center;
}

/* Capacity planning report grid */
.cp-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 16px 24px;
  padding: 10px 16px;
  margin-bottom: 16px;
  font-size: 12px;
}

.cp-legend-item {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.panel.cp-grid-wrap {
  padding: 0;
  overflow: hidden;
}

.cp-grid-scroll {
  overflow: auto;
  max-height: calc(100vh - 280px);
  scrollbar-gutter: stable both-edges;
  -webkit-overflow-scrolling: touch;
}

.cp-grid-wrap {
  padding: 0;
  margin: 0;
}

.cp-grid-scroll .cp-grid {
  margin-bottom: 2px;
}

.cp-grid {
  border-collapse: separate;
  border-spacing: 0;
  font-size: 11px;
  min-width: max-content;
  width: max-content;
}

.cp-grid th,
.cp-grid td {
  border: 1px solid #c5d4e8;
  padding: 0;
  text-align: center;
  vertical-align: middle;
  background: var(--surface);
}

.cp-grid thead th {
  background: var(--surface-raised);
  font-weight: 600;
  position: sticky;
  top: 0;
  z-index: 2;
}

.cp-grid thead th.cp-sticky {
  z-index: 5;
}

.cp-sticky {
  position: sticky;
  z-index: 3;
  background: var(--surface-raised) !important;
  text-align: left !important;
  padding: 6px 8px !important;
  white-space: nowrap;
}

.cp-grid tbody td.cp-sticky {
  background: var(--surface) !important;
}

.cp-grid tbody tr:nth-child(even) td.cp-sticky {
  background: var(--surface-raised) !important;
}

.cp-sno {
  left: 0;
  min-width: 42px;
  width: 42px;
  text-align: center !important;
}

.cp-name {
  left: 42px;
  min-width: 160px;
}

.cp-hours {
  left: 202px;
  min-width: 130px;
  text-align: center !important;
  font-weight: 600;
}

.cp-hours2 {
  left: 332px;
  min-width: 140px;
  text-align: center !important;
  font-weight: 600;
  box-shadow: 4px 0 6px -2px rgba(15, 23, 42, 0.12);
}

.cp-grid thead th.cp-hours2 {
  box-shadow: 4px 0 6px -2px rgba(15, 23, 42, 0.12);
}

.cp-day {
  min-width: 34px;
  max-width: 34px;
  padding: 4px 2px !important;
}

.cp-day.cp-weekend {
  background: #f5c6cb;
}

.cp-day.cp-holiday-col {
  background: #fdebd0;
}

.cp-day-label {
  writing-mode: vertical-rl;
  transform: rotate(180deg);
  display: inline-block;
  font-size: 10px;
  line-height: 1.1;
  white-space: nowrap;
}

.cp-cell {
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 34px;
  min-height: 28px;
  font-weight: 600;
  font-size: 10px;
}

.cp-non-working {
  background: #e74c3c;
  color: #fff;
}

.cp-holiday {
  background: #e67e22;
  color: #fff;
}

.cp-leave {
  background: #922b21;
  color: #fff;
}

.cp-idle {
  background: #f5c6cb;
  color: var(--text);
}

.cp-allocated {
  background: #27ae60;
  color: #fff;
}

/* Project Management dashboard — project table helpers */
.pm-dash-project-row {
  cursor: pointer;
}

.pm-dash-project-row:hover td {
  background: var(--surface-hover);
}

.pm-dash-hint {
  margin: 10px 16px 14px;
  font-size: 12px;
}

/* ================================================================== */
/* Project Management module — compact, professional typography        */
/* ================================================================== */
.pm-page {
  font-size: 13px;
  color: var(--text);
  -webkit-font-smoothing: antialiased;
}

.pm-page h1 {
  font-size: 20px;
  font-weight: 600;
  letter-spacing: -0.01em;
  margin: 0 0 14px;
  color: var(--text);
}

.pm-page h2 {
  font-size: 15px;
  font-weight: 600;
  letter-spacing: -0.005em;
  margin: 0;
  color: var(--text);
}

.pm-page h3 {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
}

.pm-page .panel-header h2 {
  font-size: 15px;
}

.pm-page table {
  font-size: 13px;
}

.pm-page th {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
}

.pm-page .card .value {
  font-size: 22px;
  font-weight: 600;
}

.pm-page .card .label {
  font-size: 11px;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: var(--muted);
}

.pm-page .proj-card h2 {
  font-size: 16px;
}

/* Compact, professional card theme for PM pages */
.pm-page {
  padding: 16px 20px;
  background: var(--surface-hover);
}

.pm-page .cards {
  gap: 14px;
  margin-bottom: 16px;
}

.pm-page .card {
  padding: 16px 18px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
  transition: box-shadow 0.15s ease, transform 0.15s ease;
}

.pm-page .card:hover {
  box-shadow: 0 12px 30px rgba(15, 23, 42, 0.1), 0 3px 8px rgba(15, 23, 42, 0.05);
}

.pm-page .card .value {
  font-size: 26px;
  font-weight: 700;
  color: var(--primary);
  line-height: 1.1;
}

.pm-page .card .label {
  font-size: 11px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
  margin-top: 6px;
}

.pm-page .card-link {
  margin-top: 6px;
}

/* KPI stat card with premium icon tile */
.card.pm-stat {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.pm-stat-body {
  min-width: 0;
}

.pm-stat-icon {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  color: var(--primary);
  background: color-mix(in srgb, var(--primary) 12%, var(--surface));
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--primary) 18%, transparent);
}

.pm-stat-icon .kpi-ico-svg,
.pm-stat-icon svg {
  width: 22px;
  height: 22px;
  stroke-width: 1.85;
}

.card.pm-stat.is-active .pm-stat-icon {
  background: color-mix(in srgb, var(--primary) 20%, var(--surface));
}

.rm-kpi-red .pm-stat-icon,
.crm-kpi-danger .pm-stat-icon {
  color: #c50f1f;
  background: color-mix(in srgb, #c50f1f 12%, var(--surface));
  box-shadow: inset 0 0 0 1px color-mix(in srgb, #c50f1f 20%, transparent);
}

.rm-kpi-green .pm-stat-icon,
.crm-kpi-success .pm-stat-icon {
  color: #0e7c3a;
  background: color-mix(in srgb, #0e7c3a 12%, var(--surface));
  box-shadow: inset 0 0 0 1px color-mix(in srgb, #0e7c3a 20%, transparent);
}

.rm-kpi-amber .pm-stat-icon,
.crm-kpi-warn .pm-stat-icon {
  color: #c19c00;
  background: color-mix(in srgb, #c19c00 14%, var(--surface));
  box-shadow: inset 0 0 0 1px color-mix(in srgb, #c19c00 22%, transparent);
}

.pm-page .pm-stat.is-active {
  border-color: var(--primary);
  box-shadow: inset 0 0 0 1px var(--primary), 0 1.6px 3.6px rgba(0, 0, 0, 0.08);
  background: color-mix(in srgb, var(--primary) 6%, var(--surface));
}

.pm-page .panel {
  padding: 16px 18px;
  border: 1px solid var(--border);
  border-radius: 0;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
  margin-bottom: 14px !important;
}

.pm-page .panel-header {
  margin-bottom: 12px;
  border-bottom: 1px solid #f0f2f6;
  padding-bottom: 10px;
}

.pm-page th,
.pm-page td {
  padding: 8px 12px;
}

.pm-page tbody tr:hover td {
  background: var(--surface-hover);
}

.pm-page .pm-dash-hint {
  margin: 8px 4px 2px;
}

/* ================================================================== */
/* Employee self-service home                                          */
/* ================================================================== */
.emp-home {
  --eh-radius: 10px;
}

.eh-banner {
  border-radius: 12px;
  padding: 18px 22px;
  margin-bottom: 14px;
  color: #fff;
  background: linear-gradient(120deg, #005a9e 0%, #0078d4 55%, #2b88d8 100%);
  box-shadow: 0 4px 14px rgba(0, 90, 158, 0.18);
}

.eh-banner h1 {
  margin: 0;
  font-size: 22px;
  font-weight: 750;
}

.eh-banner p {
  margin: 6px 0 0;
  opacity: 0.92;
  font-size: 13px;
}

.eh-grid {
  display: grid;
  grid-template-columns: 320px 1fr;
  gap: 14px;
  align-items: start;
}

@media (max-width: 900px) {
  .eh-grid {
    grid-template-columns: 1fr;
  }
}

.eh-left,
.eh-right {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.eh-card {
  background: var(--surface, #fff);
  color: var(--text, #201f1e);
  border: 1px solid var(--border, #e1dfdd);
  border-radius: var(--eh-radius);
  padding: 14px 16px;
  box-shadow: 0 1px 3px rgba(16, 24, 40, 0.04);
}

.eh-punch {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.eh-punch-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  font-size: 14px;
}

.eh-card-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border);
}

.eh-card-head h3 {
  margin: 0;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
}

/* Holiday card — VMax primary tone, not red Keka-style */
.eh-holiday {
  background: linear-gradient(135deg, #005a9e 0%, #0078d4 100%);
  color: #fff;
  border: none;
  border-radius: var(--eh-radius);
}

.eh-holiday .eh-card-head {
  border-bottom-color: rgba(255, 255, 255, 0.2);
}

.eh-holiday .eh-card-head h3 {
  color: rgba(255, 255, 255, 0.9);
}

.eh-holiday .muted {
  color: rgba(255, 255, 255, 0.85);
}

.eh-holiday-name {
  font-size: 18px;
  font-weight: 700;
}

.eh-holiday-date {
  margin-top: 4px;
  font-size: 13px;
  opacity: 0.9;
}

/* People rows (avatars) */
.eh-people-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.eh-person {
  display: flex;
  align-items: center;
  gap: 10px;
}

.eh-avatar {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  color: #fff;
  font-size: 13px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.eh-person-name {
  font-weight: 600;
  font-size: 14px;
  color: var(--text, #201f1e);
}

.eh-person-sub {
  font-size: 12px;
  color: var(--muted, #6b7280);
}

/* Time / clock */
.eh-time {
  text-align: center;
}

.eh-clock {
  background: linear-gradient(120deg, #106ebe, #0078d4);
  color: #fff;
  border-radius: 10px;
  padding: 14px;
  margin-bottom: 12px;
}

.eh-clock-time {
  font-size: 28px;
  font-weight: 800;
  letter-spacing: 0.02em;
  font-variant-numeric: tabular-nums;
}

.eh-clock-day {
  font-size: 12px;
  opacity: 0.9;
  margin-top: 2px;
}

.eh-clock-actions {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  flex-wrap: wrap;
}

.eh-clock-info {
  font-size: 12px;
}

/* Leave balances */
.eh-balances {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
}

.eh-balance {
  flex: 1 1 80px;
  text-align: center;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px 8px;
  background: var(--surface-raised);
}

.eh-balance-num {
  font-size: 22px;
  font-weight: 800;
  color: var(--primary);
}

.eh-balance-name {
  font-size: 11px;
  color: var(--muted, #6b7280);
  margin-top: 2px;
}

/* Inbox */
.eh-inbox {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.eh-inbox-num {
  font-size: 26px;
  font-weight: 800;
  color: #e11d48;
}

/* People tabs (right column) */
.eh-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  border-bottom: 1px solid var(--border, #e5e7eb);
  margin-bottom: 14px;
}

.eh-tab {
  border: none;
  background: none;
  padding: 8px 12px;
  font-size: 13px;
  font-weight: 600;
  color: var(--muted, #6b7280);
  cursor: pointer;
  border-bottom: 2px solid transparent;
}

.eh-tab.active {
  color: var(--primary);
  border-bottom-color: var(--primary);
}

.eh-tab-body {
  max-height: 320px;
  overflow-y: auto;
  padding-right: 4px;
}

.eh-tab-body h4 {
  margin: 0 0 10px;
  font-size: 13px;
  font-weight: 700;
}

/* HRMS Dashboard — Logs & Requests (attendance) */
.hrms-logs-panel {
  margin-bottom: 20px;
  padding: 0;
  overflow: hidden;
}

.hrms-logs-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 18px 0;
}

.hrms-logs-head h2 {
  margin: 0;
  font-size: 18px;
  font-weight: 700;
}

.hrms-logs-toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--muted, #6b7280);
  cursor: pointer;
  user-select: none;
}

.hrms-logs-toggle input {
  width: 36px;
  height: 20px;
  accent-color: #6366f1;
  cursor: pointer;
}

.hrms-logs-tabs {
  display: flex;
  gap: 4px;
  padding: 12px 18px 0;
  border-bottom: 1px solid var(--border, #e5e7eb);
}

.hrms-logs-tab {
  border: none;
  background: transparent;
  padding: 10px 14px;
  font-size: 13px;
  font-weight: 600;
  color: var(--muted, #6b7280);
  cursor: pointer;
  border-radius: 6px 6px 0 0;
}

.hrms-logs-tab.active {
  background: #ede9fe;
  color: #5b21b6;
}

.hrms-logs-periods {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 14px 18px 0;
}

.hrms-logs-period {
  border: 1px solid var(--border, #e5e7eb);
  background: var(--surface, #fff);
  padding: 6px 12px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: var(--text, #374151);
  border-radius: 4px;
  cursor: pointer;
}

.hrms-logs-period.active {
  background: #5b21b6;
  border-color: #5b21b6;
  color: #fff;
}

.hrms-logs-subhead {
  padding: 12px 18px 8px;
  font-size: 13px;
  font-weight: 700;
  color: var(--text, #111827);
}

.hrms-logs-loading {
  padding: 12px 18px 20px;
}

.hrms-logs-table-wrap {
  overflow-x: auto;
  padding: 0 18px 16px;
}

.hrms-logs-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.hrms-logs-table th {
  text-align: left;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted, #6b7280);
  padding: 10px 12px 10px 0;
  border-bottom: 1px solid var(--border, #e5e7eb);
  white-space: nowrap;
}

.hrms-logs-table td {
  padding: 14px 12px 14px 0;
  border-bottom: 1px solid var(--border, #f3f4f6);
  vertical-align: middle;
}

.hrms-logs-no-entry {
  color: #6366f1;
  font-size: 12px;
}

.hrms-logs-visual {
  min-width: 140px;
}

.hrms-logs-visual-track {
  height: 8px;
  background: #f3f4f6;
  border-radius: 999px;
  position: relative;
  overflow: hidden;
}

.hrms-logs-visual-fill {
  position: absolute;
  top: 0;
  bottom: 0;
  background: linear-gradient(90deg, #818cf8, #6366f1);
  border-radius: 999px;
}

.hrms-logs-more {
  border: none;
  background: none;
  color: var(--muted, #9ca3af);
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
  padding: 2px 6px;
}

.hrms-logs-calendar {
  padding: 0 18px 20px;
}

.hrms-logs-calendar-head {
  font-size: 15px;
  font-weight: 700;
  margin-bottom: 12px;
}

.hrms-logs-calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 6px;
}

.hrms-logs-cal-dow {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--muted, #6b7280);
  text-align: center;
  padding: 4px;
}

.hrms-logs-cal-cell {
  min-height: 52px;
  border: 1px solid var(--border, #e5e7eb);
  border-radius: 6px;
  display: flex;
  align-items: flex-start;
  justify-content: flex-end;
  padding: 6px;
  font-size: 12px;
  font-weight: 600;
  background: var(--surface, #fff);
}

.hrms-logs-cal-cell.empty {
  border-color: transparent;
  background: transparent;
}

.hrms-logs-cal-cell.present {
  background: #ecfdf5;
  border-color: #6ee7b7;
}

.hrms-logs-cal-cell.absent {
  background: #fef2f2;
  border-color: #fca5a5;
}

.hrms-logs-cal-cell.leave {
  background: #fffbeb;
  border-color: #fcd34d;
}

.hrms-logs-cal-cell.off {
  background: #f3f4f6;
  border-color: #d1d5db;
}

.hrms-logs-cal-cell.none {
  background: var(--surface, #fff);
}

.eh-feed-placeholder {
  border-style: dashed;
}

/* ---------- Feed login notice strips ---------- */
.feed-notice-stack {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin: 0 0 12px;
}

.feed-notice-strip {
  display: flex;
  align-items: stretch;
  min-height: 36px;
  background: var(--primary-soft);
  border: 1px solid #c7e0f4;
  border-left: 3px solid var(--primary);
  border-radius: 4px;
  overflow: hidden;
}

.feed-notice-strip.is-update {
  background: #fff4ce;
  border-color: #f0e0a0;
  border-left-color: #ca5010;
}

.feed-notice-strip.is-chat {
  background: var(--surface-hover);
  border-color: #c8c6e4;
  border-left-color: #6264a7;
  box-shadow: 0 0 0 1px rgba(98, 100, 167, 0.12);
  animation: tc-notice-pulse 1.6s ease-in-out 2;
}

.feed-notice-strip.is-call {
  background: #dff6dd;
  border-color: #a7e3a5;
  border-left-color: #107c10;
  animation: tc-notice-pulse 1.6s ease-in-out 3;
}

.feed-notice-strip.is-mail {
  background: #fff4ce;
  border-color: #f0e0a0;
  border-left-color: #ca5010;
  animation: tc-notice-pulse 1.6s ease-in-out 2;
}

.feed-notice-strip.is-chat .feed-notice-cta {
  color: #6264a7;
}

.feed-notice-strip.is-call .feed-notice-cta {
  color: #107c10;
}

.feed-notice-strip.is-mail .feed-notice-cta {
  color: #ca5010;
}

.feed-notice-strip.is-chat .feed-notice-text strong {
  color: #373670;
}

.feed-notice-strip.is-call .feed-notice-text strong {
  color: #0b5a08;
}

.feed-notice-strip.is-mail .feed-notice-text strong {
  color: #8a3711;
}

@keyframes tc-notice-pulse {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-1px);
    box-shadow: 0 2px 10px rgba(98, 100, 167, 0.22);
  }
}

.feed-notice-body {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  padding: 6px 10px;
  border: 0;
  background: transparent;
  font: inherit;
  text-align: left;
  cursor: pointer;
  color: var(--text);
}

.feed-notice-body:hover {
  background: rgba(255, 255, 255, 0.45);
}

.feed-notice-icon {
  flex-shrink: 0;
  font-size: 14px;
  line-height: 1;
}

.feed-notice-text {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 4px 10px;
  font-size: 13px;
  line-height: 1.3;
}

.feed-notice-text strong {
  font-weight: 700;
}

.feed-notice-msg {
  color: var(--muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 100%;
}

.feed-notice-cta {
  flex-shrink: 0;
  font-size: 12px;
  font-weight: 700;
  color: var(--primary);
}

.feed-notice-strip.is-update .feed-notice-cta {
  color: #ca5010;
}

.feed-notice-close {
  flex-shrink: 0;
  width: 34px;
  border: 0;
  border-left: 1px solid rgba(0, 0, 0, 0.08);
  background: transparent;
  color: var(--muted);
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
}

.feed-notice-close:hover {
  background: rgba(0, 0, 0, 0.06);
  color: var(--text);
}

.feed-notice-more {
  margin: 0;
  font-size: 12px;
  padding-left: 4px;
}

.feed-post.is-highlighted {
  outline: 2px solid var(--primary);
  outline-offset: 1px;
  border-color: var(--primary);
  background: var(--primary-soft);
}

.feed-post-modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 80;
  background: rgba(15, 23, 42, 0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px 16px;
}

.feed-post-modal {
  width: min(560px, 100%);
  max-height: min(86vh, 820px);
  overflow: auto;
  background: var(--surface);
  border: 1px solid var(--border, #e5e7eb);
  border-radius: 10px;
  box-shadow: 0 18px 48px rgba(15, 23, 42, 0.28);
  padding: 14px 16px 16px;
}

.feed-post-modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border, #eef0f3);
}

.feed-post-modal-head h3 {
  margin: 0;
  font-size: 15px;
}

/* ---------- Announcements & Posts feed ---------- */
.feed-card .eh-card-head {
  margin-bottom: 10px;
}

.feed-composer {
  margin-bottom: 12px;
  padding: 0;
  background: transparent;
  border: none;
}

.feed-composer-box {
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--border, #e1dfdd);
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
}

.feed-tinymce {
  width: 100%;
}

.wif-tinymce {
  width: 100%;
}

.wif-tinymce .tox-tinymce {
  border-radius: 2px !important;
  border-color: var(--border-strong) !important;
  width: 100% !important;
}

.feed-tinymce .tox-tinymce {
  border: 1px solid var(--border) !important;
  border-radius: 4px !important;
  overflow: hidden;
}

.feed-tinymce .tox .tox-editor-header,
.feed-tinymce .tox .tox-toolbar,
.feed-tinymce .tox .tox-toolbar__primary,
.feed-tinymce .tox .tox-toolbar__overflow {
  background: var(--surface-raised) !important;
  border-bottom: 1px solid var(--border) !important;
  padding: 4px 6px !important;
  box-shadow: none !important;
}

.feed-tinymce .tox .tox-tbtn {
  width: 28px !important;
  height: 28px !important;
  background: transparent !important;
  color: var(--text) !important;
}

.feed-tinymce .tox .tox-tbtn:hover,
.feed-tinymce .tox .tox-tbtn:focus,
.feed-tinymce .tox .tox-tbtn--enabled,
.feed-tinymce .tox .tox-tbtn--enabled:hover {
  background: var(--surface-hover) !important;
  color: var(--heading, var(--text)) !important;
}

.feed-tinymce .tox .tox-tbtn svg {
  fill: currentColor !important;
}

.feed-tinymce .tox .tox-edit-area,
.feed-tinymce .tox .tox-edit-area__iframe {
  background: var(--surface) !important;
}

.feed-tinymce .tox .tox-statusbar {
  background: var(--surface-raised) !important;
  border-top: 1px solid var(--border) !important;
}

/* TinyMCE oxide skin still paints white chrome — force dark surfaces */
html[data-theme="dark"] .feed-tinymce .tox-tinymce,
html[data-theme="dark"] .feed-tinymce .tox .tox-editor-container,
html[data-theme="dark"] .feed-tinymce .tox .tox-sidebar-wrap,
html[data-theme="dark"] .feed-tinymce .tox .tox-edit-area,
html[data-theme="dark"] .feed-tinymce .tox .tox-edit-area__iframe {
  background: var(--surface) !important;
  border-color: var(--border) !important;
}

html[data-theme="dark"] .feed-tinymce .tox .tox-editor-header,
html[data-theme="dark"] .feed-tinymce .tox .tox-toolbar,
html[data-theme="dark"] .feed-tinymce .tox .tox-toolbar__primary,
html[data-theme="dark"] .feed-tinymce .tox .tox-toolbar__overflow,
html[data-theme="dark"] .feed-tinymce .tox .tox-toolbar-overlord {
  background: var(--surface-raised) !important;
  border-color: var(--border) !important;
}

html[data-theme="dark"] .feed-tinymce .tox .tox-tbtn,
html[data-theme="dark"] .feed-tinymce .tox .tox-split-button,
html[data-theme="dark"] .feed-tinymce .tox .tox-tbtn--select {
  background: transparent !important;
  color: var(--text) !important;
}

html[data-theme="dark"] .feed-tinymce .tox .tox-tbtn:hover,
html[data-theme="dark"] .feed-tinymce .tox .tox-tbtn:focus,
html[data-theme="dark"] .feed-tinymce .tox .tox-tbtn--enabled,
html[data-theme="dark"] .feed-tinymce .tox .tox-tbtn--enabled:hover,
html[data-theme="dark"] .feed-tinymce .tox .tox-split-button:hover {
  background: var(--surface-hover) !important;
  color: var(--heading) !important;
}

html[data-theme="dark"] .feed-tinymce .tox .tox-tbtn svg,
html[data-theme="dark"] .feed-tinymce .tox .tox-tbtn__icon-wrap svg {
  fill: #cbd5e1 !important;
}

html[data-theme="dark"] .feed-tinymce .tox .tox-tbtn:hover svg,
html[data-theme="dark"] .feed-tinymce .tox .tox-tbtn--enabled svg {
  fill: #f8fafc !important;
}

html[data-theme="dark"] .ml-editor .feed-tinymce .tox-tinymce {
  background: var(--surface) !important;
}

.feed-composer-attachments {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  padding: 0 12px 10px;
}

.feed-attach-thumb,
.feed-attach-reel,
.feed-attach-voice {
  position: relative;
  display: inline-flex;
  max-width: 100%;
}

.feed-attach-thumb img {
  display: block;
  max-width: 180px;
  max-height: 140px;
  border-radius: 8px;
  border: 1px solid var(--border, #e5e7eb);
  object-fit: cover;
  background: var(--surface-raised);
}

.feed-attach-reel .feed-reel {
  width: 120px;
  margin: 0;
}

.feed-attach-voice audio {
  width: min(100%, 260px);
  height: 32px;
}

.feed-attach-remove {
  position: absolute;
  top: -6px;
  right: -6px;
  z-index: 2;
  width: 22px;
  height: 22px;
  border: none;
  border-radius: 50%;
  background: #201f1e;
  color: #fff;
  font-size: 14px;
  line-height: 1;
  cursor: pointer;
  display: grid;
  place-items: center;
}

.feed-composer-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 6px 10px;
  border-top: 1px solid #f0f0f0;
  background: var(--surface-raised);
}

.feed-composer-tools {
  display: flex;
  align-items: center;
  gap: 2px;
  min-width: 0;
}

.feed-composer-end {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.feed-char-count {
  font-size: 11px;
}

.feed-icon-btn {
  box-sizing: border-box;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  min-height: 32px;
  padding: 0;
  border: none;
  border-radius: 4px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  transition: background 0.12s ease, color 0.12s ease;
}

.feed-icon-btn:hover:not(:disabled) {
  background: var(--surface-hover);
  color: var(--primary);
}

.feed-icon-btn.active {
  background: var(--primary-soft);
  color: var(--primary-dark);
}

.feed-icon-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.feed-icon-btn.recording {
  color: #a4262c;
  background: #fde7e9;
  animation: feed-pulse 1.1s ease-in-out infinite;
}

.feed-vibe-menu {
  position: relative;
}

.feed-vibe-popover {
  display: none;
  position: absolute;
  left: 0;
  bottom: calc(100% + 6px);
  z-index: 30;
  min-width: 180px;
  max-height: 260px;
  overflow: auto;
  padding: 6px;
  background: var(--surface);
  border: 1px solid var(--border, #e1dfdd);
  border-radius: 10px;
  box-shadow: 0 10px 28px rgba(15, 23, 42, 0.14);
}

.feed-vibe-popover.open {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.feed-vibe-option {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  border: none;
  background: transparent;
  text-align: left;
  padding: 7px 8px;
  border-radius: 6px;
  font: inherit;
  font-size: 13px;
  color: var(--text);
  cursor: pointer;
}

.feed-vibe-option:hover,
.feed-vibe-option.active {
  background: var(--primary-soft);
  color: var(--primary-dark);
}

.feed-file-input {
  display: none;
}

.feed-reel-chooser {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin: 0 12px 10px;
  padding: 10px;
  background: var(--surface-raised);
  border: 1px solid var(--border, #e5e7eb);
  border-radius: 4px;
}

.feed-reel-chooser-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-size: 13px;
}

.feed-reel-chooser-link {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.feed-reel-link-input {
  flex: 1;
  min-width: 160px;
  min-height: 32px;
  height: 32px;
  padding: 0 10px;
  border: 1px solid var(--border-strong, #8a8886);
  font: inherit;
  font-size: 13px;
  border-radius: 4px;
}

.feed-reel-upload-link {
  border: none;
  background: none;
  color: var(--primary);
  font: inherit;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  padding: 0;
  text-align: left;
}

.feed-reel-upload-link:hover {
  text-decoration: underline;
}

.feed-recording-hint {
  margin: 0;
  font-size: 12px;
  font-weight: 600;
  color: #a4262c;
}

@keyframes feed-pulse {
  0%,
  100% {
    box-shadow: 0 0 0 0 rgba(164, 38, 44, 0.35);
  }
  50% {
    box-shadow: 0 0 0 4px rgba(164, 38, 44, 0);
  }
}

.feed-post-body {
  margin: 0 0 8px;
  white-space: pre-wrap;
  word-break: break-word;
  line-height: 1.5;
  font-size: 14px;
  color: var(--text);
}

.feed-post-html {
  white-space: normal;
}

.feed-post-html p {
  margin: 0 0 0.55em;
}

.feed-post-html p:last-child {
  margin-bottom: 0;
}

.feed-post-html ul,
.feed-post-html ol {
  margin: 0 0 0.55em;
  padding-left: 1.35em;
}

.feed-post-html a {
  color: var(--primary-dark);
  text-decoration: underline;
}

.feed-post-html strong,
.feed-post-html b {
  font-weight: 700;
}

.feed-post-html em,
.feed-post-html i {
  font-style: italic;
}

.feed-post-html u {
  text-decoration: underline;
}

.feed-composer-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.feed-composer-left {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  min-width: 0;
}

.feed-file-input {
  display: none;
}

.feed-vibe-row {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.feed-vibe-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
}

.feed-vibe-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.feed-vibe-chip {
  border: 1px solid var(--border, #d1d5db);
  background: var(--surface);
  color: var(--text);
  border-radius: 999px;
  padding: 4px 10px;
  font: inherit;
  font-size: 12px;
  cursor: pointer;
  line-height: 1.3;
}

.feed-vibe-chip:hover {
  border-color: var(--primary);
  background: var(--primary-soft);
}

.feed-vibe-chip.active {
  border-color: var(--primary);
  background: var(--primary-soft);
  color: var(--primary-darker);
  font-weight: 600;
}

.feed-vibe-badge {
  margin-left: auto;
  flex-shrink: 0;
  font-size: 11px;
  font-weight: 600;
  color: var(--primary-darker);
  background: var(--primary-soft);
  border: 1px solid #c7e0f4;
  border-radius: 999px;
  padding: 3px 8px;
  white-space: nowrap;
}

.feed-delete-btn {
  flex-shrink: 0;
  margin-left: auto;
  color: #a4262c !important;
  border-color: #f1b8bb !important;
}

.feed-vibe-badge + .feed-delete-btn {
  margin-left: 4px;
}

.feed-delete-btn:hover:not(:disabled) {
  background: #fde7e9 !important;
}

.feed-voice-btn.recording {
  border-color: #a4262c !important;
  color: #a4262c !important;
  background: #fde7e9 !important;
  animation: feed-pulse 1.1s ease-in-out infinite;
}

@keyframes feed-pulse {
  0%,
  100% {
    box-shadow: 0 0 0 0 rgba(164, 38, 44, 0.35);
  }
  50% {
    box-shadow: 0 0 0 4px rgba(164, 38, 44, 0);
  }
}

.feed-recording-hint {
  margin: 0;
  font-size: 12px;
  font-weight: 600;
  color: #a4262c;
}

.feed-composer-voice {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}

.feed-composer-reel {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 8px;
}

.feed-composer-voice audio,
.feed-voice-player audio {
  width: min(100%, 360px);
  height: 36px;
}

.feed-voice-player {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
  margin: 0 0 10px;
  padding: 10px 12px;
  background: var(--surface-raised);
  border: 1px solid var(--border, #e5e7eb);
  border-radius: 4px;
}

.feed-voice-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text);
}

.feed-reel {
  position: relative;
  width: min(100%, 280px);
  aspect-ratio: 9 / 16;
  margin: 0 auto 10px;
  border-radius: 12px;
  overflow: hidden;
  background: #0b0b0f;
  border: 1px solid #1f2937;
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.18);
}

.feed-reel--preview {
  margin-bottom: 0;
}

.feed-reel--embed {
  width: min(100%, 320px);
  aspect-ratio: 9 / 16;
}

.feed-reel--pending {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px 14px;
  background: linear-gradient(160deg, #1f2937 0%, #0b0b0f 100%);
}

.feed-reel-pending-body {
  color: #fff;
  text-align: center;
  padding: 8px;
  max-width: 220px;
}

.feed-reel-pending-body strong {
  display: block;
  font-size: 14px;
  margin-bottom: 8px;
  text-transform: capitalize;
}

.feed-reel-pending-body p {
  margin: 0;
  font-size: 12px;
  line-height: 1.4;
  color: rgba(255, 255, 255, 0.82);
}

.feed-reel--link {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px 12px;
}

.feed-reel--link a {
  color: #fff;
  font-weight: 600;
  text-decoration: underline;
}

.feed-reel-badge {
  position: absolute;
  top: 10px;
  left: 10px;
  z-index: 2;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #fff;
  background: rgba(0, 0, 0, 0.45);
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: 999px;
  padding: 3px 8px;
  backdrop-filter: blur(4px);
}

.feed-reel-video {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  background: #000;
}

.feed-reel-iframe {
  display: block;
  width: 100%;
  height: 100%;
  border: 0;
  background: #000;
}

.feed-reel-open {
  position: absolute;
  right: 8px;
  bottom: 8px;
  z-index: 2;
  font-size: 11px;
  font-weight: 600;
  color: #fff;
  background: rgba(0, 0, 0, 0.55);
  border-radius: 999px;
  padding: 4px 8px;
  text-decoration: none;
}

.feed-reel-open:hover {
  background: rgba(0, 0, 0, 0.75);
}

.feed-reel-chooser {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 12px;
  background: var(--surface);
  border: 1px solid var(--border, #e5e7eb);
}

.feed-reel-chooser-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.feed-reel-chooser-hint {
  margin: 0;
  font-size: 12px;
}

.feed-reel-chooser-link {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.feed-reel-link-input {
  flex: 1;
  min-width: 180px;
  min-height: 32px;
  height: 32px;
  padding: 0 10px;
  border: 1px solid var(--border-strong, #8a8886);
  font: inherit;
  font-size: 13px;
}

.feed-reel-chooser-or {
  text-align: center;
  font-size: 12px;
  color: var(--muted);
  font-weight: 600;
}

.feed-post.vibe-party,
.feed-post.vibe-hype,
.feed-post.vibe-chill,
.feed-post.vibe-kudos,
.feed-post.vibe-meme,
.feed-post.vibe-hot_take,
.feed-post.vibe-appreciation,
.feed-post.vibe-focus,
.feed-post.vibe-roast {
  padding-left: 16px;
  padding-right: 16px;
  border-radius: 10px;
}

.feed-post.vibe-party {
  background: linear-gradient(180deg, #fff7ed 0%, var(--surface, #fff) 72px);
}

.feed-post.vibe-hype {
  background: linear-gradient(180deg, #eff6ff 0%, var(--surface, #fff) 72px);
}

.feed-post.vibe-chill {
  background: linear-gradient(180deg, #ecfdf5 0%, var(--surface, #fff) 72px);
}

.feed-post.vibe-kudos {
  background: linear-gradient(180deg, #fef9c3 0%, var(--surface, #fff) 72px);
}

.feed-post.vibe-meme {
  background: linear-gradient(180deg, #fce7f3 0%, var(--surface, #fff) 72px);
}

.feed-post.vibe-hot_take {
  background: linear-gradient(180deg, #fee2e2 0%, var(--surface, #fff) 72px);
}

.feed-post.vibe-appreciation {
  background: linear-gradient(180deg, #fdf2f8 0%, var(--surface, #fff) 72px);
}

.feed-post.vibe-focus {
  background: linear-gradient(180deg, #e0e7ff 0%, var(--surface, #fff) 72px);
}

.feed-post.vibe-roast {
  background: linear-gradient(180deg, #ffedd5 0%, var(--surface, #fff) 72px);
}

.feed-composer-preview {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 8px;
}

.feed-composer-preview img {
  max-width: 100%;
  max-height: 220px;
  border-radius: 8px;
  border: 1px solid var(--border, #e5e7eb);
  object-fit: contain;
  background: var(--surface);
}

.feed-post-image-link {
  display: block;
  margin: 0 0 10px;
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid var(--border, #e5e7eb);
  background: var(--surface-raised);
}

.feed-post-image {
  display: block;
  width: 100%;
  max-height: 360px;
  object-fit: contain;
  background: var(--surface-raised);
}

.feed-card {
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.feed-card .eh-card-head,
.feed-card .feed-composer,
.feed-card > .error,
.feed-card > .muted {
  flex-shrink: 0;
}

.feed-list {
  display: flex;
  flex-direction: column;
  gap: 14px;
  /* Grow with posts; scrollbar only after content gets large */
  max-height: min(90vh, 1400px);
  overflow-y: auto;
  overflow-x: hidden;
  padding: 2px 4px 8px 0;
  scrollbar-width: thin;
  scrollbar-color: #c8c6c4 transparent;
}

.feed-list::-webkit-scrollbar {
  width: 6px;
}

.feed-list::-webkit-scrollbar-track {
  background: transparent;
}

.feed-list::-webkit-scrollbar-thumb {
  background: #c8c6c4;
  border-radius: 999px;
}

.feed-list::-webkit-scrollbar-thumb:hover {
  background: #8a8886;
}

.feed-post {
  padding: 16px 16px 14px;
  border: 1px solid var(--border, #e5e7eb);
  border-radius: 10px;
  background: var(--surface, #fff);
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
}

.feed-post-head {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border, #eef0f3);
}

.feed-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 12px;
  font-weight: 700;
  color: #fff;
  background: linear-gradient(135deg, #005a9e, #2b88d8);
  flex-shrink: 0;
}

.feed-post-meta {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.feed-post-meta strong {
  font-size: 13px;
}

.feed-post-meta .muted {
  font-size: 11px;
}

.feed-reaction-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 8px;
}

.feed-reaction-chip-wrap {
  position: relative;
  display: inline-flex;
}

.feed-reaction-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--surface-hover);
  font-size: 12px;
  color: var(--text);
  cursor: default;
}

.feed-reaction-chip-wrap:hover .feed-reaction-chip,
.feed-reaction-chip-wrap:focus-within .feed-reaction-chip {
  background: var(--primary-soft);
  outline: 1px solid var(--primary);
}

.feed-reaction-who {
  display: none;
  position: absolute;
  left: 0;
  bottom: calc(100% + 6px);
  z-index: 40;
  min-width: 140px;
  max-width: 220px;
  padding: 8px 10px;
  background: #201f1e;
  color: #fff;
  border-radius: 4px;
  box-shadow: 0 8px 20px rgba(15, 23, 42, 0.25);
  pointer-events: none;
}

.feed-reaction-chip-wrap:hover .feed-reaction-who,
.feed-reaction-chip-wrap:focus-within .feed-reaction-who {
  display: block;
}

.feed-reaction-who strong {
  display: block;
  font-size: 11px;
  margin-bottom: 4px;
  font-weight: 700;
}

.feed-reaction-who ul {
  margin: 0;
  padding: 0;
  list-style: none;
}

.feed-reaction-who li {
  font-size: 12px;
  line-height: 1.35;
  padding: 1px 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.feed-reaction-who li.muted {
  color: var(--muted);
}

.feed-view-count-wrap {
  position: relative;
  margin-left: auto;
  cursor: default;
}

.feed-meta-count {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 12px;
  color: var(--muted);
  font-weight: 600;
  border: 0;
  background: transparent;
  padding: 0;
  font-family: inherit;
  line-height: 1.2;
}

.feed-meta-label {
  font-weight: 500;
}

.feed-comment-count {
  cursor: pointer;
  margin-left: auto;
}

.feed-comment-count:hover,
.feed-comment-count.is-open {
  color: var(--text);
}

.feed-view-count-wrap .feed-meta-count,
.feed-view-count-wrap .feed-view-count {
  margin-left: 0;
}

.feed-view-count {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 12px;
  color: var(--muted);
  font-weight: 600;
}

.feed-view-label {
  font-weight: 500;
}

.feed-view-who {
  display: none;
  position: absolute;
  right: 0;
  bottom: calc(100% + 6px);
  z-index: 40;
  min-width: 140px;
  max-width: 220px;
  padding: 8px 10px;
  background: #201f1e;
  color: #fff;
  border-radius: 4px;
  box-shadow: 0 8px 20px rgba(15, 23, 42, 0.25);
  pointer-events: none;
  text-align: left;
}

.feed-view-count-wrap:hover .feed-view-who,
.feed-view-count-wrap:focus-within .feed-view-who {
  display: block;
}

.feed-view-who strong {
  display: block;
  font-size: 11px;
  margin-bottom: 4px;
  font-weight: 700;
}

.feed-view-who ul {
  margin: 0;
  padding: 0;
  list-style: none;
}

.feed-view-who li {
  font-size: 12px;
  line-height: 1.35;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.feed-view-who li.muted {
  color: rgba(255, 255, 255, 0.65);
}

.feed-comments {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid var(--border);
}

.feed-comments-empty {
  margin: 0 0 8px;
  font-size: 13px;
}

.feed-comment-list {
  list-style: none;
  margin: 0 0 10px;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 280px;
  overflow-y: auto;
}

.feed-comment {
  display: flex;
  gap: 8px;
  align-items: flex-start;
}

.feed-comment-avatar {
  flex: 0 0 auto;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 10px;
  font-weight: 700;
  background: var(--surface-hover);
  color: var(--text);
}

.feed-comment-body {
  flex: 1 1 auto;
  min-width: 0;
  background: var(--surface-hover);
  border-radius: 10px;
  padding: 6px 10px;
}

.feed-comment-body p {
  margin: 2px 0 0;
  font-size: 13px;
  line-height: 1.4;
  white-space: pre-wrap;
  word-break: break-word;
}

.feed-comment-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 6px;
  font-size: 12px;
}

.feed-comment-meta strong {
  font-size: 12px;
}

.feed-comment-delete {
  margin-left: auto;
  border: 0;
  background: transparent;
  color: var(--muted);
  font-size: 11px;
  cursor: pointer;
  padding: 0;
}

.feed-comment-delete:hover:not(:disabled) {
  color: var(--danger, #b91c1c);
}

.feed-comment-form {
  display: flex;
  gap: 8px;
  align-items: center;
}

.feed-comment-input {
  flex: 1 1 auto;
  min-width: 0;
  height: 34px;
  padding: 0 10px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  color: var(--text);
  font-size: 13px;
}

.feed-comment-input:focus {
  outline: 2px solid var(--primary-soft);
  border-color: var(--primary);
}

.feed-post-actions {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px solid var(--border, #eef0f3);
}

.feed-react-wrap {
  position: relative;
}

.feed-react-count {
  cursor: pointer;
}

.feed-react-count:hover,
.feed-react-count.is-open,
.feed-react-count.is-active {
  color: var(--text);
}

.feed-emoji-picker {
  z-index: 90;
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 4px;
  padding: 10px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  box-shadow:
    0 2px 4px rgba(0, 0, 0, 0.06),
    0 12px 28px rgba(15, 23, 42, 0.16);
  animation: feed-emoji-in 0.14s ease-out;
}

@keyframes feed-emoji-in {
  from {
    opacity: 0;
    transform: translateY(4px) scale(0.96);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.feed-emoji-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  min-height: 52px;
  padding: 4px 2px;
  border: none;
  background: transparent;
  border-radius: 10px;
  cursor: pointer;
  line-height: 1;
  transition: background 0.12s ease, transform 0.12s ease;
}

.feed-emoji-glyph {
  font-size: 22px;
  line-height: 1;
  transition: transform 0.12s ease;
}

.feed-emoji-name {
  font-size: 9px;
  font-weight: 600;
  color: var(--muted);
  letter-spacing: 0.01em;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.feed-emoji-btn:hover {
  background: var(--primary-soft);
}

.feed-emoji-btn:hover .feed-emoji-glyph {
  transform: scale(1.22);
}

.feed-emoji-btn.selected {
  background: var(--primary-soft);
  box-shadow: inset 0 0 0 1px var(--primary);
}

.feed-emoji-btn.selected .feed-emoji-name {
  color: var(--primary-dark);
}

@media (max-width: 480px) {
  .feed-emoji-picker {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

/* ---------- Code / Git (Repositories) ---------- */
.code-panel {
  padding: 0;
  overflow: hidden;
}

.code-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 20px 8px;
}

.code-header h2 {
  margin: 0;
  font-size: 22px;
  font-weight: 700;
}

.code-repo-picker {
  display: flex;
  align-items: center;
  gap: 8px;
}

.code-repo-picker select {
  min-width: 180px;
}

.code-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  padding: 0 16px;
  border-bottom: 1px solid var(--border, #e5e7eb);
  background: var(--surface-raised);
}

.code-tab {
  border: none;
  background: transparent;
  padding: 12px 14px;
  font-size: 13px;
  font-weight: 600;
  color: var(--muted, #6b7280);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
}

.code-tab:hover:not(:disabled) {
  color: var(--text, #111827);
  background: rgba(0, 0, 0, 0.03);
}

.code-tab.active {
  color: var(--primary);
  border-bottom-color: var(--primary);
  background: var(--surface);
}

.code-tab:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.code-tab-body {
  padding: 18px 20px 24px;
}

.code-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
}

.code-empty {
  text-align: center;
  padding: 48px 20px;
  border: 1px dashed var(--border, #e5e7eb);
  border-radius: 8px;
  background: var(--surface-raised);
}

.code-empty-icon {
  font-size: 36px;
  margin-bottom: 8px;
}

.code-empty h3 {
  margin: 0 0 6px;
}

.code-empty p {
  margin: 0 0 16px;
}

.repo-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
}

.repo-card {
  border: 1px solid var(--border, #e5e7eb);
  border-radius: 8px;
  background: var(--surface);
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-height: 140px;
}

.repo-card-head {
  display: flex;
  align-items: center;
  gap: 10px;
}

.repo-ico {
  font-size: 18px;
  line-height: 1;
}

.repo-desc {
  margin: 0;
  font-size: 13px;
}

.repo-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.repo-meta .chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  border-radius: 999px;
  background: var(--surface-hover);
  border: 1px solid var(--border, #e5e7eb);
  font-size: 12px;
  color: var(--text);
  white-space: nowrap;
}

.repo-card-actions {
  margin-top: auto;
  padding-top: 4px;
  display: flex;
  gap: 8px;
}

.repo-card-actions .btn {
  user-select: none;
}

/* ---------- Code / Files browser ---------- */
.files-layout {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 0;
  min-height: 520px;
  border: 1px solid var(--border, #e5e7eb);
  border-radius: 8px;
  overflow: hidden;
  background: var(--surface);
}

.files-sidebar {
  border-right: 1px solid var(--border, #e5e7eb);
  background: var(--surface-raised);
  padding: 12px;
  display: flex;
  flex-direction: column;
  min-width: 0;
  max-height: 70vh;
  overflow: hidden;
}

.files-sidebar .field {
  margin-bottom: 10px;
}

.files-sidebar .field label {
  display: block;
  margin-bottom: 4px;
}

.files-sidebar .field select,
.files-sidebar .field .ss {
  width: 100%;
  max-width: 100%;
}

.files-content {
  min-width: 0;
  display: flex;
  flex-direction: column;
  background: var(--surface);
  max-height: 70vh;
  overflow: hidden;
}

.repo-tree {
  flex: 1;
  min-height: 0;
  overflow: auto;
  border: 1px solid var(--border, #e5e7eb);
  border-radius: 6px;
  background: var(--surface);
}

.tree-search {
  padding: 8px;
  border-bottom: 1px solid var(--border, #e5e7eb);
  background: var(--surface);
  position: sticky;
  top: 0;
  z-index: 1;
}

.tree-search input {
  width: 100%;
  box-sizing: border-box;
}

.tree-row {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 8px;
  cursor: pointer;
  font-size: 13px;
  line-height: 1.3;
  user-select: none;
}

.tree-row:hover {
  background: var(--surface-hover);
}

.tree-row.active {
  background: var(--primary-soft);
  color: var(--primary);
  font-weight: 600;
}

.tree-caret {
  width: 12px;
  font-size: 10px;
  color: var(--muted);
  flex-shrink: 0;
  transition: transform 0.12s ease;
}

.tree-caret.open {
  transform: rotate(90deg);
}

.tree-caret.placeholder {
  visibility: hidden;
}

.tree-ico {
  flex-shrink: 0;
  font-size: 14px;
  line-height: 1;
}

.tree-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.tree-loading {
  padding: 10px 12px;
  font-size: 12px;
  color: var(--muted, #6b7280);
}

.file-viewer {
  display: flex;
  flex-direction: column;
  height: 100%;
  min-height: 0;
}

.file-viewer.empty {
  align-items: center;
  justify-content: center;
  padding: 40px 20px;
}

.file-viewer-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 14px;
  border-bottom: 1px solid var(--border, #e5e7eb);
  background: var(--surface-raised);
  flex-shrink: 0;
}

.file-path {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 600;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.file-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.file-viewer-msg {
  padding: 24px 16px;
}

.code-scroll {
  flex: 1;
  min-height: 0;
  overflow: auto;
  background: var(--surface);
}

.clone-box {
  display: inline-block;
  margin-top: 8px;
  padding: 10px 14px;
  background: var(--surface-hover);
  border: 1px solid var(--border, #e5e7eb);
  border-radius: 6px;
  font-size: 13px;
}

.code-empty-setup {
  text-align: left;
  max-width: 720px;
  margin: 0 auto;
}

.code-empty-setup > .code-empty-icon,
.code-empty-setup > h3,
.code-empty-setup > p {
  text-align: center;
}

.clone-hints {
  margin-top: 8px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.clone-hints-intro {
  margin: 0 0 4px !important;
  text-align: center;
}

.clone-path-box {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
  width: 100%;
  box-sizing: border-box;
  word-break: break-all;
}

.clone-path-box code {
  font-size: 12px;
}

.clone-hint-block {
  border: 1px solid var(--border, #e5e7eb);
  border-radius: 8px;
  background: var(--surface);
  overflow: hidden;
  text-align: left;
}

.clone-hint-block-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 12px;
  background: var(--surface-raised);
  border-bottom: 1px solid var(--border, #e5e7eb);
}

.clone-hint-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
}

.clone-hint-pre {
  margin: 0;
  padding: 12px 14px;
  background: #111827;
  color: #e5e7eb;
  font-size: 12px;
  line-height: 1.55;
  overflow-x: auto;
  text-align: left;
}

.clone-hint-pre code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  white-space: pre;
}

.repo-clone-hint {
  margin: 0;
  font-size: 12px;
  line-height: 1.4;
}

@media (max-width: 900px) {
  .files-layout {
    grid-template-columns: 1fr;
    min-height: auto;
  }

  .files-sidebar {
    max-height: 280px;
    border-right: none;
    border-bottom: 1px solid var(--border, #e5e7eb);
  }

  .files-content {
    max-height: none;
  }
}

/* ---- Commits ---- */
.commits-layout {
  display: flex;
  gap: 14px;
  align-items: flex-start;
  min-height: 420px;
}
.commits-list-pane {
  flex: 1;
  min-width: 0;
}
.commits-toolbar {
  align-items: flex-end;
  flex-wrap: wrap;
}
.commits-search {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  flex: 1;
  min-width: 260px;
  justify-content: flex-end;
}
.commits-search input[type="search"] {
  font-family: Consolas, "Cascadia Mono", monospace;
  min-width: 180px;
}
.chip.add {
  background: #e6ffec;
  color: #1a7f37;
}
.chip.del {
  background: #ffebe9;
  color: #cf222e;
}
.section-title {
  margin: 14px 0 8px;
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
}

/* Full-width commit review (large code compare) */
.commit-review {
  display: flex;
  flex-direction: column;
  gap: 0;
  min-height: calc(100vh - 220px);
  border: 1px solid var(--border, #e5e7eb);
  border-radius: 8px;
  background: var(--surface);
  overflow: hidden;
}
.commit-review-bar {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border, #e5e7eb);
  background: var(--surface-raised);
}
.commit-review-meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  min-width: 0;
  flex: 1;
  font-size: 13px;
}
.commit-review-sha {
  font-size: 13px;
  font-weight: 600;
  color: var(--primary, #0078d4);
  background: var(--primary-soft);
  padding: 2px 8px;
  border-radius: 4px;
}
.commit-review-msg {
  font-weight: 600;
  color: var(--text);
  max-width: 420px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.commit-review-body {
  display: grid;
  grid-template-columns: 260px 1fr;
  flex: 1;
  min-height: 0;
  height: calc(100vh - 280px);
  min-height: 520px;
}
.commit-review-files {
  border-right: 1px solid var(--border, #e5e7eb);
  background: var(--surface);
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow: hidden;
}
.commit-review-files-head {
  padding: 10px 14px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
  border-bottom: 1px solid var(--border, #e5e7eb);
  background: var(--surface-raised);
}
.commit-file-list {
  list-style: none;
  margin: 0;
  padding: 6px;
  overflow: auto;
  flex: 1;
}
.commit-file-item {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 8px;
  width: 100%;
  text-align: left;
  border: none;
  background: transparent;
  padding: 8px 10px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 12px;
  color: var(--text);
}
.commit-file-item:hover {
  background: var(--surface-hover);
}
.commit-file-item.active {
  background: var(--primary-soft);
  box-shadow: inset 3px 0 0 var(--primary, #0078d4);
}
.commit-file-path {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-family: Consolas, "Cascadia Mono", monospace;
  font-size: 12px;
}
.commit-file-stats {
  display: flex;
  gap: 6px;
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
}
.commit-file-stats .add { color: #1a7f37; }
.commit-file-stats .del { color: #cf222e; }
.commit-review-diff {
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
  background: var(--surface);
  overflow: hidden;
}
.commit-review-diff-head {
  padding: 12px 16px 8px;
  border-bottom: 1px solid var(--border, #e5e7eb);
  flex-shrink: 0;
}
.commit-review-filepath {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.commit-review-filepath code {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
}
.commit-review-compare-hint {
  margin: 4px 0 0;
  font-size: 12px;
}
.commit-review-diff .diff-viewer-wrap {
  flex: 1;
  min-height: 0;
  border: none;
  border-radius: 0;
  display: flex;
  flex-direction: column;
}
.commit-review-diff .diff-viewer-wrap.large .diff-scroll,
.diff-scroll.large {
  max-height: none;
  flex: 1;
  min-height: 0;
  overflow: auto;
}
@media (max-width: 900px) {
  .commit-review-body {
    grid-template-columns: 1fr;
    height: auto;
    min-height: 0;
  }
  .commit-review-files {
    border-right: none;
    border-bottom: 1px solid var(--border, #e5e7eb);
    max-height: 180px;
  }
  .commit-review-diff .diff-scroll.large {
    max-height: 70vh;
  }
}

/* ---- Shared code tables ---- */
.code-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
  background: var(--surface);
  border: 1px solid var(--border, #e5e7eb);
  border-radius: 6px;
  overflow: hidden;
}
.code-table th,
.code-table td {
  padding: 8px 10px;
  border-bottom: 1px solid var(--border, #e5e7eb);
  text-align: left;
}
.code-table th {
  background: var(--surface-raised);
  font-weight: 600;
  color: var(--muted);
  font-size: 12px;
}
.code-table.clickable tbody tr {
  cursor: pointer;
}
.code-table tbody tr:hover {
  background: var(--surface-raised);
}
.code-table tbody tr.active {
  background: var(--primary-soft);
}
.code-table.compact td,
.code-table.compact th {
  padding: 6px 8px;
}
.code-table .add {
  color: #1a7f37;
  font-weight: 600;
}
.code-table .del {
  color: #cf222e;
  font-weight: 600;
}
.sha-link {
  color: var(--primary, #0078d4);
  font-weight: 600;
}
.commit-msg {
  max-width: 320px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.nowrap {
  white-space: nowrap;
}

/* ---- Branches ---- */
.branch-name {
  font-weight: 600;
  margin-right: 6px;
}
.default-badge {
  font-size: 10px;
  vertical-align: middle;
}
.branch-commit-msg {
  font-size: 11px;
  color: var(--muted, #6b7280);
  max-width: 200px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.branch-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}
.btn.secondary.small.danger {
  color: #cf222e;
  border-color: #ffc1c0;
}
.btn.secondary.small.danger:hover {
  background: #ffebe9;
}

/* ---- Merge conflict resolve ---- */
.merge-resolve {
  border: 1px solid var(--border, #e5e7eb);
  border-radius: 8px;
  background: var(--surface);
  padding: 14px 16px 16px;
  min-height: calc(100vh - 240px);
  display: flex;
  flex-direction: column;
}
.merge-resolve-bar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}
.merge-resolve-title h3 {
  margin: 0 0 4px;
  font-size: 16px;
  color: var(--text);
}
.merge-resolve-title p {
  margin: 0;
  font-size: 13px;
}
.merge-resolve-actions {
  display: flex;
  gap: 8px;
  flex-shrink: 0;
}
.merge-resolve-ready {
  border: 1px solid #abf2bc;
  background: #e6ffec;
  border-radius: 6px;
  padding: 16px 18px;
  color: #1a7f37;
  font-size: 14px;
}
.merge-resolve-body {
  display: grid;
  grid-template-columns: 240px 1fr;
  gap: 0;
  flex: 1;
  min-height: 480px;
  border: 1px solid var(--border, #e5e7eb);
  border-radius: 6px;
  overflow: hidden;
}
.merge-resolve-files {
  border-right: 1px solid var(--border, #e5e7eb);
  background: var(--surface-raised);
  display: flex;
  flex-direction: column;
  min-height: 0;
}
.merge-resolve-files-head {
  padding: 10px 12px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
  border-bottom: 1px solid var(--border, #e5e7eb);
}
.merge-file-list {
  list-style: none;
  margin: 0;
  padding: 6px;
  overflow: auto;
  flex: 1;
}
.merge-file-item {
  display: block;
  width: 100%;
  text-align: left;
  border: none;
  background: transparent;
  padding: 8px 10px;
  border-radius: 6px;
  cursor: pointer;
  margin-bottom: 2px;
}
.merge-file-item code {
  font-size: 12px;
  word-break: break-all;
  color: var(--text);
}
.merge-file-item:hover {
  background: var(--surface-hover);
}
.merge-file-item.active {
  background: #ffebe9;
  box-shadow: inset 3px 0 0 #cf222e;
}
.merge-resolve-editor {
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
  background: var(--surface);
  padding: 12px;
}
.merge-editor-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 6px;
}
.merge-editor-path {
  font-size: 13px;
  font-weight: 600;
}
.merge-editor-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.merge-editor-hint {
  font-size: 12px;
  margin: 0 0 8px;
}
.merge-conflict-textarea {
  flex: 1;
  min-height: 360px;
  width: 100%;
  resize: vertical;
  font-family: Consolas, "Cascadia Mono", "Courier New", monospace;
  font-size: 13px;
  line-height: 1.5;
  padding: 12px;
  border: 1px solid var(--border, #e5e7eb);
  border-radius: 6px;
  background: var(--surface-raised);
  color: var(--text);
  white-space: pre;
  overflow: auto;
  tab-size: 2;
}
@media (max-width: 900px) {
  .merge-resolve-body {
    grid-template-columns: 1fr;
    min-height: 0;
  }
  .merge-resolve-files {
    border-right: none;
    border-bottom: 1px solid var(--border, #e5e7eb);
    max-height: 160px;
  }
}

/* ---- Compare ---- */
.compare-layout {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.compare-bar {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}
.compare-selects {
  display: flex;
  align-items: flex-end;
  gap: 10px;
  flex-wrap: wrap;
}
.compare-arrow {
  color: var(--muted, #6b7280);
  font-size: 18px;
  padding-bottom: 8px;
}
.compare-summary {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.compare-body {
  display: flex;
  gap: 14px;
  align-items: flex-start;
  min-height: 400px;
}
.compare-files {
  flex: 0 0 340px;
  min-width: 0;
}
.compare-diff-pane {
  flex: 1;
  min-width: 0;
  border: 1px solid var(--border, #e5e7eb);
  border-radius: 6px;
  padding: 12px;
  background: var(--surface);
  max-height: 72vh;
  overflow: auto;
}
.status-pill {
  font-size: 10px;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 4px;
  text-transform: uppercase;
}
.status-A { background: #e6ffec; color: #1a7f37; }
.status-M { background: #fff8c5; color: #9a6700; }
.status-D { background: #ffebe9; color: #cf222e; }
.status-R { background: var(--primary-soft); color: #0969da; }

/* ---- Diff viewer ---- */
.diff-viewer-wrap {
  border: 1px solid var(--border, #e5e7eb);
  border-radius: 6px;
  overflow: hidden;
}
.diff-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 10px;
  background: var(--surface-raised);
  border-bottom: 1px solid var(--border, #e5e7eb);
}
.diff-view-toggle {
  display: flex;
  gap: 4px;
}
.diff-view-toggle .btn.active {
  background: var(--primary, #0078d4);
  color: #fff;
  border-color: var(--primary, #0078d4);
}
.diff-scroll {
  max-height: 60vh;
  overflow: auto;
}
.diff-viewer-wrap.large {
  display: flex;
  flex-direction: column;
  min-height: 0;
  height: 100%;
}
.diff-scroll.large {
  max-height: none;
  flex: 1;
  min-height: 420px;
  overflow: auto;
}
.diff-viewer-msg {
  padding: 20px;
  text-align: center;
}

/* ---- Pull Requests ---- */
.pr-layout {
  display: flex;
  gap: 14px;
  align-items: flex-start;
  min-height: 420px;
}
.pr-list-pane {
  flex: 1;
  min-width: 0;
}
.pr-detail-pane {
  flex: 0 0 380px;
  border: 1px solid var(--border, #e5e7eb);
  border-radius: 6px;
  padding: 14px;
  background: var(--surface);
  max-height: 72vh;
  overflow: auto;
}
.pr-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}
.pr-filters .btn.active {
  background: var(--primary, #0078d4);
  color: #fff;
  border-color: var(--primary, #0078d4);
}
.pr-title {
  font-weight: 600;
}
.pr-status {
  display: inline-block;
  font-size: 10px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 10px;
  text-transform: uppercase;
}
.pr-open { background: var(--primary-soft); color: #0969da; }
.pr-approved { background: #e6ffec; color: #1a7f37; }
.pr-rejected { background: #ffebe9; color: #cf222e; }
.pr-merged { background: #f3e8ff; color: #8250df; }
.pr-closed { background: #f0f2f5; color: var(--muted); }
.pr-detail-head {
  margin-bottom: 12px;
}
.pr-detail-title {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
}
.pr-detail-title h3 {
  margin: 0;
  font-size: 16px;
  font-weight: 600;
  color: var(--text);
}
.pr-branch-line {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
}
.pr-meta-grid {
  display: grid;
  gap: 8px;
  font-size: 12px;
  margin-bottom: 12px;
}
.pr-reviews {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.pr-review-item {
  border: 1px solid var(--border, #e5e7eb);
  border-radius: 6px;
  padding: 8px 10px;
  background: var(--surface-raised);
  font-size: 13px;
}
.pr-review-head {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 4px;
}
.pr-actions {
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--border, #e5e7eb);
}
.pr-action-btns {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 8px;
}
.pr-form-row {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}
.pr-form-row .field {
  flex: 1;
  min-width: 180px;
}

.pr-azure-page {
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-height: 480px;
}
.pr-azure-head {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}
.pr-azure-head h3 {
  margin: 0;
  font-size: 18px;
}
.pr-azure-tabs {
  display: flex;
  gap: 0;
  border-bottom: 1px solid var(--border, #e5e7eb);
}
.pr-azure-summary {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  min-height: 28px;
}
.pr-conflict-banner {
  padding: 10px 12px;
  border-radius: 6px;
}
.pr-conflict-banner p {
  margin: 6px 0 0;
  font-size: 13px;
}
.pr-conflict-banner ul {
  margin: 8px 0 0;
  padding-left: 18px;
  font-size: 12px;
}
.pr-azure-body {
  display: flex;
  gap: 0;
  align-items: stretch;
  min-height: 420px;
  flex: 1;
  border: 1px solid var(--border, #e5e7eb);
  border-radius: 0 0 6px 6px;
  overflow: hidden;
  background: var(--surface);
}

/* ---- Azure-style New Pull Request ---- */
.ado-pr-create {
  display: flex;
  flex-direction: column;
  margin: -18px -20px -24px;
  min-height: calc(100vh - 168px);
  background: #f8f9fa;
}
.ado-pr-create-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 18px;
  background: #fff;
  border-bottom: 1px solid var(--border, #e5e7eb);
}
.ado-pr-create-bar-left {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}
.ado-pr-create-bar-left h3 {
  margin: 0;
  font-size: 18px;
  font-weight: 600;
  color: #24292f;
}
.ado-pr-create-repo {
  margin: 0;
  font-size: 12px;
}
.ado-pr-create-icon {
  font-size: 22px;
  color: #0078d4;
  flex-shrink: 0;
}
.ado-pr-create-bar-actions {
  display: flex;
  gap: 8px;
  flex-shrink: 0;
}
.ado-pr-branch-bar {
  display: flex;
  align-items: flex-end;
  flex-wrap: wrap;
  gap: 10px 12px;
  padding: 12px 18px;
  background: #fff;
  border-bottom: 1px solid var(--border, #e5e7eb);
}
.ado-pr-branch-pick {
  min-width: 220px;
  flex: 0 1 260px;
}
.ado-pr-branch-pick .ss-control {
  background: #fff;
  border: 1px solid #8a8886;
  min-height: 32px;
}
.ado-pr-branch-label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  font-weight: 600;
  color: #605e5c;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 4px;
}
.ado-pr-into {
  align-self: center;
  padding-top: 18px;
  font-size: 12px;
  font-weight: 600;
  color: #605e5c;
}
.ado-pr-swap {
  align-self: center;
  margin-top: 14px;
}
.ado-pr-branch-meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-left: auto;
  padding: 6px 0 2px;
  font-size: 13px;
  color: #323130;
}
.ado-pr-dot {
  color: #8a8886;
}
.ado-pr-banner {
  margin: 0 18px;
  margin-top: 10px;
}
.ado-pr-conflict {
  margin: 10px 18px 0;
  padding: 12px 14px;
  border-radius: 4px;
  background: #fff4ce;
  border: 1px solid #f3d54e;
  color: #323130;
}
.ado-pr-conflict strong {
  color: #5c4400;
}
.ado-pr-conflict p {
  margin: 6px 0 0;
  font-size: 13px;
}
.ado-pr-conflict ul {
  margin: 8px 0 0;
  padding-left: 18px;
  font-size: 12px;
}
.ado-pr-conflict-note {
  font-weight: 600;
}
.ado-pr-empty-merge {
  margin: 10px 18px 0;
  padding: 10px 14px;
  background: #fff;
  border: 1px solid var(--border, #e5e7eb);
  border-radius: 4px;
  font-size: 13px;
  color: #605e5c;
}
.ado-pr-create-body {
  display: flex;
  flex-direction: column;
  padding: 14px 18px 18px;
  flex: 1;
  min-height: 0;
}
.ado-pr-create-main {
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
  flex: 1;
  background: #fff;
  border: 1px solid var(--border, #e5e7eb);
  border-radius: 6px;
  overflow: hidden;
}
.ado-pr-fields {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 14px 16px 8px;
}
.ado-pr-description {
  min-height: 88px;
  resize: vertical;
}
.ado-pr-tabs {
  display: flex;
  gap: 0;
  padding: 0 12px;
  border-bottom: 1px solid var(--border, #e5e7eb);
  background: #fff;
}
.ado-pr-tab {
  border: none;
  background: transparent;
  padding: 10px 14px;
  font-size: 13px;
  font-weight: 600;
  color: #605e5c;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.ado-pr-tab:hover {
  color: #323130;
}
.ado-pr-tab.active {
  color: #0078d4;
  border-bottom-color: #0078d4;
}
.ado-pr-tab-count {
  font-size: 11px;
  font-weight: 700;
  background: #eff6fc;
  color: #0078d4;
  border-radius: 10px;
  padding: 1px 7px;
}
.ado-pr-create-diff {
  flex: 1;
  min-height: 360px;
  display: flex;
  flex-direction: column;
}
.ado-pr-create-diff .pr-azure-body {
  flex: 1;
  min-height: 360px;
  border: none;
  border-top: 1px solid var(--border, #e5e7eb);
  border-radius: 0;
}
.ado-pr-diff-loading {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 280px;
}
.ado-pr-session-hint {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  margin-bottom: 8px;
  background: #f8fafc;
  border: 1px solid var(--border, #e5e7eb);
  border-radius: 6px;
  font-size: 13px;
}
.ado-pr-reviewers-field {
  max-width: 560px;
}
.ado-pr-reviewers-field .sms {
  width: 100%;
}
.ado-pr-side-hint {
  margin: 10px 0 0;
  font-size: 12px;
  line-height: 1.45;
}
@media (max-width: 980px) {
  .ado-pr-create-body {
    padding: 12px;
  }
}
.pr-change-tree {
  flex: 0 0 300px;
  min-width: 0;
  border: 1px solid var(--border, #e5e7eb);
  border-radius: 6px;
  background: var(--surface);
  max-height: 72vh;
  overflow: auto;
}
.pr-azure-body .pr-change-tree {
  max-height: none;
  border: none;
  border-right: 1px solid var(--border, #e5e7eb);
  border-radius: 0;
}
.pr-azure-body .pr-commit-list {
  max-height: none;
  flex: 0 0 340px;
  overflow: auto;
  border-right: 1px solid var(--border, #e5e7eb);
}
.pr-azure-body .compare-diff-pane {
  max-height: none;
  border: none;
  border-radius: 0;
}
.pr-change-tree-head {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  padding: 8px 10px;
  font-size: 12px;
  font-weight: 600;
  border-bottom: 1px solid var(--border, #e5e7eb);
  background: var(--surface-raised);
}
.pr-folder-count {
  margin-left: auto;
  font-size: 11px;
}
.pr-file-row .tree-name {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.pr-file-stats {
  display: flex;
  gap: 6px;
  font-size: 11px;
  font-variant-numeric: tabular-nums;
  flex-shrink: 0;
}
.pr-file-stats .add { color: #1a7f37; }
.pr-file-stats .del { color: #cf222e; }
.pr-commit-list {
  flex: 0 0 340px;
  min-width: 0;
  max-height: 72vh;
  overflow: auto;
}
.pr-commit-files {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-bottom: 12px;
}
.pr-commit-file {
  display: flex;
  align-items: center;
  gap: 8px;
  text-align: left;
  border: 1px solid var(--border, #e5e7eb);
  background: var(--surface);
  border-radius: 4px;
  padding: 6px 8px;
  cursor: pointer;
  font-size: 12px;
}
.pr-commit-file.active,
.pr-commit-file:hover {
  border-color: var(--primary, #0078d4);
  background: var(--primary-soft);
}
.ado-pr-tab-conflict.active {
  color: #a4262c;
  border-bottom-color: #a4262c;
}
.ado-pr-conflict-pill {
  color: #a4262c;
  font-weight: 600;
}
.status-C { background: #ffebe9; color: #cf222e; }

/* ---- Statistics ---- */
.stats-layout {
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.stat-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 12px;
}
.stat-card {
  border: 1px solid var(--border, #e5e7eb);
  border-radius: 6px;
  padding: 14px;
  background: var(--surface);
}
.stat-card-label {
  font-size: 11px;
  color: var(--muted, #6b7280);
  margin-bottom: 4px;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}
.stat-card-value {
  font-size: 22px;
  font-weight: 700;
  color: var(--text);
}
.stat-card-sub {
  font-size: 11px;
  margin-top: 2px;
}
.stats-panels {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 14px;
}
.stats-panel {
  border: 1px solid var(--border, #e5e7eb);
  border-radius: 6px;
  padding: 14px;
  background: var(--surface);
}
.latest-commit-box,
.active-dev-box {
  font-size: 13px;
}
.active-dev-name {
  font-size: 18px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 4px;
}
.stat-chart-label {
  font-size: 12px;
  color: var(--muted, #6b7280);
  margin-bottom: 10px;
}
.stat-bars {
  display: flex;
  align-items: flex-end;
  gap: 6px;
  height: 140px;
  padding-top: 8px;
}
.stat-bar-col {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  height: 100%;
  justify-content: flex-end;
  min-width: 0;
}
.stat-bar {
  width: 100%;
  max-width: 36px;
  background: var(--primary, #0078d4);
  border-radius: 3px 3px 0 0;
  min-height: 4px;
  transition: height 0.2s;
}
.stat-bar-x {
  font-size: 9px;
  color: var(--muted, #6b7280);
  margin-top: 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}
.contrib-bar-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
}
.contrib-bar-wrap span {
  font-size: 11px;
  color: var(--muted, #6b7280);
  min-width: 32px;
}
.contrib-bar {
  height: 8px;
  background: var(--primary, #0078d4);
  border-radius: 4px;
  min-width: 4px;
  max-width: 120px;
}

/* ===== Resource Management enterprise UI ===== */
.panel-header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.export-btns {
  display: inline-flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}

.export-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-width: 88px;
  min-height: 34px;
  height: 34px;
  padding: 0 12px;
  border-radius: 4px;
  border: 1px solid transparent;
  font-size: 13px;
  font-weight: 600;
  color: #323130;
  background: #fff;
  cursor: pointer;
  white-space: nowrap;
}

.export-btn svg {
  flex-shrink: 0;
}

.export-btn--excel {
  background: #e8f5e9;
  border-color: #c8e6c9;
}

.export-btn--excel svg {
  color: #2e7d32;
}

.export-btn--csv {
  background: #e3f2fd;
  border-color: #bbdefb;
}

.export-btn--csv svg {
  color: #1565c0;
}

.export-btn--pdf {
  background: #fdecea;
  border-color: #f5c6cb;
}

.export-btn--pdf svg {
  color: #c62828;
}

.export-btn--print {
  background: #f3e8fd;
  border-color: #e1bee7;
}

.export-btn--print svg {
  color: #7b1fa2;
}

.export-btn:hover:not(:disabled) {
  filter: brightness(0.97);
}

.export-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.panel-header-actions .btn,
.topbar .btn,
.toolbar .btn {
  min-height: 32px;
  height: 32px;
}

.rm-page .cards {
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
}

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

.rm-kpi-hint {
  margin-top: 4px;
  font-size: 11px;
}

.rm-band {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 600;
}

.rm-band-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: currentColor;
}

.rm-band-green { color: #166534; }
.rm-band-yellow { color: #a16207; }
.rm-band-orange { color: #c2410c; }
.rm-band-red { color: #991b1b; }

.pill.blue { background: var(--primary-soft); color: #1e40af; }
.pill.neutral { background: var(--surface-hover); color: var(--text); }

.rm-flash {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 8px 0 12px;
  padding: 10px 14px;
  border-radius: 10px;
  font-size: 13px;
}

.rm-flash-success {
  background: #ecfdf5;
  border: 1px solid #a7f3d0;
  color: #065f46;
}

.rm-flash-error {
  background: #fef2f2;
  border: 1px solid #fecaca;
  color: #991b1b;
}

.rm-flash-close {
  border: none;
  background: transparent;
  cursor: pointer;
  font-size: 18px;
  line-height: 1;
  color: inherit;
}

.rm-column-chooser {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 14px;
  padding: 10px 12px;
  margin-bottom: 10px;
  background: var(--surface-raised);
  border: 1px solid var(--border);
  border-radius: 4px;
}

.rm-column-chooser-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  cursor: pointer;
}

.rm-skeleton {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 8px 0;
}

.rm-skeleton-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(80px, 1fr));
  gap: 10px;
}

.rm-skeleton-cell {
  height: 14px;
  border-radius: 4px;
  background: linear-gradient(90deg, var(--surface-hover) 25%, var(--bg) 50%, var(--surface-hover) 75%);
  background-size: 200% 100%;
  animation: rm-shimmer 1.2s ease-in-out infinite;
}

@keyframes rm-shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

.rm-empty {
  text-align: center;
  padding: 28px 12px;
}

.rm-empty-title {
  font-weight: 600;
  margin-bottom: 4px;
}

.table-scroll {
  overflow: auto;
  max-height: calc(100vh - 240px);
  border: 1px solid var(--border, #e5e7eb);
  border-radius: 4px;
  background: var(--surface, #fff);
}

.table-scroll--sticky thead th {
  position: sticky;
  top: 0;
  z-index: 3;
  background: var(--surface, #fff);
  box-shadow: inset 0 -1px 0 var(--border, #e5e7eb);
}

.table-scroll td.pm-col-sticky,
.table-scroll th.pm-col-sticky {
  position: sticky !important;
  z-index: 4;
  background: var(--surface, #fff) !important;
  box-shadow: 2px 0 6px rgba(15, 23, 42, 0.08);
  white-space: nowrap;
  max-width: 220px;
  overflow: hidden;
  text-overflow: ellipsis;
}

.table-scroll--sticky thead th.pm-col-sticky {
  z-index: 6;
  top: 0;
  background: var(--surface, #fff) !important;
}

.table-scroll tbody tr:nth-child(even) td.pm-col-sticky {
  background: var(--surface-muted, #f8fafc) !important;
}

.table-scroll tbody tr:hover td.pm-col-sticky {
  background: var(--surface-hover, #f3f2f1) !important;
}

.pm-report-table--sticky-cols {
  border-collapse: separate;
  border-spacing: 0;
  min-width: max-content;
}

html[data-theme="dark"] .table-scroll td.pm-col-sticky,
html[data-theme="dark"] .table-scroll th.pm-col-sticky,
html[data-theme="dark"] .table-scroll--sticky thead th.pm-col-sticky {
  background: var(--surface-raised, #182235) !important;
}

html[data-theme="dark"] .table-scroll tbody tr:nth-child(even) td.pm-col-sticky {
  background: var(--surface, #111827) !important;
}

.pm-link-stack {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 120px;
}

.pm-link-stack a {
  white-space: nowrap;
}

.sortable-th {
  cursor: pointer;
  user-select: none;
  white-space: nowrap;
}

.sortable-th:hover {
  color: var(--primary-darker, #005a9e);
  background: var(--primary-soft);
}

.sortable-th.sorted {
  color: var(--primary-darker, #005a9e);
}

.sortable-th-ind {
  font-size: 11px;
  opacity: 0.85;
}

.rm-row-actions {
  white-space: nowrap;
  display: inline-flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}

.mytasks-row-actions {
  flex-wrap: nowrap;
  min-width: 72px;
}

.rm-list {
  margin: 0 0 12px;
  padding-left: 18px;
}

.rm-cal-legend {
  margin: 0 0 10px;
  font-size: 13px;
}

.rm-calendar {
  display: grid;
  grid-template-columns: repeat(7, minmax(96px, 1fr));
  gap: 8px;
  max-width: 860px;
  width: 100%;
}

.rm-cal-cell {
  min-height: 92px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: flex-start;
  gap: 4px;
  padding: 10px;
  font-size: 13px;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: var(--surface);
  line-height: 1.3;
}

.rm-cal-day {
  font-weight: 700;
  font-size: 16px;
  margin-bottom: 2px;
}

.rm-cal-hours {
  font-size: 13px;
  opacity: 0.95;
}

.rm-cal-hours-avail {
  font-weight: 600;
}

.rm-cal-hours-leave {
  font-weight: 600;
  color: #92400e;
}

.rm-cal-weekend { background: var(--surface-hover); color: var(--muted); }
.rm-cal-allocated { background: var(--primary-soft); color: #1e40af; }
.rm-cal-available { background: #dcfce7; color: #166534; }
.rm-cal-leave { background: #fef3c7; color: #92400e; }

@media (max-width: 1100px) {
  .rm-exec .cards,
  .pm-exec .cards {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 768px) {
  .rm-page .cards {
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  }
  .rm-exec .cards,
  .pm-exec .cards {
    grid-template-columns: 1fr;
  }
  .panel-header-actions {
    width: 100%;
  }
  .ra-filters-row {
    flex-direction: column;
    align-items: stretch;
  }
}

@media print {
  .sidebar, .topbar, .toolbar, .panel-header-actions, .ra-filters, .export-btns, .export-btn, .btn {
    display: none !important;
  }
  .content { padding: 0; background: #fff; }
  .panel { border: none; box-shadow: none; }
}

/* ===== RM Charts & Executive Dashboard ===== */
.rm-exec-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}

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

.rm-chart-card h3 {
  font-weight: 600;
  color: var(--text, #323130);
}

.rm-chart-body {
  padding: 4px 4px 8px;
  min-height: 180px;
}

.rm-chart-empty {
  padding: 24px 8px;
  text-align: center;
}

.rm-hbar {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.rm-hbar-row {
  display: grid;
  grid-template-columns: minmax(80px, 140px) 1fr 48px;
  gap: 8px;
  align-items: center;
}

.rm-hbar-label {
  font-size: 12px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.rm-hbar-track {
  height: 10px;
  background: var(--surface-hover);
  border-radius: 4px;
  overflow: hidden;
}

.rm-hbar-fill {
  height: 100%;
  border-radius: 4px;
  transition: width 0.35s ease;
}

.rm-hbar-value {
  font-size: 12px;
  font-weight: 600;
  text-align: right;
}

.rm-vbar {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  padding-top: 8px;
}

.rm-vbar-col {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  height: 100%;
  min-width: 0;
}

.rm-vbar-track {
  flex: 1;
  width: 100%;
  max-width: 36px;
  background: var(--surface-hover);
  border-radius: 4px 4px 0 0;
  display: flex;
  align-items: flex-end;
  overflow: hidden;
}

.rm-vbar-fill {
  width: 100%;
  border-radius: 4px 4px 0 0;
  transition: height 0.35s ease;
}

.rm-vbar-value {
  font-size: 10px;
  font-weight: 600;
  margin-bottom: 4px;
}

.rm-vbar-label {
  font-size: 10px;
  color: var(--muted);
  margin-top: 4px;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.rm-pie-wrap {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
  justify-content: center;
}

.rm-pie-center {
  font-size: 16px;
  font-weight: 700;
  fill: #323130;
}

.rm-pie-legend {
  list-style: none;
  margin: 0;
  padding: 0;
  min-width: 160px;
}

.rm-pie-legend li {
  display: grid;
  grid-template-columns: 12px 1fr auto;
  gap: 8px;
  align-items: center;
  font-size: 12px;
  margin-bottom: 6px;
}

.rm-legend-swatch {
  width: 10px;
  height: 10px;
  border-radius: 2px;
}

.rm-legend-value {
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

.rm-line-wrap {
  width: 100%;
}

.rm-line {
  width: 100%;
  height: 200px;
  display: block;
}

.rm-line-grid {
  stroke: #edebe9;
  stroke-width: 1;
}

.rm-line-xlabel {
  font-size: 10px;
  fill: #605e5c;
}

.rm-quick-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 4px 0 8px;
}

@media (max-width: 960px) {
  .rm-chart-grid {
    grid-template-columns: 1fr;
  }
  .rm-hbar-row {
    grid-template-columns: minmax(60px, 100px) 1fr 40px;
  }
}

/* ===== RM Enterprise Reports ===== */
.rm-report-hub {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 14px;
  margin-top: 12px;
}

.rm-report-card {
  text-decoration: none;
  color: inherit;
  display: block;
}

.rm-report-card-title {
  font-weight: 600;
  font-size: 15px;
  margin-bottom: 6px;
}

.rm-pager {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 12px 4px 4px;
  flex-wrap: wrap;
}

.rm-pager-btns {
  display: flex;
  gap: 8px;
}

.rm-report .ra-filters-row .field select,
.rm-report .ra-filters-row .field .ss {
  min-width: 100px;
}

/* ===== Work Item Queries (Azure DevOps style) ===== */
.wiq-page { display: flex; flex-direction: column; gap: 12px; }
.wiq-toolbar-panel { padding-bottom: 0; }
.wiq-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 8px;
}
.wiq-toolbar-left { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; }
.wiq-toolbar-right { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.wiq-name {
  border: 1px solid transparent;
  border-radius: 4px;
  padding: 4px 8px;
  font-size: 16px;
  font-weight: 600;
  min-width: 180px;
  background: transparent;
}
.wiq-name:hover, .wiq-name:focus {
  border-color: var(--border, #edebe9);
  background: var(--surface);
  outline: none;
}
.wiq-check {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: var(--muted, #605e5c);
}
.wiq-tabs {
  display: flex;
  gap: 0;
  border-bottom: 1px solid var(--border, #edebe9);
  margin: 0 -24px;
  padding: 0 24px;
}
.wiq-tab {
  border: none;
  background: transparent;
  padding: 10px 16px;
  cursor: pointer;
  color: var(--muted, #605e5c);
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  font-weight: 500;
}
.wiq-tab.active {
  color: var(--primary);
  border-bottom-color: var(--primary);
}
.wiq-editor-panel { padding-top: 16px; }
.wiq-editor-title { margin: 0 0 14px; font-size: 15px; font-weight: 600; }
.wiq-clause-builder {
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
  background: var(--surface);
}
.wiq-clause-head,
.wiq-clause-row {
  display: grid;
  grid-template-columns: 72px 96px minmax(150px, 1.1fr) minmax(130px, 0.9fr) minmax(180px, 1.3fr);
  gap: 10px;
  align-items: center;
  padding: 0 12px;
}
.wiq-clause-head {
  min-height: 36px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
  background: var(--surface-hover);
  border-bottom: 1px solid var(--border);
}
.wiq-clause-row {
  min-height: 52px;
  border-bottom: 1px solid var(--border);
}
.wiq-clause-row:last-child { border-bottom: none; }
.wiq-clause-actions {
  display: flex;
  gap: 6px;
  align-items: center;
}
.wiq-icon-btn {
  width: 32px;
  height: 32px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--surface);
  color: var(--text);
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.wiq-icon-btn:hover:not(:disabled) {
  background: var(--surface-hover);
  border-color: var(--primary);
}
.wiq-icon-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}
.wiq-icon-btn-danger {
  color: #fff;
  background: #c50f1f;
  border-color: #c50f1f;
}
.wiq-icon-btn-danger:hover:not(:disabled) {
  background: #a4262c;
  border-color: #a4262c;
}
.wiq-clause-dash { display: inline-block; padding-left: 4px; }
.wiq-clause-select,
.wiq-clause-select .ss-control,
.wiq-clause-input,
.wiq-clause-row input[type="number"],
.wiq-clause-row input[type="text"]:not(.wiq-date-input) {
  width: 100%;
  min-width: 0;
  height: 36px;
  padding: 6px 10px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--surface);
  font-size: 13px;
}
.wiq-clause-select.ss,
.wiq-clause-row .ss {
  width: 100%;
  min-width: 0;
}
.wiq-clause-select.ss {
  height: auto;
  padding: 0;
  border: none;
  background: transparent;
}
.wiq-clause-value .search-select,
.wiq-clause-value .ss { width: 100%; }
.wiq-date-value {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.wiq-date-input {
  width: 100%;
  height: 36px;
  padding: 6px 10px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--surface);
  font-size: 13px;
}
.wiq-add-clause { margin-top: 12px; }
.wiq-clause-table select,
.wiq-clause-table input {
  width: 100%;
  min-width: 120px;
}
.wiq-chart { display: flex; flex-direction: column; gap: 10px; max-width: 560px; }
.wiq-chart-row { display: grid; grid-template-columns: 120px 1fr 40px; gap: 10px; align-items: center; }
.wiq-chart-label { font-size: 13px; }
.wiq-chart-bar-wrap { background: var(--surface-hover); height: 18px; border-radius: 3px; overflow: hidden; }
.wiq-chart-bar { height: 100%; border-radius: 3px; min-width: 2px; }
.wiq-chart-count { text-align: right; font-weight: 600; font-size: 13px; }
.wiq-title-link {
  font-size: inherit;
  font-weight: 600;
  text-align: left;
  padding: 0;
  color: var(--primary);
}
.wiq-title-link:hover {
  text-decoration: underline;
}
.panel.success {
  background: #dff6dd;
  color: #0b6a0b;
  border: 1px solid #9fd89f;
  padding: 10px 14px;
}

/* ===== User Stories Kanban board ===== */
.us-board-page { display: flex; flex-direction: column; gap: 12px; min-height: 0; }
.us-board-header { padding: 0; margin-bottom: 4px; }
.us-board-cols {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  overflow-x: auto;
  padding-bottom: 12px;
  min-height: 420px;
}
.us-board-col {
  flex: 0 0 280px;
  min-width: 280px;
  max-width: 300px;
  background: var(--surface-hover, #f3f2f1);
  border: 1px solid var(--border, #edebe9);
  border-radius: 8px;
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: calc(100vh - 220px);
}
.us-board-col-head {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  padding: 2px 2px 6px;
}
.us-board-col-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}
.us-board-col-count { margin-left: auto; font-size: 12px; }
.us-board-col-count.over-wip { color: #c50f1f; font-weight: 700; }
.us-board-quick-add { margin-bottom: 2px; }
.us-board-new-link {
  width: 100%;
  text-align: left;
  border: 1px dashed var(--border, #c8c6c4);
  background: transparent;
  border-radius: 6px;
  padding: 8px 10px;
  color: var(--primary);
  cursor: pointer;
  font-size: 13px;
}
.us-board-new-link:hover { background: var(--surface, #fff); }
.us-board-add-form {
  background: var(--surface, #fff);
  border: 1px solid var(--border, #c8c6c4);
  border-radius: 6px;
  padding: 8px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.us-board-add-row { display: flex; align-items: center; gap: 8px; }
.us-board-add-input {
  flex: 1;
  min-width: 0;
  height: 34px;
  border: 1px solid var(--border, #c8c6c4);
  border-radius: 4px;
  padding: 4px 8px;
  font-size: 13px;
}
.us-board-add-actions { display: flex; gap: 6px; }
.us-board-cards {
  display: flex;
  flex-direction: column;
  gap: 8px;
  overflow-y: auto;
  min-height: 40px;
  padding-right: 2px;
}
.us-board-card {
  background: var(--surface, #fff);
  border: 1px solid var(--border, #edebe9);
  border-radius: 6px;
  padding: 10px;
  cursor: grab;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
}
.us-board-card:active { cursor: grabbing; }
.us-board-card-top {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
}
.us-board-card-id {
  font-size: 12px;
  color: var(--muted);
  padding: 0;
}
.us-board-card-title {
  font-size: 13px;
  font-weight: 600;
  line-height: 1.35;
  margin-bottom: 6px;
  word-break: break-word;
}
.us-board-card-meta { font-size: 12px; }
.us-board-empty { padding: 12px 4px; font-size: 12px; }

/* ===== PM Enterprise Analytics ===== */
.pm-filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 14px;
  align-items: flex-end;
  padding: 12px 14px;
  background: var(--surface-raised);
  border: 1px solid var(--border, #edebe9);
  border-radius: 4px;
  margin-bottom: 16px;
}
.pm-filter-bar .field {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 120px;
}
.pm-filter-bar .field label {
  font-size: 11px;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.02em;
}
.pm-filter-bar .field input,
.pm-filter-bar .field select,
.pm-filter-bar .field .ss-control {
  min-height: 36px;
  padding: 6px 12px;
  border: 1px solid #d1d5db;
  border-radius: 4px;
  background-color: #f3f4f6;
  box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
}
.pm-filter-bar .field .ss {
  min-width: 140px;
  width: 100%;
}
.pm-filter-bar .pm-filter-actions {
  min-width: auto;
  flex: 0 0 auto;
}
.pm-filter-bar .pm-filter-actions-row {
  display: flex;
  flex-direction: row;
  flex-wrap: nowrap;
  align-items: center;
  gap: 8px;
}
.pm-filter-bar .pm-filter-actions-row .btn {
  white-space: nowrap;
  min-height: 36px;
}
.pm-filter-actions {
  display: flex;
  gap: 8px;
  align-items: center;
  padding-bottom: 2px;
}
.pm-filter-actions .btn,
.ra-filters-row > .btn {
  min-height: 36px;
  height: 36px;
  padding: 0 12px;
  background: #e5e7eb !important;
  color: var(--heading, #201f1e) !important;
  border: none !important;
  border-radius: 4px;
  box-shadow: none;
}
.pm-filter-actions .btn:hover,
.ra-filters-row > .btn:hover {
  background: #d1d5db !important;
  border: none !important;
  box-shadow: none;
}
.pm-kpi .card-link {
  margin-top: 6px;
  font-size: 12px;
}

.pm-page .pm-kpi.is-active {
  outline: 2px solid var(--primary, #0078d4);
  outline-offset: 1px;
}

.pm-badge {
  display: inline-block;
  margin-left: 8px;
  background: #d13438;
  color: #fff;
  border-radius: 10px;
  font-size: 11px;
  padding: 1px 6px;
  vertical-align: middle;
}
.pm-health-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-weight: 600;
  font-size: 12px;
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--surface-hover);
  white-space: nowrap;
}
.pm-health-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: currentColor;
  flex-shrink: 0;
}
.pm-health-green { color: #107c10; background: #dff6dd; }
.pm-health-yellow { color: #8a6914; background: #fff4ce; }
.pm-health-red { color: #a4262c; background: #fde7e9; }
.pm-health-label {
  text-transform: none;
  font-weight: 600;
  opacity: 0.9;
}

.pm-health-table-wrap {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.pm-health-table {
  width: 100%;
  min-width: 1080px;
  table-layout: fixed;
  border-collapse: collapse;
}

.pm-health-table th,
.pm-health-table td {
  padding: 8px 10px;
  vertical-align: middle;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.pm-health-table .pm-health-col-project { width: 14%; }
.pm-health-table .pm-health-col-manager,
.pm-health-table .pm-health-col-ba { width: 11%; }

.pm-health-table .pm-health-num {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.pm-health-table td:nth-child(13) {
  overflow: visible;
}

.pm-insights-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 12px;
  padding: 4px 0 8px;
}
.pm-insight-card {
  border: 1px solid var(--border);
  border-left-width: 4px;
  border-radius: 4px;
  padding: 12px 14px;
  background: var(--surface);
}
.pm-insight-critical { border-left-color: #d13438; }
.pm-insight-warning { border-left-color: #ffb900; }
.pm-insight-info { border-left-color: var(--primary); }
.pm-insight-title { font-weight: 600; margin-bottom: 6px; }
.pm-insight-summary { font-size: 13px; color: var(--text); margin-bottom: 8px; }
.pm-insight-rec { font-size: 12px; color: var(--muted); }
.pm-chart-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 14px;
  margin: 16px 0;
}
.pm-chart-card {
  min-height: 320px;
}
.pm-chart-empty {
  padding: 40px;
  text-align: center;
}
.pm-heatmap {
  overflow-x: auto;
}
.pm-heatmap table {
  border-collapse: collapse;
  font-size: 12px;
}
.pm-heatmap th,
.pm-heatmap td {
  border: 1px solid var(--border);
  padding: 4px 6px;
  text-align: center;
  min-width: 36px;
}
.pm-heatmap .cell-green { background: #dff6dd; }
.pm-heatmap .cell-yellow { background: #fff4ce; }
.pm-heatmap .cell-red { background: #fde7e9; }
.pm-heatmap .cell-none { background: var(--surface-raised); }
.pm-analytics-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 14px;
}
.pm-analytics-nav a {
  text-decoration: none;
  font-size: 13px;
  padding: 6px 10px;
  border: 1px solid var(--border);
  border-radius: 3px;
  color: var(--text);
  background: var(--surface);
}
.pm-analytics-nav a:hover,
.pm-analytics-nav a.active {
  border-color: var(--primary);
  color: var(--primary);
  background: var(--primary-soft);
}
@media (max-width: 960px) {
  .pm-filter-bar { flex-direction: column; align-items: stretch; }
  .pm-chart-grid { grid-template-columns: 1fr; }
}

/* ===== Team Chat (Teams-style) ===== */
.content.tc-page {
  padding: 0;
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow: hidden;
}
.tc-shell {
  display: flex;
  position: relative;
  flex: 1;
  min-height: calc(100vh - 56px);
  max-height: calc(100vh - 56px);
  background: var(--surface);
  border-top: 1px solid var(--border);
}
.tc-realtime-banner {
  position: absolute;
  top: 8px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 5;
  background: #fff8e6;
  border: 1px solid #f0d78c;
  color: #7a5b00;
  font-size: 12px;
  padding: 4px 12px;
  border-radius: 999px;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.08);
}
.tc-sidebar {
  width: 320px;
  min-width: 280px;
  max-width: 360px;
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  background: var(--bg);
}
.tc-sidebar-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 14px 14px 8px;
}
.tc-sidebar-head h2 {
  margin: 0;
  font-size: 20px;
  font-weight: 700;
  color: var(--text);
}
.tc-new-actions {
  display: flex;
  gap: 6px;
}
.tc-search {
  padding: 0 12px 10px;
}
.tc-search input {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 8px 10px;
  font-size: 13px;
  background: var(--surface);
  color: inherit;
}
.tc-search input::placeholder {
  color: var(--muted);
}
.tc-list {
  flex: 1;
  overflow-y: auto;
  padding: 0 6px 12px;
}
.tc-list-item {
  display: flex;
  gap: 10px;
  width: 100%;
  text-align: left;
  border: none;
  background: transparent;
  border-radius: 4px;
  color: inherit;
  cursor: pointer;
  padding: 10px 8px;
}
.tc-list-item:hover {
  background: var(--surface-hover);
}
.tc-list-item.active {
  background: var(--primary-soft);
}
.tc-list-item.unread {
  background: var(--surface-hover);
}
.tc-list-item.unread:hover {
  background: var(--surface-hover);
}
.tc-list-item.unread.active {
  background: var(--primary-soft);
}
.tc-list-meta {
  flex: 1;
  min-width: 0;
}
.tc-list-top,
.tc-list-bottom {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
}
.tc-list-title {
  font-size: 14px;
  font-weight: 500;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.tc-list-item.unread .tc-list-title {
  font-weight: 800;
  color: var(--text);
}
.tc-list-top .muted {
  font-size: 11px;
  flex-shrink: 0;
}
.tc-list-item.unread .tc-list-top .muted {
  font-weight: 700;
  color: #6264a7;
}
.tc-preview {
  font-size: 12px;
  font-weight: 400;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  flex: 1;
}
.tc-list-item.unread .tc-preview {
  font-weight: 700;
  color: var(--text);
}
.tc-unread {
  background: #c4314b;
  color: #fff;
  font-size: 11px;
  font-weight: 800;
  min-width: 20px;
  height: 20px;
  border-radius: 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 6px;
  flex-shrink: 0;
}
.tc-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: #6264a7;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 700;
  flex-shrink: 0;
}
.tc-avatar.lg {
  width: 40px;
  height: 40px;
  font-size: 14px;
}
.tc-avatar.sm {
  width: 28px;
  height: 28px;
  font-size: 11px;
}
/* White icons/text only inside the round avatar strip */
.tc-avatar,
.tc-avatar .tc-group-ico {
  color: #fff !important;
  fill: none;
  stroke: currentColor;
}
.tc-main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  background: var(--surface);
  position: relative;
}
.tc-placeholder {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: linear-gradient(180deg, var(--surface-raised) 0%, var(--surface-hover) 100%);
}
.tc-placeholder-card {
  max-width: 420px;
  text-align: center;
}
.tc-placeholder-card h3 {
  margin: 0 0 8px;
  font-size: 22px;
}
.tc-placeholder-actions {
  display: flex;
  gap: 10px;
  justify-content: center;
  margin-top: 16px;
  flex-wrap: wrap;
}
.tc-thread-head {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 18px;
  border-bottom: 1px solid var(--border);
  background: var(--surface);
}
.tc-thread-head-meta {
  flex: 1;
  min-width: 0;
}
.tc-thread-head h3 {
  margin: 0;
  font-size: 16px;
}
.tc-thread-head p {
  margin: 2px 0 0;
  font-size: 12px;
}
.tc-thread-actions {
  display: flex;
  gap: 8px;
  flex-shrink: 0;
}
.tc-video-btn {
  white-space: nowrap;
}
.tc-call-join {
  display: inline-flex;
  align-items: center;
  margin: 6px 0 2px;
  padding: 6px 12px;
  border-radius: 4px;
  background: #107c10;
  color: #fff !important;
  font-weight: 700;
  font-size: 13px;
  text-decoration: none;
}
.tc-call-join:hover {
  background: #0b5a08;
}
.tc-messages {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 28px 18px 16px;
  display: flex;
  flex-direction: column;
  gap: 18px;
  background: var(--surface-raised);
}
.tc-empty {
  text-align: center;
  padding: 24px 12px;
  margin: 0;
}
.tc-bubble-row {
  display: flex;
  gap: 8px;
  align-items: flex-start;
  max-width: 72%;
  position: relative;
}
.tc-bubble-row.mine {
  align-self: flex-end;
  flex-direction: row-reverse;
}
.tc-bubble {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 8px 12px;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
}
.tc-bubble-row.mine .tc-bubble {
  background: var(--primary-soft);
  border-color: #c7e0f4;
}
.tc-bubble-name {
  font-size: 12px;
  font-weight: 600;
  color: #6264a7;
  margin-bottom: 2px;
}
.tc-bubble-body {
  font-size: 14px;
  white-space: pre-wrap;
  word-break: break-word;
  line-height: 1.4;
}
.tc-bubble-body strong {
  font-weight: 700;
}
.tc-bubble-body em {
  font-style: italic;
}
.tc-md-code {
  font-family: Consolas, "Courier New", monospace;
  font-size: 0.92em;
  padding: 1px 5px;
  border-radius: 3px;
  background: color-mix(in srgb, var(--text) 10%, transparent);
  border: 1px solid var(--border);
}
.tc-bubble-time {
  font-size: 11px;
  color: var(--muted);
  margin-top: 4px;
  text-align: right;
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 4px;
  width: 100%;
}

.tc-ticks {
  font-size: 12px;
  letter-spacing: -2px;
  color: var(--muted);
  font-weight: 600;
  line-height: 1;
}

.tc-ticks.seen {
  color: #34b7f1;
}

.tc-ticks.pending {
  letter-spacing: 0;
  font-size: 10px;
  opacity: 0.7;
}

.tc-bubble-row.pending .tc-bubble {
  opacity: 0.82;
}

.tc-typing-line {
  color: var(--primary, #107c10) !important;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.tc-typing-dots {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  margin-left: 2px;
}

.tc-typing-dots span {
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: currentColor;
  animation: tc-typing-bounce 1.2s infinite ease-in-out;
}

.tc-typing-dots span:nth-child(2) {
  animation-delay: 0.15s;
}

.tc-typing-dots span:nth-child(3) {
  animation-delay: 0.3s;
}

@keyframes tc-typing-bounce {
  0%,
  60%,
  100% {
    opacity: 0.35;
    transform: translateY(0);
  }
  30% {
    opacity: 1;
    transform: translateY(-2px);
  }
}

.tc-composer {
  border-top: 1px solid var(--border);
  padding: 12px 16px 14px;
  background: var(--surface);
}
.tc-composer textarea {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 10px 12px;
  font-size: 14px;
  resize: none;
  font-family: inherit;
  min-height: 56px;
}
.tc-composer-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 8px;
  gap: 12px;
}
.tc-error {
  position: absolute;
  bottom: 88px;
  left: 18px;
  right: 18px;
  margin: 0;
  font-size: 13px;
  pointer-events: none;
}
.tc-modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.4);
  z-index: 1200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}
.tc-modal {
  width: min(480px, 100%);
  max-height: min(80vh, 640px);
  background: var(--surface);
  border-radius: 6px;
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.2);
  padding: 16px 18px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.tc-modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.tc-modal-head h3 {
  margin: 0;
  font-size: 18px;
}
.tc-people-list {
  flex: 1;
  overflow-y: auto;
  max-height: 320px;
  border: 1px solid var(--border);
  border-radius: 4px;
}
.tc-person {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  border: none;
  border-bottom: 1px solid var(--border);
  background: var(--surface);
  padding: 10px 12px;
  text-align: left;
  cursor: pointer;
  color: inherit;
}
.tc-person:hover {
  background: var(--surface-hover);
}
.tc-person.selected {
  background: var(--primary-soft);
}
.tc-person-meta {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}
.tc-person-meta strong {
  font-size: 14px;
}
.tc-person-meta .muted {
  font-size: 12px;
}
.tc-check {
  color: var(--primary);
  font-weight: 700;
}
.tc-modal-actions {
  display: flex;
  justify-content: flex-end;
  padding-top: 4px;
}
.tc-topbar-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 32px;
  padding: 0 10px;
  border: 1px solid var(--border);
  border-radius: 4px;
  background: var(--surface);
  color: var(--text);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  position: relative;
  overflow: visible;
}

.ai-topbar-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 32px;
  padding: 0 10px;
  border: 1px solid var(--border);
  border-radius: 4px;
  background: var(--surface);
  color: var(--text);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}
.ai-topbar-btn:hover,
.ai-topbar-btn.is-active {
  background: var(--primary-soft);
  border-color: var(--primary);
  color: var(--primary);
}
.ai-topbar-label {
  white-space: nowrap;
}

.ai-shell {
  display: grid;
  grid-template-columns: 260px 1fr;
  flex: 1;
  height: calc(100vh - 64px);
  max-height: calc(100vh - 64px);
  min-height: 0;
  border: 1px solid var(--border);
  background: var(--surface);
  overflow: hidden;
}
.ai-sidebar {
  display: flex;
  flex-direction: column;
  border-right: 1px solid var(--border);
  background: var(--surface-raised);
  min-height: 0;
  height: 100%;
  overflow: hidden;
}
.ai-sidebar-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 14px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.ai-sidebar-head h2 {
  margin: 0;
  font-size: 16px;
}
.ai-status {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 10px 12px 0;
  flex-shrink: 0;
}
.ai-pill {
  font-size: 11px;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--muted);
}
.ai-pill.ok {
  color: var(--success);
  border-color: color-mix(in srgb, var(--success) 40%, var(--border));
}
.ai-pill.bad {
  color: var(--danger);
  border-color: color-mix(in srgb, var(--danger) 40%, var(--border));
}
.ai-reindex-btn {
  margin: 10px 12px;
  flex-shrink: 0;
}
.ai-conv-list {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 4px 8px 12px;
  scrollbar-gutter: stable;
  scrollbar-width: thin;
  scrollbar-color: #a19f9d transparent;
}
.ai-conv-list::-webkit-scrollbar {
  width: 8px;
}
.ai-conv-list::-webkit-scrollbar-track {
  background: transparent;
}
.ai-conv-list::-webkit-scrollbar-thumb {
  background: #a19f9d;
  border-radius: 8px;
  border: 2px solid transparent;
  background-clip: content-box;
}
.ai-conv-list::-webkit-scrollbar-thumb:hover {
  background: #8a8886;
  background-clip: content-box;
}
.ai-conv-list::-webkit-scrollbar-corner {
  background: transparent;
}
.ai-conv-item {
  display: flex;
  flex-direction: column;
  gap: 2px;
  width: 100%;
  text-align: left;
  border: 0;
  background: transparent;
  padding: 8px 10px;
  border-radius: 6px;
  cursor: pointer;
  color: var(--text);
}
.ai-conv-item:hover,
.ai-conv-item.active {
  background: var(--primary-soft);
}
.ai-conv-title {
  font-size: 13px;
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.ai-conv-time {
  font-size: 11px;
}
.ai-empty-side {
  padding: 12px;
  font-size: 13px;
}
.ai-main {
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
  background: var(--bg);
}
.ai-main-head {
  padding: 14px 18px 8px;
  border-bottom: 1px solid var(--border);
  background: var(--surface);
}
.ai-main-head h3 {
  margin: 0 0 4px;
  font-size: 17px;
}
.ai-main-head p {
  margin: 0;
  font-size: 13px;
}
.ai-messages {
  flex: 1;
  overflow-y: auto;
  padding: 16px 18px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.ai-welcome {
  margin: auto;
  max-width: 520px;
  text-align: center;
}
.ai-welcome h4 {
  margin: 0 0 12px;
}
.ai-suggestions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
}
.ai-suggest {
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  border-radius: 999px;
  padding: 6px 12px;
  font-size: 13px;
  cursor: pointer;
}
.ai-suggest:hover {
  border-color: var(--primary);
  background: var(--primary-soft);
  color: var(--primary);
}
.ai-hint {
  margin-top: 16px;
  font-size: 13px;
  color: var(--muted);
}
.ai-msg {
  max-width: min(720px, 92%);
  padding: 10px 14px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--surface);
}
.ai-msg.user {
  align-self: flex-end;
  background: var(--primary-soft);
  border-color: color-mix(in srgb, var(--primary) 35%, var(--border));
}
.ai-msg.assistant {
  align-self: flex-start;
}
.ai-msg-role {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
  margin-bottom: 4px;
}
.ai-msg-body {
  font-size: 14px;
  line-height: 1.5;
  white-space: pre-wrap;
  word-break: break-word;
}
.ai-msg-body.ai-md {
  white-space: normal;
}
.ai-md-line {
  margin: 0 0 0.2em;
}
.ai-md-blank {
  height: 0.55em;
}
.ai-md-bullet-line {
  display: flex;
  gap: 0.4em;
  align-items: flex-start;
}
.ai-md-bullet {
  flex: 0 0 auto;
  color: var(--primary, #4f46e5);
  font-weight: 700;
  line-height: 1.5;
}
.ai-md strong {
  font-weight: 700;
  color: inherit;
}
.ai-thinking {
  border-color: color-mix(in srgb, var(--primary) 30%, var(--border));
  background: color-mix(in srgb, var(--primary-soft) 55%, var(--surface));
  animation: ai-pulse-border 1.8s ease-in-out infinite;
}
.ai-thinking-row {
  display: flex;
  align-items: center;
  gap: 10px;
}
.ai-thinking-copy {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
}
.ai-thinking-label {
  font-size: 14px;
  color: var(--text);
  animation: ai-fade-swap 0.35s ease;
}
.ai-thinking-bar {
  margin-top: 10px;
  height: 3px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--primary) 14%, var(--border));
  overflow: hidden;
}
.ai-thinking-bar > span {
  display: block;
  height: 100%;
  width: 40%;
  border-radius: inherit;
  background: var(--primary);
  animation: ai-indeterminate 1.2s ease-in-out infinite;
}
.ai-dots {
  display: inline-flex;
  gap: 4px;
  align-items: center;
}
.ai-dots i {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--primary);
  opacity: 0.35;
  animation: ai-bounce 1.05s ease-in-out infinite;
}
.ai-dots i:nth-child(2) {
  animation-delay: 0.15s;
}
.ai-dots i:nth-child(3) {
  animation-delay: 0.3s;
}
.ai-spinner {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  border: 2px solid color-mix(in srgb, var(--primary) 25%, transparent);
  border-top-color: var(--primary);
  animation: ai-spin 0.7s linear infinite;
  flex-shrink: 0;
}
.ai-spinner-sm {
  width: 12px;
  height: 12px;
  border-width: 2px;
}
.ai-reindex-btn,
.ai-ask-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  justify-content: center;
}
@keyframes ai-spin {
  to {
    transform: rotate(360deg);
  }
}
@keyframes ai-bounce {
  0%,
  80%,
  100% {
    transform: translateY(0);
    opacity: 0.3;
  }
  40% {
    transform: translateY(-4px);
    opacity: 1;
  }
}
@keyframes ai-indeterminate {
  0% {
    transform: translateX(-120%);
  }
  100% {
    transform: translateX(280%);
  }
}
@keyframes ai-pulse-border {
  0%,
  100% {
    box-shadow: 0 0 0 0 color-mix(in srgb, var(--primary) 0%, transparent);
  }
  50% {
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary) 12%, transparent);
  }
}
@keyframes ai-fade-swap {
  from {
    opacity: 0.45;
    transform: translateY(2px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
.ai-sql-block {
  border-top: 1px solid var(--border);
  padding: 8px 18px;
  background: var(--surface);
  font-size: 12px;
  max-height: 200px;
  overflow: auto;
}
.ai-sql-block summary {
  cursor: pointer;
  list-style: none;
  display: flex;
  align-items: baseline;
  gap: 6px;
}
.ai-sql-block summary::-webkit-details-marker {
  display: none;
}
.ai-msg-sql {
  margin-top: 10px;
  font-size: 12px;
}
.ai-msg-sql summary {
  cursor: pointer;
  color: var(--primary);
  font-weight: 600;
}
.ai-sql-block strong {
  display: inline;
  margin-bottom: 0;
}
.ai-sql-pre {
  margin: 8px 0 0;
  padding: 10px 12px;
  border-radius: 6px;
  background: #0f172a;
  color: #e2e8f0;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 11px;
  line-height: 1.45;
  white-space: pre-wrap;
  word-break: break-word;
}
.ai-sources {
  border-top: 1px solid var(--border);
  padding: 8px 18px;
  background: var(--surface);
  font-size: 12px;
  max-height: 120px;
  overflow-y: auto;
}
.ai-sources ul {
  margin: 6px 0 0;
  padding-left: 18px;
}
.ai-src-type {
  display: inline-block;
  min-width: 72px;
  font-weight: 600;
  color: var(--primary);
  text-transform: capitalize;
}
.ai-error {
  margin: 0 18px;
}
.ai-composer {
  display: flex;
  gap: 10px;
  align-items: flex-end;
  padding: 12px 18px 16px;
  border-top: 1px solid var(--border);
  background: var(--surface);
}
.ai-composer textarea {
  flex: 1;
  resize: none;
  min-height: 44px;
  border: 1px solid var(--border-strong);
  border-radius: 6px;
  padding: 10px 12px;
  font-size: 14px;
  background: var(--bg);
  color: var(--text);
}
@media (max-width: 860px) {
  .ai-shell {
    grid-template-columns: 1fr;
    height: auto;
    max-height: none;
    min-height: calc(100vh - 64px);
  }
  .ai-sidebar {
    max-height: 260px;
    height: auto;
    border-right: 0;
    border-bottom: 1px solid var(--border);
  }
  .ai-conv-list {
    max-height: 160px;
  }
}

.tc-topbar-btn:hover {
  background: var(--primary-soft);
  border-color: #c7e0f4;
  color: var(--primary);
}
.tc-topbar-btn.has-unread {
  border-color: #c4314b;
  background: #fde7e9;
  color: #a4262c;
  font-weight: 800;
  animation: tc-btn-pulse 1.4s ease-in-out infinite;
}
.tc-topbar-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  border-radius: 10px;
  background: #c4314b;
  color: #fff;
  font-size: 11px;
  font-weight: 800;
  line-height: 1;
  flex-shrink: 0;
}
.tc-other-alert {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  border: 0;
  border-bottom: 1px solid #c8c6e4;
  background: var(--surface-hover);
  color: #373670;
  padding: 10px 16px;
  text-align: left;
  cursor: pointer;
  font-size: 13px;
  animation: tc-notice-pulse 1.6s ease-in-out 3;
}
.tc-other-alert:hover {
  background: var(--surface-hover);
}
.tc-other-alert-cta {
  margin-left: auto;
  font-weight: 700;
  color: #6264a7;
  flex-shrink: 0;
}
@keyframes tc-btn-pulse {
  0%,
  100% {
    box-shadow: 0 0 0 0 rgba(98, 100, 167, 0.35);
  }
  50% {
    box-shadow: 0 0 0 4px rgba(98, 100, 167, 0);
  }
}
@media (max-width: 800px) {
  .tc-shell {
    flex-direction: column;
    max-height: none;
    min-height: calc(100vh - 56px);
  }
  .tc-sidebar {
    width: 100%;
    max-width: none;
    max-height: 40vh;
    border-right: none;
    border-bottom: 1px solid var(--border);
  }
  .tc-topbar-label {
    display: none;
  }
  .tc-bubble-row {
    max-width: 90%;
  }
}

/* ===== Free Jitsi video call ===== */
.vc-page {
  display: flex;
  flex-direction: column;
  min-height: calc(100vh - 56px);
  max-height: calc(100vh - 56px);
  background: #1b1a1f;
  color: #f3f2f1;
}
.vc-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  padding: 10px 14px;
  background: #25232a;
  border-bottom: 1px solid #3b3a3f;
}
.vc-bar-left {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}
.vc-bar h2 {
  margin: 0;
  font-size: 16px;
  color: #fff;
}
.vc-bar .muted {
  margin: 2px 0 0;
  font-size: 12px;
  color: var(--muted);
}
.vc-bar-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.vc-link-strip {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  padding: 8px 14px;
  background: #2d2b33;
  border-bottom: 1px solid #3b3a3f;
  font-size: 12px;
}
.vc-link {
  flex: 1;
  min-width: 180px;
  padding: 6px 8px;
  background: #1b1a1f;
  border-radius: 4px;
  color: #9fd89f;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.vc-stage {
  flex: 1;
  min-height: 420px;
  background: #111;
}
.vc-stage > iframe,
.vc-stage > div {
  width: 100% !important;
  height: 100% !important;
}
.vc-error {
  margin: 0;
  padding: 8px 14px;
  background: #442726;
}
.vc-ended {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
}
@media (max-width: 800px) {
  .vc-page {
    max-height: none;
    min-height: calc(100vh - 56px);
  }
  .vc-stage {
    min-height: 60vh;
  }
}

/* ===== Teams-like chat composer, attachments, reply ===== */
.tc-bubble-wrap {
  position: relative;
  display: inline-block;
  max-width: 100%;
  vertical-align: top;
  /* Reserve space so the emoji toolbar never covers the avatar or bubble text */
  padding-top: 36px;
  margin-top: -8px;
}
.tc-bubble-row > .tc-avatar.sm {
  margin-top: 40px;
  flex-shrink: 0;
}
.tc-hover-bar {
  position: absolute;
  top: 2px;
  display: inline-flex;
  align-items: center;
  gap: 1px;
  padding: 4px 6px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 4px;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.14);
  z-index: 6;
  white-space: nowrap;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translateY(4px);
  transition: opacity 0.12s ease, transform 0.12s ease, visibility 0.12s;
}
/* Incoming messages: avatar is on the left — grow toolbar toward the chat center */
.tc-bubble-row:not(.mine) .tc-hover-bar {
  left: 0;
  right: auto;
}
/* Own messages: grow toolbar toward the chat center */
.tc-bubble-row.mine .tc-hover-bar {
  left: auto;
  right: 0;
}
.tc-bubble-wrap:hover .tc-hover-bar,
.tc-bubble-wrap:focus-within .tc-hover-bar {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: translateY(0);
}
.tc-hover-btn {
  border: 0;
  background: transparent;
  width: 30px;
  height: 30px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 15px;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
}
.tc-hover-btn:hover {
  background: var(--surface-hover);
}
.tc-hover-btn.tc-hover-danger:hover {
  background: #fee2e2;
  color: #b91c1c;
}
.tc-delete-chat {
  color: #b91c1c;
  border-color: #fecaca;
}
.tc-hover-sep {
  width: 1px;
  height: 18px;
  background: var(--surface-hover);
  margin: 0 4px;
  flex-shrink: 0;
}
.tc-quote {
  border-left: 3px solid #6264a7;
  background: rgba(98, 100, 167, 0.08);
  border-radius: 0 4px 4px 0;
  padding: 6px 8px;
  margin-bottom: 6px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  font-size: 12px;
  width: 100%;
  text-align: left;
  border-top: 0;
  border-right: 0;
  border-bottom: 0;
  cursor: pointer;
  color: inherit;
  font-family: inherit;
}
.tc-quote:hover {
  background: rgba(98, 100, 167, 0.16);
}
.tc-quote strong {
  color: #6264a7;
}
.tc-bubble-row.flash .tc-bubble {
  animation: tc-msg-flash 2.2s ease;
}
@keyframes tc-msg-flash {
  0%,
  100% {
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
  }
  20%,
  55% {
    box-shadow: 0 0 0 3px rgba(98, 100, 167, 0.45);
    border-color: #6264a7;
  }
}
.tc-pdf-card,
.tc-pending-pdf {
  display: block;
  margin-top: 8px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  overflow: hidden;
  text-decoration: none;
  color: inherit;
  max-width: 320px;
}
.tc-pending-pdf {
  margin-top: 0;
  margin-bottom: 8px;
  max-width: 100%;
}
.tc-pdf-card:hover {
  border-color: #c8c6e4;
  box-shadow: 0 2px 10px rgba(98, 100, 167, 0.12);
}
.tc-pdf-card-head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
  background: var(--surface-raised);
}
.tc-pdf-doc-icon {
  font-size: 22px;
  flex-shrink: 0;
}
.tc-pdf-card-meta {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.tc-pdf-card-meta strong {
  font-size: 13px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.tc-pdf-card-body {
  background: var(--surface-hover);
  padding: 8px;
  display: flex;
  justify-content: center;
}
.tc-pdf-thumb {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 4px;
  overflow: hidden;
  line-height: 0;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.08);
  max-height: 140px;
  width: 100%;
}
.tc-pdf-thumb canvas {
  display: block;
  width: 100%;
  height: auto;
  max-height: 140px;
  object-fit: cover;
  object-position: top;
}
.tc-pdf-loading,
.tc-pdf-fallback {
  padding: 24px 12px;
  font-size: 12px;
  color: var(--muted);
  text-align: center;
  line-height: 1.4;
}
.tc-pdf-fallback {
  display: flex;
  flex-direction: column;
  gap: 6px;
  align-items: center;
}
.tc-attach-image {
  display: block;
  margin-top: 8px;
}
.tc-attach-image img {
  max-width: min(320px, 100%);
  max-height: 240px;
  border-radius: 6px;
  border: 1px solid var(--border);
  object-fit: cover;
}
.tc-attach-card {
  margin-top: 8px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--surface-raised);
  text-decoration: none;
  color: inherit;
  max-width: 320px;
}
.tc-attach-card:hover {
  border-color: #6264a7;
  background: var(--surface-hover);
}
.tc-attach-icon {
  font-size: 22px;
}
.tc-attach-meta {
  display: flex;
  flex-direction: column;
  min-width: 0;
}
.tc-attach-meta strong {
  font-size: 13px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.tc-react-row {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 6px;
}
.tc-react-chip {
  border: 1px solid var(--border);
  background: var(--surface);
  border-radius: 12px;
  padding: 1px 7px;
  font-size: 12px;
  cursor: pointer;
}
.tc-react-chip.mine {
  border-color: #6264a7;
  background: var(--surface-hover);
}
.tc-composer.teams-like {
  padding: 10px 14px 12px;
}
.tc-reply-banner,
.tc-pending-file {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
  padding: 8px 10px;
  border-radius: 6px;
  background: var(--surface-hover);
  border-left: 3px solid #6264a7;
}
.tc-reply-banner > div,
.tc-pending-meta {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
  font-size: 12px;
}
.tc-pending-thumb {
  width: 44px;
  height: 44px;
  object-fit: cover;
  border-radius: 4px;
  border: 1px solid var(--border);
}
.tc-pending-icon {
  font-size: 24px;
}
.tc-format-row {
  display: flex;
  gap: 4px;
  margin-bottom: 6px;
}
.tc-format-row button {
  border: 1px solid var(--border);
  background: var(--surface);
  border-radius: 4px;
  width: 32px;
  height: 28px;
  cursor: pointer;
}
.tc-composer-box {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  padding: 8px 10px;
  position: relative;
  transition: border-color 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}
.tc-composer-box.dragover {
  border-color: #6264a7;
  box-shadow: 0 0 0 3px rgba(98, 100, 167, 0.18);
  background: rgba(98, 100, 167, 0.04);
}
.tc-composer-box textarea {
  flex: 1;
  border: 0 !important;
  outline: none;
  resize: none;
  min-height: 44px;
  max-height: 140px;
  padding: 4px 0 !important;
  font-size: 14px;
  font-family: inherit;
  background: transparent;
}
.tc-drop-overlay {
  position: absolute;
  inset: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px dashed #6264a7;
  border-radius: 8px;
  background: rgba(98, 100, 167, 0.08);
  color: #4f46a5;
  font-size: 13px;
  font-weight: 700;
  pointer-events: none;
  z-index: 2;
}
.tc-composer-tools {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  flex-shrink: 0;
  position: relative;
}
.tc-icon-btn {
  border: 0;
  background: transparent;
  width: 32px;
  height: 32px;
  border-radius: 4px;
  cursor: pointer;
  color: #616161;
  font-size: 14px;
}
.tc-icon-btn:hover,
.tc-icon-btn.on {
  background: var(--surface-hover);
  color: var(--text);
}
.tc-tool-sep {
  width: 1px;
  height: 22px;
  background: var(--border);
  margin: 0 4px;
}
.tc-send-btn {
  border: 0;
  background: #6264a7;
  color: #fff;
  width: 34px;
  height: 34px;
  border-radius: 4px;
  cursor: pointer;
  font-size: 15px;
}
.tc-send-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}
.tc-tool-pop {
  position: relative;
}
.tc-emoji-pop,
.tc-plus-pop {
  position: absolute;
  right: 0;
  bottom: 38px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.14);
  z-index: 20;
}
.tc-emoji-pop {
  display: grid;
  grid-template-columns: repeat(8, 1fr);
  gap: 2px;
  padding: 8px;
  width: 280px;
}
.tc-emoji-pop button {
  border: 0;
  background: transparent;
  width: 30px;
  height: 30px;
  border-radius: 4px;
  cursor: pointer;
  font-size: 16px;
}
.tc-emoji-pop button:hover {
  background: var(--surface-hover);
}
.tc-plus-pop {
  min-width: 220px;
  padding: 6px;
}
.tc-plus-pop button {
  width: 100%;
  text-align: left;
  border: 0;
  background: transparent;
  padding: 8px 10px;
  border-radius: 4px;
  cursor: pointer;
  font-size: 13px;
}
.tc-plus-pop button:hover {
  background: var(--surface-hover);
}
.tc-composer-hint {
  margin: 6px 2px 0;
  font-size: 11px;
}

/* ===== Internal Outlook-style Email ===== */
.content.tc-page:has(.ml-shell) {
  padding: 0;
}
.ml-shell {
  display: grid;
  grid-template-columns: 180px 320px 1fr;
  min-height: calc(100vh - 56px);
  max-height: calc(100vh - 56px);
  background: var(--surface);
  border-top: 1px solid var(--border);
}
.ml-folders {
  border-right: 1px solid var(--border);
  background: var(--surface-hover);
  padding: 12px 10px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.ml-new {
  width: 100%;
}
.ml-folders nav {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.ml-folder {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border: 0;
  background: transparent;
  text-align: left;
  padding: 8px 10px;
  border-radius: 4px;
  cursor: pointer;
  font-size: 13px;
  color: var(--text);
}
.ml-folder:hover {
  background: var(--surface-hover);
}
.ml-folder.active {
  background: var(--primary-soft);
  color: var(--primary);
  font-weight: 700;
}
.ml-folder-badge {
  background: #c4314b;
  color: #fff;
  font-size: 11px;
  font-weight: 800;
  min-width: 18px;
  height: 18px;
  border-radius: 9px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 5px;
}
.ml-list-pane {
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  min-width: 0;
  background: var(--surface-raised);
}
.ml-list-head {
  padding: 12px;
  border-bottom: 1px solid var(--border);
  background: var(--surface);
}
.ml-list-head h2 {
  margin: 0 0 8px;
  font-size: 18px;
}
.ml-list-head input {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 7px 10px;
  font-size: 13px;
}
.ml-list {
  flex: 1;
  overflow-y: auto;
}
.ml-list-item {
  display: block;
  width: 100%;
  text-align: left;
  border: 0;
  border-bottom: 1px solid var(--border);
  background: var(--surface);
  padding: 10px 12px;
  cursor: pointer;
  color: inherit;
}
.ml-list-item:hover {
  background: var(--surface-hover);
}
.ml-list-item.active {
  background: var(--primary-soft);
}
.ml-list-item.unread .ml-list-from,
.ml-list-item.unread .ml-list-subject {
  font-weight: 800;
  color: var(--text);
}
.ml-list-top {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  font-size: 13px;
}
.ml-list-from {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.ml-list-subject {
  font-size: 13px;
  margin-top: 2px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.ml-list-snippet {
  font-size: 12px;
  margin-top: 2px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.ml-empty {
  padding: 24px 14px;
  text-align: center;
}
.ml-read-pane {
  display: flex;
  flex-direction: column;
  min-width: 0;
  position: relative;
  background: var(--surface);
}
.ml-read-empty {
  margin: auto;
  text-align: center;
  max-width: 360px;
  padding: 24px;
}
.ml-read-empty h3 {
  margin: 0 0 8px;
}
.ml-read-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 18px;
  border-bottom: 1px solid var(--border);
  flex-wrap: wrap;
}
.ml-read-head h2 {
  margin: 0 0 6px;
  font-size: 20px;
}
.ml-read-head p {
  margin: 0 0 4px;
  font-size: 13px;
}
.ml-recip-line {
  font-size: 12px !important;
}
.ml-read-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: flex-start;
}
.ml-read-body {
  flex: 1;
  overflow-y: auto;
  padding: 16px 18px;
  font-size: 14px;
  line-height: 1.5;
}
.ml-read-body p {
  margin: 0 0 0.6em;
}
.ml-atts {
  padding: 0 18px 18px;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}
.ml-att-image img {
  max-width: 280px;
  max-height: 200px;
  border-radius: 6px;
  border: 1px solid var(--border);
}
.ml-att-card,
.ml-pdf-card {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--surface-raised);
  text-decoration: none;
  color: inherit;
  max-width: 280px;
}
.ml-pdf-card {
  flex-direction: column;
  align-items: stretch;
  padding: 0;
  overflow: hidden;
}
.ml-pdf-head {
  display: flex;
  gap: 8px;
  align-items: center;
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
}
.ml-pdf-head span {
  display: flex;
  flex-direction: column;
  min-width: 0;
}
.ml-pdf-body {
  background: var(--surface-hover);
  padding: 8px;
  display: flex;
  justify-content: center;
}
.ml-error {
  position: absolute;
  bottom: 12px;
  left: 18px;
  right: 18px;
  margin: 0;
}
.ml-topbar-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 32px;
  padding: 0 10px;
  border: 1px solid var(--border);
  border-radius: 4px;
  background: var(--surface);
  color: var(--text);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}
.ml-topbar-btn:hover {
  background: var(--primary-soft);
  border-color: #c7e0f4;
  color: var(--primary);
}
.ml-topbar-btn.has-unread {
  border-color: #ca5010;
  background: #fff4ce;
  color: #8a3711;
  font-weight: 800;
}
.ml-topbar-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  border-radius: 10px;
  background: #c4314b;
  color: #fff;
  font-size: 11px;
  font-weight: 800;
}
.ml-modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.4);
  z-index: 1300;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}
.ml-modal {
  width: min(720px, 100%);
  max-height: min(90vh, 820px);
  overflow-y: auto;
  background: var(--surface);
  border-radius: 6px;
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.22);
  padding: 16px 18px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.ml-modal-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.ml-modal-head h3 {
  margin: 0;
}

/* Full-page compose (replaces the popup) */
.ml-compose-page {
  display: flex;
  flex-direction: column;
  height: 100%;
  min-height: 0;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 6px;
  overflow: hidden;
}
.ml-compose-head {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  background: var(--surface-raised);
}
.ml-compose-head h2 {
  margin: 0;
  font-size: 18px;
  flex: 1;
}
.ml-compose-head-actions {
  display: flex;
  gap: 8px;
}
.ml-compose-body {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 16px 18px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.ml-compose-foot {
  display: flex;
  align-items: center;
  gap: 8px;
  padding-top: 4px;
}
.ml-people-field label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  margin-bottom: 4px;
}
.ml-chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 6px 8px;
  min-height: 38px;
}
.ml-chip-row input {
  border: 0;
  outline: none;
  flex: 1;
  min-width: 120px;
  font-size: 13px;
}
.ml-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: var(--primary-soft);
  color: var(--primary-darker);
  border-radius: 12px;
  padding: 2px 8px;
  font-size: 12px;
  font-weight: 600;
}
.ml-chip button {
  border: 0;
  background: transparent;
  cursor: pointer;
  font-size: 14px;
  line-height: 1;
  color: inherit;
}
.ml-chip.external {
  background: var(--primary-soft);
  color: var(--primary-darker);
}
.ml-mailbox-box {
  margin-top: auto;
  padding: 12px 10px;
  border-top: 1px solid var(--border);
}
.ml-mailbox-toggle {
  width: 100%;
  text-align: left;
  border: 0;
  background: transparent;
  font-size: 12px;
  font-weight: 600;
  color: var(--text);
  cursor: pointer;
  padding: 6px 4px;
}
.ml-mailbox-panel {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 8px;
}
.ml-mailbox-panel input {
  font-size: 12px;
  padding: 6px 8px;
  border: 1px solid var(--border);
  border-radius: 4px;
}
.ml-mailbox-panel label {
  font-size: 11px;
  font-weight: 600;
}
.ml-mailbox-hint,
.ml-mailbox-msg {
  font-size: 11px;
  margin: 0;
  line-height: 1.35;
}
.ml-mailbox-actions {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}
.ml-channel-tag {
  font-size: 10px;
  font-weight: 600;
  color: var(--primary-darker);
  background: var(--primary-soft);
  border-radius: 3px;
  padding: 1px 5px;
  margin-left: 6px;
}
.ml-people-suggest {
  border: 1px solid var(--border);
  border-radius: 4px;
  max-height: 160px;
  overflow-y: auto;
  margin-top: 4px;
}
.ml-people-suggest button {
  display: flex;
  flex-direction: column;
  width: 100%;
  text-align: left;
  border: 0;
  border-bottom: 1px solid var(--border);
  background: var(--surface);
  padding: 8px 10px;
  cursor: pointer;
}
.ml-people-suggest button:hover {
  background: var(--surface-hover);
}
.ml-pending {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.ml-pending-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--surface-hover);
  border-radius: 4px;
  padding: 4px 8px;
  font-size: 12px;
}
.ml-pending-item button {
  border: 0;
  background: transparent;
  cursor: pointer;
}
.ml-modal-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  padding-top: 4px;
}
.ml-modal-spacer {
  flex: 1;
}
@media (max-width: 960px) {
  .ml-shell {
    grid-template-columns: 1fr;
    max-height: none;
  }
  .ml-folders,
  .ml-list-pane {
    border-right: none;
    border-bottom: 1px solid var(--border);
  }
  .ml-list-pane {
    max-height: 40vh;
  }
  .ml-topbar-label {
    display: none;
  }
}

/* ---- Per-employee theme picker (header) ---- */
.theme-picker {
  position: relative;
}
.theme-picker-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  border-radius: 4px;
  padding: 0 10px;
  min-height: 32px;
  cursor: pointer;
  font-size: 13px;
}
.theme-picker-btn:hover,
.theme-picker-btn.open {
  background: var(--sidebar-hover);
  border-color: var(--primary);
}
.theme-picker-panel {
  position: absolute;
  right: 0;
  top: calc(100% + 8px);
  width: 280px;
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.18);
  padding: 12px;
  z-index: 1400;
}
.theme-picker-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 6px;
}
.theme-picker-hint {
  margin: 0 0 10px;
  font-size: 12px;
}
.theme-mode-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-bottom: 12px;
}
.theme-mode-btn {
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text);
  border-radius: 6px;
  padding: 8px;
  cursor: pointer;
  font-size: 13px;
}
.theme-mode-btn.active {
  border-color: var(--primary);
  background: color-mix(in srgb, var(--primary) 18%, transparent);
  color: var(--primary-darker);
  font-weight: 600;
}
html[data-theme="dark"] .theme-mode-btn.active {
  color: #fff;
}
.theme-color-label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  margin-bottom: 6px;
}
.theme-swatches {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 12px;
}
.theme-swatch {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 2px solid transparent;
  cursor: pointer;
  padding: 0;
}
.theme-swatch.active {
  border-color: var(--text);
  box-shadow: 0 0 0 2px var(--surface), 0 0 0 4px var(--primary);
}
.theme-swatch.custom {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: conic-gradient(red, yellow, lime, aqua, blue, magenta, red);
  overflow: hidden;
}
.theme-swatch.custom input {
  opacity: 0;
  width: 100%;
  height: 100%;
  cursor: pointer;
  border: 0;
  padding: 0;
}
.theme-picker-foot {
  display: flex;
  justify-content: flex-end;
}
@media (max-width: 720px) {
  .theme-picker-label {
    display: none;
  }
}

/* ================================================================
   Professional dark theme
   One consistent neutral palette across ERP, PM, Chat, and Mail.
   ================================================================ */
html[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0b1220;
  --surface: #111827;
  --surface-raised: #182235;
  --surface-hover: #202c40;
  --sidebar: #0f172a;
  --sidebar-hover: #1e293b;
  --sidebar-active: var(--primary-soft);
  --text: #e5edf7;
  --heading: #f8fafc;
  --muted: #94a3b8;
  --border: #293548;
  --border-strong: #475569;
  --topbar-bg: #0f172a;
}

html[data-theme="dark"] body,
html[data-theme="dark"] .app-shell,
html[data-theme="dark"] .main,
html[data-theme="dark"] .content {
  background: var(--bg);
  color: var(--text);
}

html[data-theme="dark"] h1,
html[data-theme="dark"] h2,
html[data-theme="dark"] h3,
html[data-theme="dark"] h4,
html[data-theme="dark"] h5,
html[data-theme="dark"] h6,
html[data-theme="dark"] strong {
  color: var(--heading);
}

html[data-theme="dark"] .muted,
html[data-theme="dark"] small {
  color: var(--muted) !important;
}

/* Shell and navigation */
html[data-theme="dark"] .sidebar,
html[data-theme="dark"] .topbar {
  background: var(--sidebar);
  border-color: var(--border);
  box-shadow: none;
}


html[data-theme="dark"] .sidebar-rail {
  background: var(--sidebar);
  border-color: var(--border);
}

html[data-theme="dark"] .sidebar-rail-btn {
  color: #e2e8f0;
}

html[data-theme="dark"] .sidebar-rail-btn:hover,
html[data-theme="dark"] .sidebar-rail-btn.open {
  color: #f8fafc;
}

html[data-theme="dark"] .sidebar-panel {
  background: var(--sidebar);
}

html[data-theme="dark"] .sidebar-rail-tip {
  background: #f3f2f1;
  color: #201f1e;
  border: none;
}

html[data-theme="dark"] .ui-hover-tip {
  background: #f3f2f1;
  color: #201f1e;
}

html[data-theme="dark"] .ui-hover-tip::after {
  border-top-color: #f3f2f1;
}

html[data-theme="dark"] .sidebar-rail-tip::before {
  border-right-color: #f3f2f1;
}

html[data-theme="dark"] .sidebar-rail-tip.is-floating::before {
  border-right-color: #f3f2f1;
}

html[data-theme="dark"] .sidebar-rail-user-menu,
html[data-theme="dark"] .sidebar-rail-tray {
  background: var(--surface);
  border-color: var(--border);
}

html[data-theme="dark"] .sidebar.two-col .nav-section {
  background: color-mix(in srgb, var(--primary) 18%, var(--surface));
  color: var(--text);
}

html[data-theme="dark"] .sidebar.two-col .nav-link,
html[data-theme="dark"] .sidebar.two-col .nav-ico {
  color: #e2e8f0;
}

html[data-theme="dark"] .sidebar .brand {
  background: var(--sidebar);
  border-color: var(--border);
}

html[data-theme="dark"] .nav-group + .nav-group {
  border-color: var(--border);
}

html[data-theme="dark"] .nav-link,
html[data-theme="dark"] .nav-parent-link,
html[data-theme="dark"] .nav-caret-btn {
  color: #cbd5e1;
}

html[data-theme="dark"] .nav-section {
  color: var(--muted);
}

html[data-theme="dark"] .nav-link:hover,
html[data-theme="dark"] .nav-parent-link:hover,
html[data-theme="dark"] .nav-caret-btn:hover {
  color: var(--heading);
  background: var(--sidebar-hover);
}

html[data-theme="dark"] .nav-link.active {
  color: var(--heading);
  background: var(--primary-soft);
  border-left-color: var(--primary);
}

html[data-theme="dark"] .nav-link.active .nav-ico,
html[data-theme="dark"] .nav-link.active svg {
  color: var(--primary);
}

html[data-theme="dark"] .topbar .title,
html[data-theme="dark"] .topbar .user,
html[data-theme="dark"] .back-btn {
  color: var(--heading);
}

html[data-theme="dark"] .back-btn:hover {
  color: var(--heading);
  background: var(--surface-hover);
  border-color: var(--primary);
}

html[data-theme="dark"] .badge {
  color: var(--heading);
  background: var(--primary-soft);
  border: 1px solid color-mix(in srgb, var(--primary) 55%, transparent);
}

/* Surfaces, panels, KPI cards */
html[data-theme="dark"] .panel,
html[data-theme="dark"] .card,
html[data-theme="dark"] .modal,
html[data-theme="dark"] .rm-report-card,
html[data-theme="dark"] .ra-filters {
  background: var(--surface);
  color: var(--text);
  border-color: var(--border) !important;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.24);
}

/* Work Items / PM filter toolbars (light #fafafa otherwise) */
html[data-theme="dark"] .wi-toolbar,
html[data-theme="dark"] .pm-filter-bar,
html[data-theme="dark"] .ra-filters-row {
  background: var(--surface-raised) !important;
  border-color: var(--border) !important;
  color: var(--text);
}

html[data-theme="dark"] .col-picker-panel {
  background: var(--surface);
  border-color: var(--border);
}

html[data-theme="dark"] .wi-date-field input[type="date"] {
  background-color: color-mix(in srgb, var(--surface-hover) 88%, #000);
  border-color: color-mix(in srgb, var(--border) 70%, #94a3b8);
  color: var(--heading);
}

html[data-theme="dark"] .wi-filters select,
html[data-theme="dark"] .wi-search,
html[data-theme="dark"] .wi-filters .ss-control,
html[data-theme="dark"] .pm-filter-bar .field input,
html[data-theme="dark"] .pm-filter-bar .field select,
html[data-theme="dark"] .pm-filter-bar .field .ss-control {
  background-color: color-mix(in srgb, var(--surface-hover) 88%, #000) !important;
  color: var(--heading) !important;
  border-color: color-mix(in srgb, var(--border) 70%, #94a3b8) !important;
}

html[data-theme="dark"] .pm-filter-actions .btn,
html[data-theme="dark"] .ra-filters-row > .btn {
  background: color-mix(in srgb, var(--surface-hover) 70%, #000) !important;
  color: var(--heading) !important;
  border: none !important;
  box-shadow: none;
}

html[data-theme="dark"] .pm-filter-actions .btn:hover,
html[data-theme="dark"] .ra-filters-row > .btn:hover {
  background: color-mix(in srgb, var(--surface-hover) 50%, #000) !important;
  border: none !important;
}

html[data-theme="dark"] .wi-table th {
  background: var(--surface-raised) !important;
  color: #a9b7ca !important;
  border-color: var(--border) !important;
}

html[data-theme="dark"] .card:hover,
html[data-theme="dark"] .card-clickable:hover,
html[data-theme="dark"] .rm-report-card:hover {
  background: var(--surface-raised);
  box-shadow: 0 16px 36px rgba(0, 0, 0, 0.38), 0 4px 12px rgba(0, 0, 0, 0.22);
}

html[data-theme="dark"] .ui-btn:not(.ui-btn--solid) {
  border: none;
}

html[data-theme="dark"] .ui-btn--edit,
html[data-theme="dark"] .ui-btn--primary-soft {
  background: color-mix(in srgb, #185abc 22%, var(--surface));
  color: #8ab4f8;
}

html[data-theme="dark"] .ui-btn--invite,
html[data-theme="dark"] .ui-btn--purple {
  background: color-mix(in srgb, #9c6ade 22%, var(--surface));
  color: #d7b8ff;
}

html[data-theme="dark"] .ui-btn--docs,
html[data-theme="dark"] .ui-btn--amber {
  background: color-mix(in srgb, #c19c00 20%, var(--surface));
  color: #f2d060;
}

html[data-theme="dark"] .ui-btn--open,
html[data-theme="dark"] .ui-btn--green {
  background: color-mix(in srgb, #0b6a0b 22%, var(--surface));
  color: #81c995;
}

html[data-theme="dark"] .ui-btn--danger,
html[data-theme="dark"] .ui-btn--delete {
  background: color-mix(in srgb, #a4262c 22%, var(--surface));
  color: #f28b82;
}

html[data-theme="dark"] .ui-btn--neutral {
  background: var(--surface-hover);
  color: var(--text);
}

html[data-theme="dark"] .card .value,
html[data-theme="dark"] .pm-stat .value,
html[data-theme="dark"] .card-link,
html[data-theme="dark"] .rm-report-card-title {
  color: var(--primary);
}

html[data-theme="dark"] .card .label {
  color: var(--muted);
}

html[data-theme="dark"] .pm-stat-icon {
  color: var(--primary);
  background: color-mix(in srgb, var(--primary) 18%, var(--surface));
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--primary) 28%, transparent);
  border: none;
}

html[data-theme="dark"] .export-btn {
  color: var(--text);
}

html[data-theme="dark"] .export-btn--excel {
  background: color-mix(in srgb, #2e7d32 22%, var(--surface));
  border-color: color-mix(in srgb, #2e7d32 40%, var(--border));
}

html[data-theme="dark"] .export-btn--csv {
  background: color-mix(in srgb, #1565c0 22%, var(--surface));
  border-color: color-mix(in srgb, #1565c0 40%, var(--border));
}

html[data-theme="dark"] .export-btn--pdf {
  background: color-mix(in srgb, #c62828 22%, var(--surface));
  border-color: color-mix(in srgb, #c62828 40%, var(--border));
}

html[data-theme="dark"] .export-btn--print {
  background: color-mix(in srgb, #7b1fa2 22%, var(--surface));
  border-color: color-mix(in srgb, #7b1fa2 40%, var(--border));
}

/* Tables */
html[data-theme="dark"] table {
  color: var(--text);
  background: transparent;
}

html[data-theme="dark"] th {
  color: #a9b7ca;
  background: var(--surface-raised);
  border-color: var(--border);
}

html[data-theme="dark"] td {
  color: var(--text);
  background: transparent;
  border-color: var(--border);
}

html[data-theme="dark"] tbody tr {
  background: transparent;
}

html[data-theme="dark"] tbody tr:hover,
html[data-theme="dark"] .pm-dash-project-row:hover,
html[data-theme="dark"] .wi-table tr:hover,
html[data-theme="dark"] .pm-projects-table tbody tr:hover,
html[data-theme="dark"] .pm-page tbody tr:hover,
html[data-theme="dark"] .code-table tbody tr:hover {
  background: var(--surface-hover) !important;
}

/* Light-theme hover paints the <td> — must override that in dark mode */
html[data-theme="dark"] tbody tr:hover td,
html[data-theme="dark"] .pm-dash-project-row:hover td,
html[data-theme="dark"] .wi-table tr:hover td,
html[data-theme="dark"] .pm-projects-table tbody tr:hover td,
html[data-theme="dark"] .pm-page tbody tr:hover td,
html[data-theme="dark"] table tbody tr:hover > td {
  background: var(--surface-hover) !important;
  color: var(--heading) !important;
}

html[data-theme="dark"] tbody tr:hover td a,
html[data-theme="dark"] tbody tr:hover td .muted,
html[data-theme="dark"] tbody tr:hover td strong {
  color: inherit;
}

html[data-theme="dark"] tbody tr:hover td a {
  color: var(--primary) !important;
}

html[data-theme="dark"] .sortable-th:hover {
  color: var(--primary);
  background: color-mix(in srgb, var(--primary) 10%, var(--surface-raised));
}

/* Buttons and controls */
html[data-theme="dark"] .btn {
  color: #ffffff;
  background: var(--primary-dark);
  border-color: var(--primary);
}

html[data-theme="dark"] .btn:hover {
  color: #ffffff;
  background: var(--primary);
  border-color: var(--primary);
}

html[data-theme="dark"] .btn.secondary,
html[data-theme="dark"] .theme-picker-btn,
html[data-theme="dark"] .tc-topbar-btn,
html[data-theme="dark"] .ml-topbar-btn,
html[data-theme="dark"] .ai-topbar-btn {
  color: var(--text);
  background: var(--surface-raised);
  border-color: var(--border-strong);
}

html[data-theme="dark"] .btn.secondary:hover,
html[data-theme="dark"] .theme-picker-btn:hover,
html[data-theme="dark"] .tc-topbar-btn:hover,
html[data-theme="dark"] .ml-topbar-btn:hover,
html[data-theme="dark"] .ai-topbar-btn:hover {
  color: var(--heading);
  background: var(--surface-hover);
  border-color: var(--primary);
}

html[data-theme="dark"] input,
html[data-theme="dark"] select,
html[data-theme="dark"] textarea,
html[data-theme="dark"] .ss-control,
html[data-theme="dark"] .sms-control {
  color: var(--heading);
  background-color: color-mix(in srgb, var(--surface-hover) 88%, #000);
  border-color: color-mix(in srgb, var(--border) 70%, #94a3b8);
  box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.28);
}

html[data-theme="dark"] select:not([multiple]) {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3E%3Cpath stroke='%2394a3b8' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='M6 8l4 4 4-4'/%3E%3C/svg%3E");
}

html[data-theme="dark"] input::placeholder,
html[data-theme="dark"] textarea::placeholder {
  color: var(--muted);
}

html[data-theme="dark"] input:focus,
html[data-theme="dark"] select:focus,
html[data-theme="dark"] textarea:focus,
html[data-theme="dark"] .ss-control:focus-within,
html[data-theme="dark"] .sms-control:focus-within {
  outline: none;
  border-color: var(--primary, #0078d4);
  box-shadow:
    0 0 0 3px color-mix(in srgb, var(--primary, #0078d4) 35%, transparent),
    0 1px 2px 0 rgba(0, 0, 0, 0.28);
}

/* Theme panel */
html[data-theme="dark"] .theme-picker-panel {
  background: var(--surface-raised);
  border-color: var(--border-strong);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.48);
}

html[data-theme="dark"] .theme-mode-btn {
  color: var(--text);
  background: var(--surface);
  border-color: var(--border);
}

html[data-theme="dark"] .theme-mode-btn:hover {
  background: var(--surface-hover);
}

html[data-theme="dark"] .theme-mode-btn.active {
  color: var(--heading);
  background: var(--primary-soft);
  border-color: var(--primary);
}

/* Chat */
html[data-theme="dark"] .tc-shell,
html[data-theme="dark"] .tc-main {
  background: var(--bg);
  color: var(--text);
  border-color: var(--border);
}

html[data-theme="dark"] .tc-sidebar,
html[data-theme="dark"] .tc-thread-head,
html[data-theme="dark"] .tc-composer {
  background: var(--surface);
  color: var(--text);
  border-color: var(--border);
}

html[data-theme="dark"] .tc-sidebar-head h2,
html[data-theme="dark"] .tc-thread-head h3,
html[data-theme="dark"] .tc-list-title {
  color: var(--heading);
}

html[data-theme="dark"] .tc-list-item {
  color: var(--text);
}

html[data-theme="dark"] .tc-list-item:hover {
  background: var(--surface-hover);
}

html[data-theme="dark"] .tc-list-item.active,
html[data-theme="dark"] .tc-list-item.unread.active {
  background: var(--primary-soft);
}

html[data-theme="dark"] .tc-list-item.unread {
  background: color-mix(in srgb, var(--primary) 8%, transparent);
}

html[data-theme="dark"] .tc-list-item.unread .tc-list-title,
html[data-theme="dark"] .tc-list-item.unread .tc-preview {
  color: var(--heading);
}

html[data-theme="dark"] .tc-preview,
html[data-theme="dark"] .tc-thread-head p {
  color: var(--muted);
}

html[data-theme="dark"] .tc-messages {
  background: var(--bg);
}

html[data-theme="dark"] .tc-bubble {
  color: var(--text);
  background: var(--surface-raised);
  border-color: var(--border);
  box-shadow: none;
}

html[data-theme="dark"] .tc-bubble-row.mine .tc-bubble {
  color: var(--heading);
  background: var(--primary-soft);
  border-color: color-mix(in srgb, var(--primary) 55%, var(--border));
}

html[data-theme="dark"] .tc-bubble-body {
  color: inherit;
}

html[data-theme="dark"] .tc-composer-box,
html[data-theme="dark"] .tc-reply-banner,
html[data-theme="dark"] .tc-pending-file {
  color: var(--text);
  background: #0d1626;
  border-color: var(--border);
}

html[data-theme="dark"] .tc-icon-btn {
  color: var(--muted);
}

html[data-theme="dark"] .tc-icon-btn:hover,
html[data-theme="dark"] .tc-icon-btn.on {
  color: var(--heading);
  background: var(--surface-hover);
}

/* Mail */
html[data-theme="dark"] .ml-shell,
html[data-theme="dark"] .ml-read-pane,
html[data-theme="dark"] .ml-compose-page {
  color: var(--text);
  background: var(--bg);
  border-color: var(--border);
}

html[data-theme="dark"] .ml-folders,
html[data-theme="dark"] .ml-list-pane,
html[data-theme="dark"] .ml-compose-head {
  color: var(--text);
  background: var(--surface);
  border-color: var(--border);
}

html[data-theme="dark"] .ml-folder {
  color: var(--text);
}

html[data-theme="dark"] .ml-folder:hover,
html[data-theme="dark"] .ml-list-item:hover {
  background: var(--surface-hover);
}

html[data-theme="dark"] .ml-folder.active,
html[data-theme="dark"] .ml-list-item.active {
  color: var(--heading);
  background: var(--primary-soft);
}

html[data-theme="dark"] .ml-list-item {
  color: var(--text);
  background: var(--surface);
  border-color: var(--border);
}

html[data-theme="dark"] .ml-list-item.unread .ml-list-from,
html[data-theme="dark"] .ml-list-item.unread .ml-list-subject {
  color: var(--heading);
}

html[data-theme="dark"] .ml-list-head,
html[data-theme="dark"] .ml-read-head,
html[data-theme="dark"] .ml-mailbox-box {
  border-color: var(--border);
}

html[data-theme="dark"] .ml-mailbox-toggle {
  color: var(--text);
}

html[data-theme="dark"] .ml-chip-row {
  color: var(--text);
  background: #0d1626;
  border-color: var(--border-strong);
}

html[data-theme="dark"] .ml-people-suggest {
  color: var(--text);
  background: var(--surface-raised);
  border-color: var(--border);
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.36);
}

html[data-theme="dark"] .ml-people-suggest button {
  color: var(--text);
  background: transparent;
}

html[data-theme="dark"] .ml-people-suggest button:hover {
  background: var(--surface-hover);
}

/* Status chips and semantic tints: keep the hue, darken the surface. */
html[data-theme="dark"] .wif-banner-error {
  background: color-mix(in srgb, #fde7e9 22%, var(--surface)) !important;
  color: color-mix(in srgb, #a4262c 45%, #ffffff) !important;
  border-color: color-mix(in srgb, #f1aeb5 40%, var(--border)) !important;
}

html[data-theme="dark"] .wif-banner-success {
  background: color-mix(in srgb, #dff6dd 22%, var(--surface)) !important;
  color: color-mix(in srgb, #0b6a0b 45%, #ffffff) !important;
  border-color: color-mix(in srgb, #9fd89f 40%, var(--border)) !important;
}

html[data-theme="dark"] .ra-avail-leave td {
  background: color-mix(in srgb, #fdf2f2 22%, var(--surface)) !important;
  color: color-mix(in srgb, #922b21 45%, #ffffff) !important;
}

html[data-theme="dark"] .pill.green {
  background: color-mix(in srgb, #dcfce7 22%, var(--surface)) !important;
  color: color-mix(in srgb, #166534 45%, #ffffff) !important;
}

html[data-theme="dark"] .pill.red {
  background: color-mix(in srgb, #fee2e2 22%, var(--surface)) !important;
  color: color-mix(in srgb, #991b1b 45%, #ffffff) !important;
}

html[data-theme="dark"] .pill.amber {
  background: color-mix(in srgb, #fef3c7 22%, var(--surface)) !important;
  color: color-mix(in srgb, #92400e 45%, #ffffff) !important;
}

html[data-theme="dark"] .cp-day.cp-weekend {
  background: color-mix(in srgb, #f5c6cb 22%, var(--surface)) !important;
  color: var(--text) !important;
}

html[data-theme="dark"] .cp-day.cp-holiday-col {
  background: color-mix(in srgb, #fdebd0 22%, var(--surface)) !important;
  color: var(--text) !important;
}

html[data-theme="dark"] .cp-holiday {
  background: color-mix(in srgb, #e67e22 70%, var(--surface)) !important;
  color: #fff !important;
}

html[data-theme="dark"] .cp-idle {
  background: color-mix(in srgb, #f5c6cb 22%, var(--surface)) !important;
  color: var(--text) !important;
}

html[data-theme="dark"] .feed-notice-strip.is-update {
  background: color-mix(in srgb, #fff4ce 22%, var(--surface)) !important;
  color: var(--text) !important;
  border-color: color-mix(in srgb, #f0e0a0 40%, var(--border)) !important;
}

html[data-theme="dark"] .feed-notice-strip.is-call {
  background: color-mix(in srgb, #dff6dd 22%, var(--surface)) !important;
  color: var(--text) !important;
  border-color: color-mix(in srgb, #a7e3a5 40%, var(--border)) !important;
}

html[data-theme="dark"] .feed-notice-strip.is-mail {
  background: color-mix(in srgb, #fff4ce 22%, var(--surface)) !important;
  color: var(--text) !important;
  border-color: color-mix(in srgb, #f0e0a0 40%, var(--border)) !important;
}

html[data-theme="dark"] .feed-icon-btn.recording {
  background: color-mix(in srgb, #fde7e9 22%, var(--surface)) !important;
  color: color-mix(in srgb, #a4262c 45%, #ffffff) !important;
}

html[data-theme="dark"] .feed-delete-btn:hover:not(:disabled) {
  background: color-mix(in srgb, #fde7e9 22%, var(--surface)) !important;
  color: var(--text) !important;
}

html[data-theme="dark"] .feed-voice-btn.recording {
  background: color-mix(in srgb, #fde7e9 22%, var(--surface)) !important;
  color: color-mix(in srgb, #a4262c 45%, #ffffff) !important;
  border-color: color-mix(in srgb, #a4262c 40%, var(--border)) !important;
}

html[data-theme="dark"] .chip.add {
  background: color-mix(in srgb, #e6ffec 22%, var(--surface)) !important;
  color: color-mix(in srgb, #1a7f37 45%, #ffffff) !important;
}

html[data-theme="dark"] .chip.del {
  background: color-mix(in srgb, #ffebe9 22%, var(--surface)) !important;
  color: color-mix(in srgb, #cf222e 45%, #ffffff) !important;
}

html[data-theme="dark"] .btn.secondary.small.danger:hover {
  background: color-mix(in srgb, #ffebe9 22%, var(--surface)) !important;
  color: var(--text) !important;
}

html[data-theme="dark"] .merge-resolve-ready {
  background: color-mix(in srgb, #e6ffec 22%, var(--surface)) !important;
  color: color-mix(in srgb, #1a7f37 45%, #ffffff) !important;
  border-color: color-mix(in srgb, #abf2bc 40%, var(--border)) !important;
}

html[data-theme="dark"] .merge-file-item.active {
  background: color-mix(in srgb, #ffebe9 22%, var(--surface)) !important;
  color: var(--text) !important;
}

html[data-theme="dark"] .status-A {
  background: color-mix(in srgb, #e6ffec 22%, var(--surface)) !important;
  color: color-mix(in srgb, #1a7f37 45%, #ffffff) !important;
}

html[data-theme="dark"] .status-M {
  background: color-mix(in srgb, #fff8c5 22%, var(--surface)) !important;
  color: color-mix(in srgb, #9a6700 45%, #ffffff) !important;
}

html[data-theme="dark"] .status-D {
  background: color-mix(in srgb, #ffebe9 22%, var(--surface)) !important;
  color: color-mix(in srgb, #cf222e 45%, #ffffff) !important;
}

html[data-theme="dark"] .pr-approved {
  background: color-mix(in srgb, #e6ffec 22%, var(--surface)) !important;
  color: color-mix(in srgb, #1a7f37 45%, #ffffff) !important;
}

html[data-theme="dark"] .pr-rejected {
  background: color-mix(in srgb, #ffebe9 22%, var(--surface)) !important;
  color: color-mix(in srgb, #cf222e 45%, #ffffff) !important;
}

html[data-theme="dark"] .pr-merged {
  background: color-mix(in srgb, #f3e8ff 22%, var(--surface)) !important;
  color: color-mix(in srgb, #8250df 45%, #ffffff) !important;
}

html[data-theme="dark"] .pr-closed {
  background: color-mix(in srgb, #f0f2f5 22%, var(--surface)) !important;
  color: var(--text) !important;
}

html[data-theme="dark"] .rm-flash-success {
  background: color-mix(in srgb, #ecfdf5 22%, var(--surface)) !important;
  color: color-mix(in srgb, #065f46 45%, #ffffff) !important;
  border-color: color-mix(in srgb, #a7f3d0 40%, var(--border)) !important;
}

html[data-theme="dark"] .rm-flash-error {
  background: color-mix(in srgb, #fef2f2 22%, var(--surface)) !important;
  color: color-mix(in srgb, #991b1b 45%, #ffffff) !important;
  border-color: color-mix(in srgb, #fecaca 40%, var(--border)) !important;
}

html[data-theme="dark"] .rm-cal-available {
  background: color-mix(in srgb, #dcfce7 22%, var(--surface)) !important;
  color: color-mix(in srgb, #166534 45%, #ffffff) !important;
}

html[data-theme="dark"] .rm-cal-leave {
  background: color-mix(in srgb, #fef3c7 22%, var(--surface)) !important;
  color: color-mix(in srgb, #92400e 45%, #ffffff) !important;
}

html[data-theme="dark"] .panel.success {
  background: color-mix(in srgb, #dff6dd 22%, var(--surface)) !important;
  color: color-mix(in srgb, #0b6a0b 45%, #ffffff) !important;
  border-color: color-mix(in srgb, #9fd89f 40%, var(--border)) !important;
}

html[data-theme="dark"] .pm-health-green {
  background: color-mix(in srgb, #dff6dd 22%, var(--surface)) !important;
  color: color-mix(in srgb, #107c10 45%, #ffffff) !important;
}

html[data-theme="dark"] .pm-health-yellow {
  background: color-mix(in srgb, #fff4ce 22%, var(--surface)) !important;
  color: color-mix(in srgb, #8a6914 45%, #ffffff) !important;
}

html[data-theme="dark"] .pm-health-red {
  background: color-mix(in srgb, #fde7e9 22%, var(--surface)) !important;
  color: color-mix(in srgb, #a4262c 45%, #ffffff) !important;
}

html[data-theme="dark"] .pm-heatmap .cell-green {
  background: color-mix(in srgb, #dff6dd 22%, var(--surface)) !important;
  color: var(--text) !important;
}

html[data-theme="dark"] .pm-heatmap .cell-yellow {
  background: color-mix(in srgb, #fff4ce 22%, var(--surface)) !important;
  color: var(--text) !important;
}

html[data-theme="dark"] .pm-heatmap .cell-red {
  background: color-mix(in srgb, #fde7e9 22%, var(--surface)) !important;
  color: var(--text) !important;
}

html[data-theme="dark"] .tc-realtime-banner {
  background: color-mix(in srgb, #fff8e6 22%, var(--surface)) !important;
  color: color-mix(in srgb, #7a5b00 45%, #ffffff) !important;
  border-color: color-mix(in srgb, #f0d78c 40%, var(--border)) !important;
}

html[data-theme="dark"] .tc-topbar-btn.has-unread {
  background: color-mix(in srgb, #fde7e9 22%, var(--surface)) !important;
  color: color-mix(in srgb, #a4262c 45%, #ffffff) !important;
  border-color: color-mix(in srgb, #c4314b 40%, var(--border)) !important;
}

html[data-theme="dark"] .ml-topbar-btn.has-unread {
  background: color-mix(in srgb, #fff4ce 22%, var(--surface)) !important;
  color: color-mix(in srgb, #8a3711 45%, #ffffff) !important;
  border-color: color-mix(in srgb, #ca5010 40%, var(--border)) !important;
}

html[data-theme="dark"] .report-total-row td {
  background: color-mix(in srgb, #f8fafc 12%, var(--surface)) !important;
  border-top-color: var(--border) !important;
  color: var(--text) !important;
}

html[data-theme="dark"] .ui-alert-success {
  background: color-mix(in srgb, #e8f5e9 18%, var(--surface)) !important;
  border-color: color-mix(in srgb, #a5d6a7 35%, var(--border)) !important;
  color: color-mix(in srgb, #1b5e20 40%, #ffffff) !important;
}

html[data-theme="dark"] .ui-alert-error {
  background: color-mix(in srgb, #fdecea 18%, var(--surface)) !important;
  border-color: color-mix(in srgb, #f5c6cb 35%, var(--border)) !important;
  color: color-mix(in srgb, #b71c1c 40%, #ffffff) !important;
}

html[data-theme="dark"] .ui-alert-info {
  background: color-mix(in srgb, #e3f2fd 18%, var(--surface)) !important;
  border-color: color-mix(in srgb, #90caf9 35%, var(--border)) !important;
  color: color-mix(in srgb, #0d47a1 40%, #ffffff) !important;
}

/* Employee home (holidays / leave / remote / events / announcements) */
html[data-theme="dark"] .emp-home .eh-card {
  background: var(--surface-raised) !important;
  border-color: var(--border) !important;
  color: var(--text) !important;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.35);
}

html[data-theme="dark"] .emp-home .eh-card-head {
  border-bottom-color: var(--border) !important;
}

html[data-theme="dark"] .emp-home .eh-card-head h3 {
  color: var(--muted) !important;
}

html[data-theme="dark"] .emp-home .eh-holiday {
  background: linear-gradient(135deg, #0b4f86 0%, #0f6cbd 100%) !important;
  color: #fff !important;
  border: none !important;
}

html[data-theme="dark"] .emp-home .eh-holiday .eh-card-head {
  border-bottom-color: rgba(255, 255, 255, 0.22) !important;
}

html[data-theme="dark"] .emp-home .eh-holiday .eh-card-head h3,
html[data-theme="dark"] .emp-home .eh-holiday .muted,
html[data-theme="dark"] .emp-home .eh-holiday .eh-holiday-name,
html[data-theme="dark"] .emp-home .eh-holiday .eh-holiday-date {
  color: #fff !important;
}

html[data-theme="dark"] .emp-home .eh-person-name {
  color: var(--heading, #f3f4f6) !important;
}

html[data-theme="dark"] .emp-home .eh-person-sub,
html[data-theme="dark"] .emp-home .muted {
  color: var(--muted) !important;
}

html[data-theme="dark"] .emp-home .eh-tabs {
  border-bottom-color: var(--border) !important;
}

html[data-theme="dark"] .emp-home .eh-tab {
  color: var(--muted) !important;
}

html[data-theme="dark"] .emp-home .eh-tab.active {
  color: var(--primary) !important;
  border-bottom-color: var(--primary) !important;
}

html[data-theme="dark"] .emp-home .eh-balance {
  background: var(--surface) !important;
  border-color: var(--border) !important;
}

html[data-theme="dark"] .emp-home .eh-clock {
  background: linear-gradient(120deg, #0b4f86, #0f6cbd) !important;
}

html[data-theme="dark"] .emp-home .feed-card,
html[data-theme="dark"] .emp-home .feed-post {
  background: var(--surface) !important;
  border-color: var(--border) !important;
  color: var(--text) !important;
  box-shadow: none;
}

html[data-theme="dark"] .emp-home .feed-post-head {
  border-bottom-color: var(--border) !important;
}

html[data-theme="dark"] .emp-home .feed-composer-box {
  background: var(--surface) !important;
  border-color: var(--border) !important;
}

html[data-theme="dark"] .emp-home .feed-list {
  scrollbar-color: #4b5563 transparent;
}

html[data-theme="dark"] .emp-home .feed-list::-webkit-scrollbar-thumb {
  background: #4b5563;
}

html[data-theme="dark"] .emp-home .feed-list::-webkit-scrollbar-thumb:hover {
  background: #6b7280;
}

html[data-theme="dark"] .emp-home .feed-post-body,
html[data-theme="dark"] .emp-home .feed-post-body p,
html[data-theme="dark"] .emp-home .feed-post-body span,
html[data-theme="dark"] .emp-home .feed-post-body li,
html[data-theme="dark"] .emp-home .feed-post-body strong,
html[data-theme="dark"] .emp-home .feed-post-html,
html[data-theme="dark"] .emp-home .feed-post-html p,
html[data-theme="dark"] .emp-home .feed-post-html span,
html[data-theme="dark"] .emp-home .feed-post-html li,
html[data-theme="dark"] .emp-home .feed-post-html strong,
html[data-theme="dark"] .emp-home .feed-post-html b {
  color: var(--text) !important;
}

html[data-theme="dark"] .emp-home .feed-post-body a,
html[data-theme="dark"] .emp-home .feed-post-html a {
  color: #6cb8f6 !important;
}

html[data-theme="dark"] .emp-home .feed-post-html div,
html[data-theme="dark"] .emp-home .feed-post-html table,
html[data-theme="dark"] .emp-home .feed-post-html td {
  background-color: transparent !important;
  border-color: var(--border) !important;
}

html[data-theme="dark"] .emp-home .feed-post-modal {
  background: var(--surface-raised) !important;
  border-color: var(--border) !important;
  color: var(--text) !important;
}

html[data-theme="dark"] .emp-home .feed-banner,
html[data-theme="dark"] .emp-home .eh-banner {
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.35);
}

/* ── Manager / Team Dashboard ─────────────────────────── */
.manager-dash { max-width: 1200px; }

/* Section tabs (SUMMARY, ATTENDANCE, LEAVE, etc.) */
.mt-section-tabs {
  display: flex; gap: 0; border-bottom: 3px solid var(--border); margin-bottom: 0;
  background: var(--surface); padding: 0 4px; overflow-x: auto; scrollbar-width: thin;
}
.mt-section-tab {
  padding: 10px 18px; background: none; border: none; font-size: 12px; font-weight: 600;
  letter-spacing: 0.5px; cursor: pointer; color: var(--text-muted);
  border-bottom: 3px solid transparent; margin-bottom: -3px; transition: all 0.15s; white-space: nowrap;
}
.mt-section-tab:hover { color: var(--text); }
.mt-section-tab.active { color: var(--primary); border-bottom-color: var(--primary); }

/* Secondary tabs under each section */
.mt-subtabs {
  display: flex; gap: 8px; padding: 14px 0 4px; overflow-x: auto; scrollbar-width: thin;
}
.mt-subtab {
  padding: 9px 14px; border: 1px solid var(--border); background: var(--surface);
  border-radius: 10px; cursor: pointer; color: var(--text-muted); white-space: nowrap;
  font-size: 13px; font-weight: 500;
}
.mt-subtab.active {
  color: var(--primary); border-color: var(--primary);
  box-shadow: inset 0 -2px 0 var(--primary);
}

.md-top-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.md-leave-panel, .md-notin-panel { padding: 16px; }
.md-leave-panel h3, .md-notin-panel h3 { margin: 0 0 12px; font-size: 15px; }

.md-avatar-row { display: flex; gap: 14px; flex-wrap: wrap; align-items: flex-start; }
.md-avatar-item { display: flex; flex-direction: column; align-items: center; gap: 4px; width: 60px; }
.md-avatar-name { font-size: 11px; color: var(--text-muted); text-align: center; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 60px; }
.md-more-badge { display: flex; align-items: center; color: var(--primary); font-size: 13px; font-weight: 600; }

/* Team Calendar */
.team-cal-wrap { margin-top: 8px; }
.team-cal-header { font-size: 15px; margin-bottom: 8px; }
.team-cal-scroll { overflow-x: auto; }
.team-cal-table { border-collapse: collapse; width: 100%; font-size: 12px; }
.team-cal-table th, .team-cal-table td { padding: 4px 2px; text-align: center; min-width: 32px; }
.team-cal-name-col { text-align: left !important; min-width: 160px; white-space: nowrap; position: sticky; left: 0; background: var(--surface); z-index: 1; }
.team-cal-emp-name { font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 120px; display: inline-block; }
.team-cal-day-head { font-size: 11px; line-height: 1.2; }
.team-cal-day-head.weekend { color: var(--text-muted); }
.team-cal-day-head.today { color: var(--primary); font-weight: 700; }
.team-cal-cell.today { background: rgba(var(--primary-rgb, 99, 102, 241), 0.06); }
.team-cal-cell.marked { background: rgba(99, 102, 241, 0.03); }
.team-cal-marker {
  width: 24px;
  height: 24px;
  border-radius: 999px;
  margin: auto;
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  font-weight: 700;
  box-shadow: 0 2px 6px rgba(15, 23, 42, 0.14);
}
.team-cal-date {
  color: var(--text-muted);
  font-size: 11px;
  line-height: 24px;
}
.team-cal-legend { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 12px; font-size: 12px; color: var(--text-muted); }
.team-cal-legend-item { display: flex; align-items: center; gap: 4px; }
.team-cal-legend-dot { width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0; }

/* Employee Cards */
.emp-cards-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 16px; }
.emp-card {
  border: 1px solid var(--border); border-radius: 10px; padding: 16px;
  background: var(--surface); display: flex; flex-direction: column; gap: 6px;
}
.emp-card-top { display: flex; align-items: center; gap: 10px; }
.emp-card-badge {
  font-size: 10px; font-weight: 700; padding: 2px 8px; border-radius: 4px; text-transform: uppercase;
}
.emp-card-badge.red { background: #fdecea; color: #c0392b; }
.emp-card-badge.green { background: #eafaf1; color: #27ae60; }
.emp-card-name { font-weight: 600; font-size: 15px; margin-top: 4px; }
.emp-card-desg { font-size: 13px; }
.emp-card-info { font-size: 12px; color: var(--text-muted); }

.mt-perf-layout {
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
  gap: 16px;
  margin-top: 16px;
}
.mt-perf-side {
  padding: 0;
  overflow: hidden;
}
.mt-perf-side-head {
  padding: 14px 16px 10px;
  border-bottom: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.mt-perf-search {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
}
.mt-perf-search input {
  width: 100%;
}
.mt-perf-emp-list {
  max-height: 560px;
  overflow: auto;
}
.mt-perf-emp {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  border: 0;
  border-bottom: 1px solid var(--border);
  background: transparent;
  text-align: left;
  cursor: pointer;
}
.mt-perf-emp.active {
  background: rgba(var(--primary-rgb, 99, 102, 241), 0.08);
}
.mt-perf-emp-meta {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.mt-perf-emp-meta strong {
  font-size: 13px;
}
.mt-perf-emp-meta span {
  font-size: 12px;
  color: var(--text-muted);
}
.mt-perf-profile {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 10px;
}
.mt-perf-profile-meta {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.mt-subtabs--compact {
  padding-top: 0;
}
.mt-feedback-list {
  display: grid;
  gap: 12px;
}
.mt-feedback-card {
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 14px;
  background: var(--surface);
}
.mt-feedback-card-head {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: center;
  margin-bottom: 6px;
}
.mt-empty-state {
  min-height: 220px;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
}

@media (max-width: 900px) {
  .md-top-row { grid-template-columns: 1fr; }
  .mt-perf-layout { grid-template-columns: 1fr; }
}

/* ===== Premium shimmer loaders ===== */

@keyframes vx-shimmer {
  0% {
    background-position: 200% 0;
  }
  100% {
    background-position: -200% 0;
  }
}

.vx-shimmer {
  display: inline-block;
  max-width: 100%;
  background: linear-gradient(
    90deg,
    color-mix(in srgb, var(--surface-hover) 92%, #e5e7eb) 0%,
    color-mix(in srgb, var(--surface) 88%, #ffffff) 42%,
    color-mix(in srgb, var(--surface-hover) 92%, #e5e7eb) 84%
  );
  background-size: 200% 100%;
  animation: vx-shimmer 1.35s ease-in-out infinite;
}

.vx-shimmer--circle {
  flex-shrink: 0;
}

/* ---- Buttons ---- */
.vx-btn-loader {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.vx-btn-loader--inline {
  display: inline-flex;
}

.vx-btn-shimmer {
  display: inline-block;
  border-radius: 4px;
}

.vx-btn-shimmer--sm {
  width: 72px;
  height: 32px;
}

.vx-btn-shimmer--md {
  width: 96px;
  height: 36px;
}

.vx-btn-shimmer--lg {
  width: 120px;
  height: 40px;
}

/* ---- Cards ---- */
.vx-card-loader {
  --vx-card-cols: 4;
  grid-template-columns: repeat(var(--vx-card-cols), minmax(0, 1fr));
  pointer-events: none;
}

.vx-card-loader--second {
  margin-top: 0;
}

.vx-card-shimmer {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  min-height: 96px;
  padding: 16px 18px;
  border: 1px solid color-mix(in srgb, var(--border) 80%, transparent);
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
  overflow: hidden;
}

.vx-card-shimmer-body {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.vx-card-shimmer-label,
.vx-card-shimmer-value,
.vx-card-shimmer-hint {
  display: block;
}

.vx-card-shimmer-icon {
  flex-shrink: 0;
  opacity: 0.9;
}

/* ---- Table ---- */
.vx-table-loader {
  padding: 0;
  overflow: hidden;
  border: 1px solid color-mix(in srgb, var(--border) 85%, transparent);
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.05);
}

.vx-table-loader-wrap {
  margin: 0;
}

.vx-table-loader-table {
  margin: 0;
}

.vx-table-loader-table th,
.vx-table-loader-table td {
  padding: 14px 12px;
  vertical-align: middle;
}

.vx-table-loader-table thead th {
  background: color-mix(in srgb, var(--surface-raised) 88%, var(--surface));
  border-bottom: 1px solid var(--border);
}

.vx-table-loader-table tbody tr {
  border-bottom: 1px solid color-mix(in srgb, var(--border) 65%, transparent);
}

.vx-table-loader-table tbody tr:last-child {
  border-bottom: none;
}

.vx-table-shimmer-head,
.vx-table-shimmer-cell {
  display: block;
}

.vx-table-shimmer-actions {
  display: inline-flex;
  gap: 6px;
  align-items: center;
}

.vx-table-loader--compact .vx-table-loader-table th,
.vx-table-loader--compact .vx-table-loader-table td {
  padding: 10px 12px;
}

.vx-table-inline-loader-row td {
  padding: 12px 14px;
  vertical-align: middle;
}

.vx-table-inline-loader-row .vx-table-shimmer-cell {
  display: block;
}

/* ---- Form ---- */
.vx-form-loader {
  padding: 20px 22px 24px;
}

.vx-form-loader-head {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 18px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--border);
}

.vx-form-loader-grid {
  --vx-form-cols: 2;
  grid-template-columns: repeat(var(--vx-form-cols), minmax(0, 1fr));
}

.vx-form-loader-field {
  gap: 8px;
}

.vx-form-loader-input {
  display: block;
  width: 100%;
}

.vx-form-loader-actions {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}

/* ---- List ---- */
.vx-list-loader {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 4px 0;
}

.vx-list-loader-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 6px;
}

.vx-list-loader-lines {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.vx-list-loader-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

/* ---- Chart ---- */
.vx-chart-loader {
  overflow: hidden;
}

.vx-chart-loader-head {
  margin-bottom: 8px;
}

.vx-chart-loader-body {
  padding: 8px 4px 12px;
}

.vx-chart-loader-bars {
  display: block;
  width: 100%;
  opacity: 0.92;
}

/* ---- Page presets ---- */
.vx-page-loader {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.vx-page-loader--dashboard .pm-chart-grid {
  margin-bottom: 0;
}

.vx-page-loader--chart {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 16px;
}

.vx-page-loader-auth {
  min-height: 240px;
}

/* ---- Premium spinner (inline / auth) ---- */
.spinner {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  padding: 48px 24px;
  min-height: 120px;
  color: var(--muted);
}

.spinner-ring {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 3px solid color-mix(in srgb, var(--primary) 16%, transparent);
  border-top-color: var(--primary);
  animation: vx-spin 0.75s linear infinite;
}

.spinner-ring--sm {
  width: 22px;
  height: 22px;
  border-width: 2px;
}

.spinner-label {
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.01em;
  color: var(--muted);
}

@keyframes vx-spin {
  to {
    transform: rotate(360deg);
  }
}

/* Legacy alias — keep rm-skeleton working via table loader */
.rm-skeleton {
  display: none;
}

@media (max-width: 1100px) {
  .vx-card-loader {
    --vx-card-cols: 2;
  }
}

@media (max-width: 768px) {
  .vx-card-loader {
    --vx-card-cols: 1;
  }

  .vx-form-loader-grid {
    --vx-form-cols: 1;
  }
}

html[data-theme="dark"] .vx-shimmer {
  background: linear-gradient(
    90deg,
    color-mix(in srgb, var(--surface-hover) 90%, #000) 0%,
    color-mix(in srgb, var(--surface-raised) 80%, #334155) 45%,
    color-mix(in srgb, var(--surface-hover) 90%, #000) 90%
  );
  background-size: 200% 100%;
}

html[data-theme="dark"] .vx-card-shimmer,
html[data-theme="dark"] .vx-table-loader {
  border-color: var(--border);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.28);
}

html[data-theme="dark"] .vx-table-loader-table thead th {
  background: var(--surface-raised);
}

html[data-theme="dark"] .spinner-ring {
  border-color: color-mix(in srgb, var(--primary) 22%, transparent);
  border-top-color: var(--primary);
}
