html {
  font-size: 13.86px; /* 10% under 15.4px — scales rem-based type globally */
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

html,
body {
  height: 100%;
}

:root {
  /* LinkedIn-like primary */
  --hits-primary: #0a66c2;
  --hits-primary-hover: #004182;
  --hits-primary-rgb: 10, 102, 194;
  --hits-focus-ring: rgba(10, 102, 194, 0.25);
  --hits-btn-radius: 0.85rem;

  /* LinkedIn-like font stack */
  --hits-font-sans: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial,
    "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", sans-serif;
}

@media (min-width: 768px) {
  html {
    font-size: 15.84px; /* 10% under 17.6px */
  }
}

body {
  background: #f8f9fa;
  color: #1f2937;
  font-family: var(--hits-font-sans);
}

html[lang="ar"] body {
  font-family: "Segoe UI", "Noto Sans Arabic", "Arabic UI Text", "Tahoma", var(--hits-font-sans);
}

/* Global loading bar (navigation / API / realtime) */
.global-loading-bar {
  position: fixed;
  top: 0;
  inset-inline: 0;
  height: 3px;
  z-index: 2000;
  background: rgba(15, 23, 42, 0.06);
}

.global-loading-bar__inner {
  height: 100%;
  width: 35%;
  background: linear-gradient(90deg, rgba(255, 255, 255, 0), rgba(var(--hits-primary-rgb), 0.9), rgba(255, 255, 255, 0));
  transform: translateX(-60%);
  animation: hits-loading 0.95s ease-in-out infinite;
}

@keyframes hits-loading {
  0% { transform: translateX(-60%); opacity: 0.35; }
  50% { opacity: 1; }
  100% { transform: translateX(260%); opacity: 0.35; }
}

button,
input,
select,
textarea {
  font-family: inherit;
}

h1, h2, h3, h4, h5, h6 {
  font-family: var(--hits-font-sans);
  letter-spacing: -0.01em;
}

.login-shell {
  min-height: 100vh;
  min-height: 100dvh;
  background: #fff;
  display: flex;
  align-items: stretch;
  width: 100%;
  max-width: 100%;
}

.login-root {
  display: flex;
  width: 100%;
  min-height: 100vh;
}

.login-left,
.login-right {
  flex: 1 1 50%;
  min-width: 0;
}

.login-left {
  display: none;
  align-items: center;
  justify-content: center;
  padding: 3rem;
  background: linear-gradient(135deg, #eff6ff, #eef2ff);
}

.login-left-inner {
  max-width: 44rem;
  width: 100%;
  text-align: center;
}

.login-hero-card {
  background: #fff;
  border-radius: 1rem;
  padding: 2rem;
  box-shadow: 0 1.25rem 2.5rem rgba(15, 23, 42, 0.14);
}

.login-hero-illustration {
  width: 100%;
  height: auto;
  display: block;
}

.login-hero-title {
  margin: 1.75rem auto 0.75rem;
  font-size: 1.5rem;
  font-weight: 800;
  color: #0f172a;
}

.login-hero-subtitle {
  margin: 0 auto;
  max-width: 40rem;
  color: #475569;
}

.login-right {
  background: #fff;
  border-inline-start: 1px solid rgba(15, 23, 42, 0.08);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem;
  padding-left: max(2rem, env(safe-area-inset-left));
  padding-right: max(2rem, env(safe-area-inset-right));
  padding-bottom: max(2rem, env(safe-area-inset-bottom));
}

.login-right-inner {
  width: 100%;
  max-width: 28rem;
}

.login-brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1.75rem;
}

.login-brand-icon {
  width: 2.25rem;
  height: 2.25rem;
  border-radius: 0.6rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  background: var(--hits-primary);
}

.login-brand-title {
  font-weight: 800;
  letter-spacing: 0.02em;
}

.login-brand-subtitle {
  font-size: 0.85rem;
  color: #64748b;
}

.login-welcome {
  font-size: 1.6rem;
  font-weight: 800;
  margin-bottom: 0.25rem;
}

.login-input {
  border-radius: 0.8rem;
  border-color: #d1d5db;
}

.login-submit {
  border-radius: 0.85rem;
  padding: 0.9rem 1rem;
  background: var(--hits-primary);
  border-color: var(--hits-primary);
  box-shadow: 0 0.75rem 1.5rem rgba(var(--hits-primary-rgb), 0.25);
}

.login-submit:hover {
  background: var(--hits-primary-hover);
  border-color: var(--hits-primary-hover);
}

.login-link {
  color: #2563eb;
  text-decoration: none;
}

.login-link:hover {
  text-decoration: underline;
}

.login-hint {
  margin-top: 1.25rem;
  padding-top: 1.25rem;
  border-top: 1px dashed rgba(15, 23, 42, 0.15);
}

@media (min-width: 992px) {
  .login-left {
    display: flex;
  }
}

@media (max-width: 991.98px) {
  .login-root {
    flex-direction: column;
  }

  .login-right {
    border-inline-start: none;
    min-height: 100vh;
    min-height: 100dvh;
  }

  .login-form .form-control-lg {
    font-size: 16px;
  }
}

[dir="rtl"] .login-root {
  flex-direction: row-reverse;
}

@media (max-width: 991.98px) {
  [dir="rtl"] .login-root {
    flex-direction: column;
  }
}

.skip-link {
  position: absolute;
  inset-inline-start: 1rem;
  top: 0.5rem;
  z-index: 2000;
  padding: 0.5rem 0.75rem;
  color: #fff;
  background: var(--hits-primary);
  border-radius: 0.375rem;
  transform: translateY(-150%);
}

.skip-link:focus {
  transform: translateY(0);
}

.btn:focus,
.btn:active:focus,
.btn-link.nav-link:focus,
.form-control:focus,
.form-select:focus,
.form-check-input:focus {
  box-shadow: 0 0 0 0.1rem #fff, 0 0 0 0.25rem var(--hits-focus-ring);
}

/* Global primary button theme (match login button) */
.btn {
  border-radius: var(--hits-btn-radius);
}

.btn-primary {
  background: var(--hits-primary);
  border-color: var(--hits-primary);
  border-radius: var(--hits-btn-radius);
  box-shadow: 0 0.75rem 1.5rem rgba(var(--hits-primary-rgb), 0.18);
}

.btn-primary:hover,
.btn-primary:focus {
  background: var(--hits-primary-hover);
  border-color: var(--hits-primary-hover);
}

.btn-primary:active,
.btn-primary.active {
  background: var(--hits-primary-hover);
  border-color: var(--hits-primary-hover);
}

.btn-primary:disabled,
.btn-primary.disabled {
  background: var(--hits-primary);
  border-color: var(--hits-primary);
  opacity: 0.65;
  box-shadow: none;
}

/* Simple inline SVG charts (no external JS libs) */
.hits-donut {
  width: 7.25rem;
  height: 7.25rem;
}

.hits-donut__track {
  fill: none;
  stroke: rgba(15, 23, 42, 0.1);
  stroke-width: 12;
}

.hits-donut__value {
  fill: none;
  stroke: var(--hits-primary);
  stroke-width: 12;
  stroke-linecap: round;
  transform: rotate(-90deg);
  transform-origin: 60px 60px;
  stroke-dasharray: 0 999;
}

.hits-donut__label {
  font-weight: 800;
  font-size: 16.2px;
  fill: #0f172a;
}

.hits-mini-bars {
  width: 100%;
  height: auto;
}

.hits-mini-bars__axis {
  stroke: rgba(15, 23, 42, 0.12);
  stroke-width: 2;
}

.hits-mini-bars__bar {
  fill: rgba(var(--hits-primary-rgb), 0.22);
  stroke: rgba(var(--hits-primary-rgb), 0.65);
  stroke-width: 2;
}

.hits-mini-bars__value {
  font-weight: 800;
  font-size: 12.6px;
  fill: #0f172a;
}

.hits-mini-bars__caption {
  font-size: 10.8px;
  fill: #64748b;
}

.app-shell {
  min-height: 100vh;
  min-height: 100dvh;
  background: #f8f9fa;
  overflow-x: clip;
}

.app-topbar {
  position: sticky;
  top: 0;
  z-index: 1030;
  display: flex;
  align-items: center;
  gap: 1rem;
  min-height: 4rem;
  padding: max(0.75rem, env(safe-area-inset-top)) max(1rem, env(safe-area-inset-right)) 0.75rem max(1rem, env(safe-area-inset-left));
  background: #fff;
  border-bottom: 1px solid #dee2e6;
}

.hits-nav-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 2.75rem;
  min-height: 2.75rem;
  padding: 0.35rem 0.5rem;
  touch-action: manipulation;
}

.hits-nav-toggle .app-icon {
  width: 1.35rem;
  height: 1.35rem;
}

.hits-mobile-toolbar {
  padding-left: max(1rem, env(safe-area-inset-left));
  padding-right: max(1rem, env(safe-area-inset-right));
}

.app-sidebar.offcanvas-lg {
  --bs-offcanvas-width: min(22rem, calc(100vw - 1.25rem));
}

.brand-link,
.user-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  color: inherit;
  text-decoration: none;
}

.user-pill {
  min-height: 2.5rem;
  padding: 0.25rem 0.5rem;
  border-radius: 999px;
}

.brand-link small {
  display: block;
  color: #6c757d;
  font-size: 0.75rem;
  line-height: 1;
}

.app-icon {
  width: 1rem;
  height: 1rem;
  flex: 0 0 auto;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.brand-mark .app-icon {
  width: 1.25rem;
  height: 1.25rem;
}

.brand-mark,
.avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  color: #fff;
  font-weight: 700;
  background: linear-gradient(135deg, #0d6efd, #6f42c1);
}

.brand-mark {
  width: 2rem;
  height: 2rem;
  border-radius: 0.5rem;
}

.avatar {
  width: 2rem;
  height: 2rem;
  border-radius: 50%;
}

.mission-select {
  max-width: 12rem;
}

.search-box {
  flex: 1 1 auto;
  max-width: 28rem;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-inline-start: auto;
}

.topbar-actions .dropdown-menu {
  max-height: min(70vh, 28rem);
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

@media (min-width: 992px) {
  /* Base .offcanvas is visibility:hidden + fixed + off-screen; .offcanvas-lg lg rules do not undo that. */
  .app-sidebar.offcanvas-lg {
    display: flex;
    flex-direction: column;
    overflow: hidden;
    position: static;
    visibility: visible;
    transform: none;
  }

  .app-sidebar.offcanvas-lg .offcanvas-body {
    flex: 1 1 auto !important;
    flex-direction: column;
    min-height: 0;
    overflow-y: auto;
  }
}

.app-body {
  display: flex;
  min-height: calc(100vh - 4rem);
}

.app-sidebar {
  width: 18rem;
  flex: 0 0 18rem;
  padding: 1rem;
  overflow-y: auto;
  background: #fff;
  border-inline-end: 1px solid #dee2e6;
}

.app-sidebar .nav-link {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0.125rem;
  padding: 0.5rem 0.75rem;
  color: #495057;
  border-radius: 0.5rem;
  touch-action: manipulation;
}

.app-sidebar .nav-link span {
  flex: 1 1 auto;
}

.app-sidebar .nav-link:hover {
  background: #f1f3f5;
}

.app-sidebar .nav-link.active {
  color: #0d6efd;
  font-weight: 600;
  background: #e7f1ff;
}

.nav-section {
  margin: 1rem 0 0.35rem;
  padding: 0 0.75rem;
  color: #6c757d;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.app-content {
  flex: 1 1 auto;
  min-width: 0;
  overflow-y: auto;
  padding-bottom: env(safe-area-inset-bottom);
}

.page-shell,
.auth-shell {
  min-height: 100%;
  padding: 1.5rem;
  padding-left: max(1.5rem, env(safe-area-inset-left));
  padding-right: max(1.5rem, env(safe-area-inset-right));
  padding-bottom: max(1.5rem, env(safe-area-inset-bottom));
}

.page-shell-wide {
  max-width: 1600px;
}

.metric-card,
.surface-card {
  background: #fff;
  border: 1px solid #dee2e6;
  border-radius: 1rem;
  box-shadow: 0 0.125rem 0.35rem rgba(15, 23, 42, 0.05);
}

.metric-card {
  padding: 1.25rem;
}

.metric-value {
  margin: 0.35rem 0;
  font-size: 2rem;
  font-weight: 700;
}

.gradient-blue,
.gradient-purple,
.gradient-auth {
  background: linear-gradient(135deg, #eef6ff, #f5f0ff);
}

.code-panel {
  color: #fff;
  background: #111827;
  border-radius: 1rem;
}

.canvas-board {
  min-height: 42rem;
  background-color: #fff;
  background-image: radial-gradient(#dee2e6 1px, transparent 1px);
  background-size: 24px 24px;
}

.whiteboard-surface {
  height: 48rem;
  overflow: hidden;
  border-radius: 0.75rem;
}

.whiteboard-item {
  position: absolute;
  padding: 0.75rem;
  color: #111827;
  text-align: left;
  white-space: pre-wrap;
  border: 1px solid rgba(15, 23, 42, 0.16);
  border-radius: 0.75rem;
  box-shadow: 0 0.5rem 1rem rgba(15, 23, 42, 0.08);
  cursor: grab;
}

.whiteboard-item:focus {
  outline: 3px solid rgba(13, 110, 253, 0.35);
}

.whiteboard-item.okr-objective {
  border-inline-start: 4px solid #2563eb;
  font-size: 0.9rem;
  line-height: 1.35;
}

.whiteboard-item.okr-kr {
  border-inline-start: 4px solid #16a34a;
  font-size: 0.82rem;
  line-height: 1.35;
}

.whiteboard-item.okr-initiative {
  border-inline-start: 4px solid #ca8a04;
  font-size: 0.78rem;
  line-height: 1.3;
}

.wb-okr-panel {
  max-height: min(28rem, 55vh);
  overflow-y: auto;
  overscroll-behavior: contain;
}

.whiteboard-cursor {
  position: absolute;
  z-index: 100000;
  padding: 0.1rem 0.35rem;
  color: #111827;
  font-size: 0.75rem;
  background: #fff;
  border-inline-start: 3px solid #0d6efd;
  border-radius: 0.25rem;
  pointer-events: none;
}

.kanban-card {
  border-inline-start: 4px solid #0d6efd !important;
}

.dashboard-home-skeleton .dashboard-skeleton-line,
.dashboard-home-skeleton .dashboard-skeleton-pill,
.dashboard-home-skeleton .dashboard-skeleton-badge {
  background: linear-gradient(90deg, #e9ecef 0%, #f8f9fa 40%, #e9ecef 80%);
  background-size: 200% 100%;
  animation: dashboard-skeleton-shimmer 1.2s ease-in-out infinite;
}

.dashboard-home-skeleton .dashboard-skeleton-badge {
  width: 5rem;
  height: 1.5rem;
}

.dashboard-home-skeleton .dashboard-skeleton-pill {
  width: 18rem;
  max-width: 100%;
  height: 2.25rem;
}

@keyframes dashboard-skeleton-shimmer {
  0% {
    background-position: 100% 0;
  }

  100% {
    background-position: -100% 0;
  }
}

.my-tasks-kanban__lane {
  min-height: 14rem;
}

.white-space-preline {
  white-space: pre-line;
}

.table-responsive {
  -webkit-overflow-scrolling: touch;
}

.chart-bars {
  height: 12rem;
  padding: 1rem;
  background: #f8fafc;
  border-radius: 0.75rem;
}

.chart-bars span {
  display: inline-block;
  width: 2rem;
  min-height: 1rem;
  background: linear-gradient(180deg, #0d6efd, #6f42c1);
  border-radius: 0.35rem 0.35rem 0 0;
}

.heatmap-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(12rem, 1fr));
  gap: 0.75rem;
}

.heatmap-cell {
  display: flex;
  min-height: 8rem;
  flex-direction: column;
  justify-content: space-between;
  padding: 0.85rem;
  text-align: left;
  border: 1px solid rgba(15, 23, 42, 0.14);
  border-radius: 0.75rem;
}

.sticky-note {
  background: #fff8db;
  border: 1px solid #ffe69c;
  border-radius: 0.75rem;
}

/* OKR delivery rollup explainer (tasks → initiatives → KR) */
.okr-flow-diagram {
  --okr-flow-muted: rgba(15, 23, 42, 0.55);
}

.okr-flow-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem 0.25rem;
}

.okr-flow-box {
  display: inline-block;
  padding: 0.25rem 0.55rem;
  border: 1px solid rgba(15, 23, 42, 0.14);
  border-radius: 0.4rem;
  font-size: 0.8125rem;
  font-weight: 600;
  background: #fff;
  white-space: nowrap;
}

.okr-flow-arrow {
  color: var(--okr-flow-muted);
  font-size: 0.75rem;
  user-select: none;
}

@media (max-width: 991.98px) {
  .app-topbar {
    flex-wrap: wrap;
    row-gap: 0.5rem;
  }

  .app-sidebar .nav-link {
    min-height: 2.75rem;
    padding-top: 0.65rem;
    padding-bottom: 0.65rem;
  }

  .topbar-actions .btn {
    min-height: 2.5rem;
  }

  /* iOS Safari: 16px+ on inputs avoids automatic zoom on focus. */
  .form-control:not(.form-control-sm):not(.form-control-lg),
  .form-select:not(.form-select-sm):not(.form-select-lg) {
    font-size: 16px;
  }
}
