:root,
:root[data-theme="light"] {
  --shell-bg: var(--body-bg);
  --shell-surface: var(--panel-bg);
  --shell-sidebar: #0f172a;
  --shell-sidebar-2: #16233b;
  --shell-sidebar-border: rgba(255,255,255,0.08);
  --shell-sidebar-text: rgba(255,255,255,0.74);
  --shell-sidebar-active: #ffffff;
  --shell-sidebar-active-bg: rgba(16,163,127,0.16);
  --shell-topbar-bg: rgba(255,255,255,0.96);
  --shell-topbar-border: #e2e8f0;
  --shell-panel: var(--panel-bg);
  --shell-panel-soft: var(--panel-soft-bg);
  --shell-line: var(--line);
  --shell-line-soft: var(--line-soft);
  --shell-shadow: 0 12px 36px rgba(15,23,42,0.06);
  --shell-radius: 14px;
  --shell-sidebar-width: 238px;
  --shell-topbar-height: 58px;
  --shell-footer-height: 68px;
  --theme-title-color: #002B4D;
  --theme-underline-start: rgba(16,163,127,0.95);
  --theme-underline-end: rgba(43,181,146,0.18);
  --theme-kicker: #F26B00;
  --theme-icon-bg: rgba(16,163,127,0.08);
  --theme-icon-text: #F26B00;
  --theme-loader-bg: radial-gradient(circle at top right, rgba(43,181,146,0.14), transparent 24%), linear-gradient(160deg, #0f172a 0%, #16233b 100%);
  --theme-loader-copy: rgba(255,255,255,0.72);
  --theme-footer-overlay: rgba(15, 23, 42, 0.45);
  --theme-footer-glow-a: rgba(242, 107, 0, 0.12);
  --theme-footer-glow-b: rgba(43, 181, 146, 0.06);
  --theme-toast-bg: rgba(255,255,255,0.98);
  --theme-toast-heading: #0f172a;
  --theme-toast-text: #475569;
}

:root[data-theme="dark"] {
  --shell-bg: #0b1220;
  --shell-surface: #111b2d;
  --shell-sidebar: #060d18;
  --shell-sidebar-2: #0d1627;
  --shell-sidebar-border: rgba(148,163,184,0.12);
  --shell-sidebar-text: rgba(230,237,246,0.74);
  --shell-sidebar-active: #ffffff;
  --shell-sidebar-active-bg: rgba(43,181,146,0.22);
  --shell-topbar-bg: rgba(8, 14, 24, 0.88);
  --shell-topbar-border: #22314b;
  --shell-panel: #111b2d;
  --shell-panel-soft: #172235;
  --shell-line: #22314b;
  --shell-line-soft: #1b2940;
  --shell-shadow: 0 18px 44px rgba(2, 6, 23, 0.35);
  --shell-radius: 14px;
  --shell-sidebar-width: 238px;
  --shell-topbar-height: 58px;
  --shell-footer-height: 68px;
  --theme-title-color: #e6edf6;
  --theme-underline-start: rgba(43,181,146,0.95);
  --theme-underline-end: rgba(16,163,127,0.18);
  --theme-kicker: #2bb592;
  --theme-icon-bg: rgba(43,181,146,0.14);
  --theme-icon-text: #7ce6c8;
  --theme-loader-bg: radial-gradient(circle at top right, rgba(43,181,146,0.14), transparent 24%), linear-gradient(160deg, #060d18 0%, #0d1627 100%);
  --theme-loader-copy: rgba(230,237,246,0.72);
  --theme-footer-overlay: rgba(4, 9, 17, 0.72);
  --theme-footer-glow-a: rgba(43, 181, 146, 0.14);
  --theme-footer-glow-b: rgba(242, 107, 0, 0.08);
  --theme-toast-bg: rgba(12,18,30,0.98);
  --theme-toast-heading: #e6edf6;
  --theme-toast-text: #9fb0c8;
}

:root[data-theme="african"] {
  --shell-bg: #f4ecde;
  --shell-surface: #fff8ee;
  --shell-sidebar: #3a2316;
  --shell-sidebar-2: #22130d;
  --shell-sidebar-border: rgba(255,248,238,0.10);
  --shell-sidebar-text: rgba(255,241,225,0.78);
  --shell-sidebar-active: #fff8ee;
  --shell-sidebar-active-bg: rgba(197,139,42,0.22);
  --shell-topbar-bg: rgba(255,248,238,0.94);
  --shell-topbar-border: #e7d2b7;
  --shell-panel: #fffaf2;
  --shell-panel-soft: #f7eedf;
  --shell-line: #e7d2b7;
  --shell-line-soft: #f1e3cf;
  --shell-shadow: 0 18px 40px rgba(93, 57, 27, 0.14);
  --shell-radius: 14px;
  --shell-sidebar-width: 238px;
  --shell-topbar-height: 58px;
  --shell-footer-height: 68px;
  --theme-title-color: #432312;
  --theme-underline-start: rgba(155,77,31,0.95);
  --theme-underline-end: rgba(197,139,42,0.26);
  --theme-kicker: #9b4d1f;
  --theme-icon-bg: rgba(197,139,42,0.16);
  --theme-icon-text: #9b4d1f;
  --theme-loader-bg: radial-gradient(circle at top right, rgba(197,139,42,0.18), transparent 24%), linear-gradient(160deg, #3a2316 0%, #22130d 100%);
  --theme-loader-copy: rgba(255,248,238,0.78);
  --theme-footer-overlay: rgba(58, 35, 22, 0.64);
  --theme-footer-glow-a: rgba(197, 139, 42, 0.16);
  --theme-footer-glow-b: rgba(155, 77, 31, 0.10);
  --theme-toast-bg: rgba(255,250,242,0.98);
  --theme-toast-heading: #341f13;
  --theme-toast-text: #7c5b42;
}


body.software-shell-ready {
  background: var(--shell-bg);
}

.software-app {
  display: flex;
  min-height: 100vh;
}

.app-sidebar {
  width: var(--shell-sidebar-width);
  background: linear-gradient(180deg, var(--shell-sidebar) 0%, var(--shell-sidebar-2) 100%);
  color: var(--shell-sidebar-text);
  padding: 16px 14px 18px;
  position: fixed;
  inset: 0 auto 0 0;
  border-right: 1px solid var(--shell-sidebar-border);
  display: flex;
  flex-direction: column;
  gap: 14px;
  z-index: 40;
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px 14px;
  border-bottom: 1px solid var(--shell-sidebar-border);
}

.sidebar-brand-mark {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  flex-shrink: 0;
}

.sidebar-brand-mark img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.sidebar-brand-copy {
  min-width: 0;
}

.sidebar-brand-title {
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.12em;
  color: #fff;
}

.sidebar-brand-subtitle {
  font-size: 10px;
  color: rgba(255,255,255,0.56);
}

.sidebar-group-label {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-weight: 700;
  color: rgba(255,255,255,0.42);
  padding: 0 10px;
  margin-top: 4px;
}

.sidebar-nav {
  display: grid;
  gap: 4px;
}

.sidebar-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 11px;
  color: var(--shell-sidebar-text);
  transition: background .18s ease, color .18s ease, transform .18s ease;
  font-size: 12.5px;
  font-weight: 500;
}

.sidebar-link:hover {
  background: rgba(255,255,255,0.06);
  color: #fff;
  transform: translateX(1px);
}

.sidebar-link.active {
  background: var(--shell-sidebar-active-bg);
  color: var(--shell-sidebar-active);
  box-shadow: inset 0 0 0 1px rgba(16,163,127,0.18);
}

.sidebar-link svg {
  width: 17px;
  height: 17px;
  stroke: currentColor;
  flex: 0 0 17px;
}

.sidebar-foot {
  margin-top: auto;
  padding: 12px 10px 6px;
  border-top: 1px solid var(--shell-sidebar-border);
  font-size: 11px;
  color: rgba(255,255,255,0.48);
}

.app-main {
  margin-left: var(--shell-sidebar-width);
  min-width: 0;
  width: calc(100% - var(--shell-sidebar-width));
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  background: var(--shell-topbar-bg);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--shell-topbar-border);
  box-shadow: 0 1px 0 rgba(255,255,255,0.7);
  color: var(--text-body);
  padding: 0;
}

.topbar-inner {
  min-height: var(--shell-topbar-height);
  height: auto;
  max-width: none;
  padding: 8px 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand-logo {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  overflow: hidden;
  flex-shrink: 0;
}

.brand-logo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.brand-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.brand-title {
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.12em;
  color: var(--theme-title-color);
}

.brand-subtitle {
  font-size: 10px;
  color: var(--text-muted);
}

.app-main-content {
  flex: 1;
  min-height: calc(100vh - var(--shell-topbar-height) - var(--shell-footer-height));
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.topbar-meta {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 10px;
}


.topbar .btn.ghost {
  background: var(--button-secondary-bg);
  color: var(--button-secondary-text);
  border: 1px solid var(--button-secondary-border);
}

.topbar .btn.ghost:hover {
  opacity: 1;
  filter: brightness(0.98);
}

.otd-theme-switcher {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px;
  border-radius: 999px;
  border: 1px solid var(--shell-line);
  background: color-mix(in srgb, var(--shell-panel) 86%, transparent);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.4);
  backdrop-filter: blur(10px);
}

.otd-theme-btn {
  border: none;
  min-height: 30px;
  padding: 0 12px;
  border-radius: 999px;
  background: transparent;
  color: var(--text-muted);
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 0.02em;
  transition: background .18s ease, color .18s ease, transform .18s ease, box-shadow .18s ease;
}

.otd-theme-btn:hover {
  color: var(--text-body);
  transform: translateY(-1px);
}

.otd-theme-btn.active {
  background: linear-gradient(135deg, var(--brand), var(--brand-2));
  color: white;
  box-shadow: 0 8px 18px color-mix(in srgb, var(--brand) 22%, transparent);
}

:root[data-theme="african"] .otd-theme-btn.active {
  color: #fff8ee;
}

.container {
  max-width: none;
  padding: 20px;
}

.card, .stat, .list-item, .nav-card, .readonly-block, .empty-state {
  border-radius: 14px;
  border-color: var(--shell-line);
  box-shadow: none;

  background-clip: padding-box;
  isolation: isolate;
}

.card, .stat, .list-item, .nav-card {
  background: var(--shell-panel);
}

.card:hover, .nav-card:hover {
  box-shadow: var(--shell-shadow);
}

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

.stat {
  padding: 13px 14px;
  background: linear-gradient(180deg, var(--shell-panel) 0%, var(--shell-panel-soft) 100%);
}

.stat-value {
  font-size: 1rem;
}

.stat-label {
  font-size: 10px;
  letter-spacing: 0.08em;
}

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

.nav-card {
  position: relative;
  padding: 14px;
  text-align: left;
  overflow: hidden;
}

.nav-card::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 3px;
  background: transparent;
  transition: background .18s ease;
}

.nav-card:hover::before {
  background: var(--theme-kicker);
}

.nav-card-title {
  font-size: 13px;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 10px;
}

.nav-card-icon {
  width: 30px;
  height: 30px;
  border-radius: 9px;
  background: var(--theme-icon-bg);
  color: var(--theme-icon-text);
  display: inline-grid;
  place-items: center;
}
.nav-card-icon svg {
  width: 16px; height: 16px; stroke: currentColor;
}

.nav-card-copy {
  margin-top: 8px;
  line-height: 1.5;
}

.form-grid {
  gap: 12px;
}

.form-group label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--text-muted);
  font-weight: 700;
}

input, select, textarea {
  background: var(--panel-bg);
  border: 1px solid var(--shell-line);
  border-radius: 10px;
  min-height: 38px;
}

input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--brand-2);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand-2) 18%, transparent);
}

.list-item {
  border: 1px solid var(--shell-line-soft);
  background: var(--panel-bg);
}

.kicker {
  font-size: 10px;
  letter-spacing: .12em;
  color: var(--theme-kicker);
}

.badge {
  min-height: 22px;
  font-size: 11px;
}

.table-shell {
  background: var(--panel-bg);
  border: 1px solid var(--shell-line);
  border-radius: 14px;
  overflow: hidden;
}

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

.table-shell th {
  background: var(--panel-soft-bg);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--text-muted);
  text-align: left;
  padding: 12px;
  border-bottom: 1px solid var(--shell-line);
}

.table-shell td {
  padding: 12px;
  border-bottom: 1px solid var(--shell-line-soft);
  font-size: 12.5px;
}

.table-shell tr:hover td {
  background: rgba(16,163,127,0.03);
}

.software-toolbar {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  margin-bottom: 14px;
}

.software-toolbar .toolbar-meta {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
}

@media (max-width: 1040px) {
  .app-sidebar {
    width: 76px;
    padding-left: 8px;
    padding-right: 8px;
  }
  .sidebar-brand-copy,
  .sidebar-group-label,
  .sidebar-link span,
  .sidebar-foot { display: none; }
  .app-main { margin-left: 76px; width: calc(100% - 76px); }
  .sidebar-brand {
    justify-content: center;
    padding: 8px 0 14px;
  }
  .sidebar-brand-mark {
    width: 40px;
    height: 40px;
  }
}

@media (max-width: 820px) {
  .app-sidebar { display: none; }
  .app-main { margin-left: 0; width: 100%; }
  .topbar-inner { padding: 8px 12px; height: auto; min-height: 56px; flex-wrap: wrap; }
  .container { padding: 12px; }
  .stats { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .brand-text .brand-subtitle { display: none; }
  .topbar-actions, .topbar-meta { width: 100%; justify-content: flex-start; }
  .otd-theme-switcher { width: 100%; justify-content: space-between; }
  .otd-theme-btn { flex: 1 1 0; }
}


.sidebar-utility {
  margin-top: auto;
  display: grid;
  gap: 8px;
  padding: 8px 10px 0;
}

.sidebar-logout-btn {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 11px;
  border: 1px solid rgba(255,255,255,0.12);
  background: rgba(255,255,255,0.06);
  color: rgba(255,255,255,0.88);
  font-size: 12.5px;
  font-weight: 500;
  cursor: pointer;
  transition: background .18s ease, transform .18s ease, border-color .18s ease;
}

.sidebar-logout-btn:hover {
  background: rgba(229,62,62,0.14);
  border-color: rgba(229,62,62,0.24);
  transform: translateX(1px);
}

.sidebar-logout-btn svg {
  width: 17px;
  height: 17px;
  stroke: currentColor;
  flex: 0 0 17px;
}

.app-footer {
  position: sticky;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 25;
  margin-top: 28px;
  padding: 16px 20px 20px;
  background-image: url('../assets/images/footer/footer.png');
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  border-top: 1px solid rgba(255, 255, 255, 0.25);
  box-shadow: 0 -4px 20px rgba(15, 23, 42, 0.08);
  position: relative;
}

.app-footer::before {
  content: '';
  position: absolute;
  inset: 0;
  background: var(--theme-footer-overlay);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 0;
  pointer-events: none;
}

.app-footer::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, var(--theme-footer-glow-a), var(--theme-footer-glow-b));
  z-index: 0;
  pointer-events: none;
}

.app-footer-inner {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: flex-start;
  padding-top: 6px;
  color: rgba(255, 255, 255, 0.9);
  font-size: 11.5px;
  position: relative;
  z-index: 2;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

.app-footer-brand {
  display: grid;
  gap: 4px;
}

.app-footer-brand strong {
  color: white;
  font-size: 12px;
  letter-spacing: 0.08em;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

.app-footer-meta {
  display: grid;
  gap: 4px;
  text-align: right;
}

.app-main-content {
  margin-bottom: 0;
}

@media (max-width: 1040px) {
  .sidebar-utility { padding-left: 0; padding-right: 0; }
  .sidebar-logout-btn span { display: none; }
  .sidebar-logout-btn { justify-content: center; padding: 10px 8px; }
}

@media (max-width: 820px) {
  .app-footer {
    padding: 12px 12px 18px;
    background-position: center 30%;
  }
  .app-footer::before {
    backdrop-filter: blur(12px);
  }
  .app-footer-inner {
    flex-direction: column;
    text-align: left;
  }
  .app-footer-meta { text-align: left; }
}

.motion-logo-mark,
.shell-loader-logo {
  position: relative;
}

.motion-logo-mark::after,
.shell-loader-logo::after {
  content: "";
  position: absolute;
  inset: -6px;
  border-radius: 16px;
  background: radial-gradient(circle, rgba(16,163,127,0.24), transparent 65%);
  z-index: -1;
  animation: otdPulseAura 2.6s ease-in-out infinite;
}

.motion-logo-mark img,
.shell-loader-logo img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: contain;
  object-position: center;
  animation: otdLogoFloat 3.2s ease-in-out infinite;
}

.shell-shift-title,
.brand-title,
.sidebar-brand-title,
.shell-loader-title {
  display: inline-block;
  background: linear-gradient(90deg, #ffffff 0%, var(--brand-2) 35%, var(--brand) 65%, #ffffff 100%);
  background-size: 220% auto;
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
  animation: otdGradientShift 7s linear infinite;
}

.topbar .brand-title,
.topbar .shell-shift-title,
.auth-topbar .brand-title,
.auth-topbar .shell-shift-title {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  position: relative;
  background: none;
  background-size: auto;
  -webkit-background-clip: border-box;
  background-clip: border-box;
  -webkit-text-fill-color: var(--theme-title-color);
  color: var(--theme-title-color);
  animation: none;
}

.topbar .brand-title::after,
.topbar .shell-shift-title::after,
.auth-topbar .brand-title::after,
.auth-topbar .shell-shift-title::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -5px;
  width: 54px;
  height: 2px;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--theme-underline-start), var(--theme-underline-end));
  transform-origin: left center;
  animation: otdUnderlineSweep 3.6s ease-in-out infinite;
}

.gradient-word {
  display: inline-block;
  background: linear-gradient(90deg, var(--brand), var(--brand-2), var(--theme-title-color), var(--brand));
  background-size: 220% auto;
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
  animation: otdGradientShift 5.8s linear infinite;
}

.pulse-kicker {
  animation: otdKickerPulse 2.6s ease-in-out infinite;
}

.typewriter-shell {
  display: inline-flex;
  align-items: baseline;
  gap: 6px;
}

.typewriter-shell::after {
  content: "";
  width: 1px;
  height: 1em;
  background: currentColor;
  display: inline-block;
  animation: otdBlink 0.9s steps(2) infinite;
}

.sidebar-link svg,
.sidebar-logout-btn svg,
.nav-card-icon,
.btn svg {
  transition: transform .22s ease, filter .22s ease, opacity .22s ease;
}

.sidebar-link:hover svg,
.sidebar-logout-btn:hover svg {
  transform: translateY(-1px) scale(1.08) rotate(-4deg);
  filter: drop-shadow(0 6px 10px rgba(16,163,127,0.18));
}

.sidebar-link.active svg {
  animation: otdIconPulse 2.2s ease-in-out infinite;
}

.motion-card {
  animation: otdCardLiftIn .5s ease both;
}

.shell-loader {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  background: var(--theme-loader-bg);
  opacity: 0;
  pointer-events: none;
  transition: opacity .24s ease;
  z-index: 9999;
}

.shell-loader.visible {
  opacity: 1;
  pointer-events: all;
}

.shell-loader-out {
  opacity: 0 !important;
}

.shell-loader-inner {
  text-align: center;
  color: white;
  display: grid;
  gap: 10px;
  justify-items: center;
}

.shell-loader-logo {
  width: 82px;
  height: 82px;
  padding: 8px;
  display: grid;
  place-items: center;
  border-radius: 22px;
  overflow: hidden;
  background: linear-gradient(180deg, rgba(255,255,255,0.08), rgba(255,255,255,0.03));
  border: 1px solid rgba(255,255,255,0.08);
  box-shadow: 0 14px 40px rgba(16,163,127,0.18);
}

.shell-loader-title {
  font-size: 14px;
  font-weight: 800;
  letter-spacing: 0.18em;
}

.shell-loader-copy {
  font-size: 12px;
  color: var(--theme-loader-copy);
}

.shell-loader-bars {
  display: inline-flex;
  align-items: flex-end;
  gap: 6px;
  margin-top: 6px;
}

.shell-loader-bars span {
  width: 8px;
  border-radius: 999px;
  background: linear-gradient(180deg, #2bb592, #F26B00);
  animation: otdLoaderBars 1s ease-in-out infinite;
}

.shell-loader-bars span:nth-child(1) { height: 18px; animation-delay: 0s; }
.shell-loader-bars span:nth-child(2) { height: 28px; animation-delay: .15s; }
.shell-loader-bars span:nth-child(3) { height: 18px; animation-delay: .3s; }

@keyframes otdGradientShift {
  0% { background-position: 0% 50%; }
  100% { background-position: 220% 50%; }
}

@keyframes otdPulseAura {
  0%,100% { transform: scale(.96); opacity: .45; }
  50% { transform: scale(1.08); opacity: .9; }
}

@keyframes otdLogoFloat {
  0%,100% { transform: translateY(0px) rotate(0deg); }
  50% { transform: translateY(-4px) rotate(-2deg); }
}

@keyframes otdKickerPulse {
  0%,100% { letter-spacing: .08em; opacity: .82; }
  50% { letter-spacing: .11em; opacity: 1; }
}

@keyframes otdBlink {
  0%,49% { opacity: 1; }
  50%,100% { opacity: 0; }
}

@keyframes otdIconPulse {
  0%,100% { transform: scale(1); }
  50% { transform: scale(1.08); }
}

@keyframes otdCardLiftIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes otdLoaderBars {
  0%,100% { transform: scaleY(.75); opacity: .75; }
  50% { transform: scaleY(1.2); opacity: 1; }
}

@keyframes otdUnderlineSweep {
  0%, 100% { transform: scaleX(0.72); opacity: 0.72; }
  50% { transform: scaleX(1); opacity: 1; }
}

.shell-inner-card {
  background: linear-gradient(180deg, var(--shell-panel) 0%, var(--shell-panel-soft) 100%);
}

.no-shell-page .topbar,
.no-shell-page .auth-topbar {
  position: sticky;
  top: 0;
  z-index: 20;
}

.no-shell-page .brand-title,
.no-shell-page .shell-shift-title {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  position: relative;
  background: none;
  background-size: auto;
  -webkit-background-clip: border-box;
  background-clip: border-box;
  -webkit-text-fill-color: var(--theme-title-color);
  color: var(--theme-title-color);
  animation: none;
}

.no-shell-page .brand-title::after,
.no-shell-page .shell-shift-title::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -5px;
  width: 54px;
  height: 2px;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--theme-underline-start), var(--theme-underline-end));
  transform-origin: left center;
  animation: otdUnderlineSweep 3.6s ease-in-out infinite;
}

.motion-page-title,
.page-title {
  position: relative;
  display: inline-block;
}

.motion-page-title {
  animation: otdTitleRise .42s ease both;
}

.motion-page-title::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -7px;
  width: 62px;
  height: 2px;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--theme-underline-start), color-mix(in srgb, var(--theme-underline-end) 140%, transparent));
}

.motion-brand-title {
  animation: otdTitleRise .44s ease both;
}

.auth-wrap,
.auth-panel,
.auth-side,
.page-shell,
.container {
  animation: otdFadeInPage .34s ease both;
}

.sidebar-link,
.sidebar-logout-btn,
.btn {
  position: relative;
}

.sidebar-link::before,
.sidebar-logout-btn::before,
.btn::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  box-shadow: 0 0 0 0 rgba(16,163,127,0.0);
  transition: box-shadow .24s ease, transform .24s ease;
  pointer-events: none;
}

.sidebar-link:hover::before,
.sidebar-logout-btn:hover::before,
.btn:hover::before {
  box-shadow: 0 0 0 1px rgba(16,163,127,0.14), 0 8px 20px rgba(16,163,127,0.08);
}

.stat,
.card,
.list-item {
  animation: otdFadeInPage .28s ease both;
}

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

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

.otd-toast-host {
  position: fixed;
  top: 16px;
  right: 16px;
  z-index: 10050;
  display: grid;
  gap: 10px;
  width: min(360px, calc(100vw - 24px));
  pointer-events: none;
}

.otd-toast {
  display: grid;
  grid-template-columns: 10px 1fr auto;
  align-items: start;
  gap: 10px;
  padding: 12px 12px 12px 10px;
  background: var(--theme-toast-bg);
  border: 1px solid var(--shell-line);
  border-radius: 14px;
  box-shadow: 0 18px 42px rgba(15,23,42,0.14);
  transform: translateY(-10px) scale(0.98);
  opacity: 0;
  transition: transform .18s ease, opacity .18s ease;
  pointer-events: auto;
}

.otd-toast.visible {
  opacity: 1;
  transform: translateY(0) scale(1);
}

.otd-toast.out {
  opacity: 0;
  transform: translateY(-8px) scale(0.98);
}

.otd-toast-dot {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  margin-top: 6px;
  background: #3b82f6;
  box-shadow: 0 0 0 5px rgba(59,130,246,0.1);
}
.otd-toast.success .otd-toast-dot { background: #16a34a; box-shadow: 0 0 0 5px rgba(22,163,74,0.10); }
.otd-toast.error .otd-toast-dot { background: #dc2626; box-shadow: 0 0 0 5px rgba(220,38,38,0.10); }
.otd-toast.warning .otd-toast-dot { background: #d97706; box-shadow: 0 0 0 5px rgba(217,119,6,0.10); }

.otd-toast-body {
  display: grid;
  gap: 4px;
}

.otd-toast-body strong {
  font-size: 12px;
  color: var(--theme-toast-heading);
}

.otd-toast-body span {
  font-size: 12px;
  color: var(--theme-toast-text);
  line-height: 1.45;
}

.otd-toast-close {
  border: none;
  background: transparent;
  color: #94a3b8;
  font-size: 18px;
  line-height: 1;
  padding: 0 2px;
  cursor: pointer;
}

.btn.is-busy,
.is-busy-disabled {
  cursor: wait;
}

.btn.is-busy {
  opacity: 0.95;
}

.btn-spinner {
  width: 14px;
  height: 14px;
  border-radius: 999px;
  border: 2px solid currentColor;
  border-right-color: transparent;
  display: inline-block;
  margin-right: 8px;
  animation: otdSpin .85s linear infinite;
  vertical-align: -2px;
}

@keyframes otdSpin {
  to { transform: rotate(360deg); }
}

@media (max-width: 820px) {
  .otd-toast-host {
    right: 12px;
    left: 12px;
    width: auto;
  }
}

body.software-shell-ready {
  color: var(--text-body);
}

body.software-shell-ready::before,
body.no-shell-page::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: 0;
  z-index: -1;
}

:root[data-theme="african"] body.software-shell-ready::before,
:root[data-theme="african"] body.no-shell-page::before {
  opacity: 1;
  background:
    radial-gradient(circle at 20% 20%, rgba(197,139,42,0.10), transparent 20%),
    radial-gradient(circle at 80% 12%, rgba(155,77,31,0.08), transparent 18%),
    linear-gradient(135deg, rgba(255,255,255,0.12), transparent 55%);
}

:root[data-theme="dark"] .sidebar-link:hover {
  background: rgba(255,255,255,0.04);
}

:root[data-theme="dark"] .topbar {
  box-shadow: 0 1px 0 rgba(255,255,255,0.04);
}

:root[data-theme="dark"] .app-footer-inner {
  color: rgba(230,237,246,0.92);
}

:root[data-theme="dark"] .app-footer-brand strong {
  color: #ffffff;
}

:root[data-theme="african"] .app-footer-inner {
  color: rgba(255,248,238,0.92);
}

:root[data-theme="african"] .app-footer-brand strong {
  color: #fff8ee;
}

:root[data-theme="dark"] .shell-loader-logo {
  border-color: rgba(255,255,255,0.06);
}

:root[data-theme="dark"] .table-shell tr:hover td {
  background: rgba(43,181,146,0.06);
}

:root[data-theme="african"] .table-shell tr:hover td {
  background: rgba(197,139,42,0.08);
}

:root[data-theme="african"] .nav-card:hover::before {
  background: var(--brand-2);
}

:root[data-theme="african"] .sidebar-link.active {
  box-shadow: inset 0 0 0 1px rgba(197,139,42,0.30);
}


.otd-review-console {
  margin-bottom: 20px;
}

.otd-review-console-actions,
.otd-board-toolbar-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  margin-top: 14px;
}

.otd-review-section-panel {
  margin-top: 14px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 10px;
}

.otd-section-toggle {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  border: 1px solid rgba(148, 163, 184, 0.22);
  border-radius: 16px;
  padding: 12px 14px;
  background: rgba(255, 255, 255, 0.04);
}

.otd-section-toggle input {
  margin-top: 3px;
}

.otd-section-toggle span {
  display: block;
  font-weight: 600;
}

.otd-section-toggle small {
  display: block;
  color: var(--muted, #94a3b8);
  margin-top: 2px;
}

.otd-board-toolbar {
  display: grid;
  gap: 10px;
  margin: 10px 0 12px;
  padding: 12px 14px;
  border-radius: 18px;
  border: 1px solid rgba(148, 163, 184, 0.16);
  background: rgba(15, 23, 42, 0.04);
}

.otd-board-toolbar-heading {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: center;
  font-size: 0.92rem;
}

.otd-board-count {
  color: var(--muted, #94a3b8);
}

.otd-board-search,
.otd-board-sort {
  min-height: 42px;
  border-radius: 12px;
  border: 1px solid rgba(148, 163, 184, 0.2);
  background: rgba(255, 255, 255, 0.92);
  color: inherit;
  padding: 0 12px;
}

[data-theme="dark"] .otd-board-search,
[data-theme="dark"] .otd-board-sort,
[data-theme="african"] .otd-board-search,
[data-theme="african"] .otd-board-sort {
  background: rgba(15, 23, 42, 0.55);
  color: inherit;
}

.otd-filter-hidden,
.otd-section-hidden {
  display: none !important;
}

.otd-recorded-stamp {
  margin-top: 10px;
  font-size: 0.78rem;
  color: var(--muted, #94a3b8);
}

.otd-software-page .container {
  max-width: none;
  width: 100%;
  padding: 20px 22px 32px;
}

.otd-workspace-container {
  display: grid;
  gap: 18px;
  align-content: start;
}

.otd-workspace-tabs {
  position: static;
  top: auto;
  z-index: 1;
  background: color-mix(in srgb, var(--card-bg) 92%, white 8%);
  backdrop-filter: none;
}

.otd-workspace-tabs-head {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: flex-start;
  margin-bottom: 12px;
}

.otd-workspace-tab-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.otd-workspace-tab {
  border: 1px solid var(--line);
  background: var(--panel-soft-bg);
  color: var(--text-body);
  border-radius: 999px;
  padding: 8px 12px;
  font-size: 0.82rem;
  font-weight: 700;
}

.otd-workspace-tab.active {
  background: linear-gradient(135deg, var(--brand), var(--brand-2));
  color: #fff;
  border-color: transparent;
  box-shadow: 0 8px 18px rgba(15, 118, 110, 0.16);
}

.otd-workspace-panel {
  margin-top: 0 !important;
}

.otd-workspace-panel[hidden] {
  display: none !important;
}

.otd-panel-tools {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 8px;
}

.otd-form-region {
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px dashed var(--line);
}

.otd-form-region[hidden] {
  display: none !important;
}

.otd-software-page .project-card-title {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 14px;
  flex-wrap: wrap;
}

.otd-software-page .card,
.otd-software-page .shell-inner-card {
  padding: 16px;
}

.otd-software-page .grid.two,
.otd-software-page .grid.three,
.otd-software-page .grid.four,
.otd-software-page .compact-grid {
  gap: 14px;
}

.otd-software-page .grid.two {
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
}

.otd-software-page .grid.three,
.otd-software-page .grid.four,
.otd-software-page .compact-grid {
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
}

.otd-software-page .form-grid {
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px 14px;
}

.otd-software-page .list {
  display: grid;
  gap: 12px;
}

.otd-software-page .list-item {
  border-radius: 14px;
}

@media (max-width: 900px) {
  .otd-software-page .container {
    padding: 16px 14px 24px;
  }

  .otd-workspace-tabs {
    position: static;
  }
}

.software-focus-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) minmax(320px, 0.95fr);
  gap: 18px;
  margin-top: 20px;
  align-items: start;
}

.software-focus-main,
.software-focus-side {
  min-width: 0;
}

.software-focus-card {
  padding: 18px;
  border-radius: 18px;
  box-shadow: var(--shell-shadow);
}

.software-focus-card .project-card-title,
.software-focus-card .workspace-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  flex-wrap: wrap;
}

.workspace-head h1,
.workspace-head h2,
.workspace-head h3 {
  margin: 0;
}

.workspace-head p {
  margin: 6px 0 0;
}

.workspace-sticky {
  position: sticky;
  top: calc(var(--shell-topbar-height) + 18px);
}

.workspace-stack {
  display: grid;
  gap: 16px;
}

.workspace-hero-note {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  background: var(--shell-panel-soft);
  color: var(--text-muted);
  border: 1px solid var(--shell-line-soft);
}

.otd-local-tabset {
  display: grid;
  gap: 14px;
}

.otd-local-tabs {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  padding: 4px;
  border-radius: 14px;
  background: var(--shell-panel-soft);
  border: 1px solid var(--shell-line-soft);
}

.otd-local-tab {
  appearance: none;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: var(--text-muted);
  font: inherit;
  font-weight: 700;
  font-size: 12px;
  padding: 9px 12px;
  cursor: pointer;
  transition: background .18s ease, color .18s ease, box-shadow .18s ease, transform .18s ease;
}

.otd-local-tab:hover {
  color: var(--text-body);
  transform: translateY(-1px);
}

.otd-local-tab.active {
  background: var(--shell-panel);
  color: var(--theme-title-color);
  box-shadow: 0 8px 18px rgba(15, 23, 42, 0.08);
}

.otd-local-panel[hidden] {
  display: none !important;
}

.otd-local-panel.active {
  animation: workspaceFade .18s ease;
}

@keyframes workspaceFade {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: translateY(0); }
}

.workspace-panel-copy {
  margin-bottom: 12px;
}

.workspace-panel-copy h3,
.workspace-panel-copy h2 {
  margin: 0 0 4px;
}

.workspace-panel-copy p {
  margin: 0;
  color: var(--text-muted);
}

.workspace-dual-list {
  display: grid;
  gap: 14px;
}

.workspace-divider {
  height: 1px;
  background: var(--shell-line-soft);
  margin: 2px 0;
}

.workspace-side-note {
  font-size: 12px;
  color: var(--text-muted);
  background: var(--shell-panel-soft);
  border: 1px solid var(--shell-line-soft);
  border-radius: 12px;
  padding: 12px 13px;
}

.workspace-side-note strong {
  color: var(--text-body);
}

.workspace-actions-col {
  display: grid;
  gap: 12px;
}

.workspace-field-block {
  padding: 12px;
  border-radius: 14px;
  background: var(--shell-panel-soft);
  border: 1px solid var(--shell-line-soft);
}

.workspace-field-block > *:first-child {
  margin-top: 0;
}

.workspace-field-block > *:last-child {
  margin-bottom: 0;
}

.workspace-fit-select {
  width: min(360px, 100%);
}

@media (max-width: 1180px) {
  .software-focus-grid {
    grid-template-columns: 1fr;
  }

  .workspace-sticky {
    position: static;
  }
}

@media (max-width: 640px) {
  .software-focus-card {
    padding: 14px;
  }

  .otd-local-tabs {
    overflow-x: auto;
    flex-wrap: nowrap;
    padding-bottom: 6px;
  }

  .otd-local-tab {
    white-space: nowrap;
  }
}

.workspace-modebar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin: 18px 0 14px;
  padding: 12px 14px;
  border-radius: 16px;
  border: 1px solid var(--shell-line-soft);
  background: linear-gradient(180deg, var(--shell-panel) 0%, var(--shell-panel-soft) 100%);
  box-shadow: var(--shell-shadow);
}

.workspace-modebar-copy {
  display: grid;
  gap: 2px;
}

.workspace-modebar-copy strong {
  color: var(--theme-title-color);
  font-size: 14px;
}

.workspace-modebar-copy span {
  color: var(--text-muted);
  font-size: 12px;
}

.workspace-modebar-actions {
  display: inline-flex;
  gap: 8px;
  flex-wrap: wrap;
}

.workspace-desk-toggle {
  margin-left: 6px;
  white-space: nowrap;
}

.workspace-mode-btn {
  appearance: none;
  border: 1px solid var(--shell-line-soft);
  background: var(--shell-panel);
  color: var(--text-muted);
  border-radius: 999px;
  padding: 9px 13px;
  font: inherit;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  transition: background .18s ease, color .18s ease, transform .18s ease, box-shadow .18s ease;
}

.workspace-mode-btn:hover {
  transform: translateY(-1px);
  color: var(--text-body);
}

.workspace-mode-btn.active {
  background: var(--theme-kicker);
  color: #fff;
  border-color: transparent;
  box-shadow: 0 12px 24px rgba(16,163,127,0.18);
}

.workspace-head-actions {
  display: inline-flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
}

.workspace-quick-btn {
  white-space: nowrap;
}

.workspace-software-deck {
  transition: grid-template-columns .22s ease;
}

.workspace-pane-card {
  max-height: calc(100vh - var(--shell-topbar-height) - 170px);
  overflow: auto;
  scrollbar-gutter: stable;
}

.workspace-pane-card::-webkit-scrollbar {
  width: 10px;
}

.workspace-pane-card::-webkit-scrollbar-thumb {
  background: rgba(148,163,184,0.24);
  border-radius: 999px;
}

.workspace-pane-tabs {
  position: sticky;
  top: 0;
  z-index: 2;
}

.workspace-pane-list {
  display: grid;
  gap: 10px;
}

.software-focus-grid[data-focus-mode="board"] {
  grid-template-columns: minmax(0, 1fr) 0;
}

.software-focus-grid[data-focus-mode="board"] .software-focus-side {
  display: none;
}

.software-focus-grid[data-focus-mode="desk"] {
  grid-template-columns: minmax(260px, 0.78fr) minmax(360px, 1.22fr);
}

.software-focus-grid[data-focus-mode="desk"] .software-focus-main {
  opacity: .72;
}

.software-focus-grid[data-focus-mode="desk"] .software-focus-main .workspace-pane-card {
  max-height: calc(100vh - var(--shell-topbar-height) - 210px);
}

.software-focus-grid[data-focus-mode="split"] .software-focus-main,
.software-focus-grid[data-focus-mode="split"] .software-focus-side,
.software-focus-grid[data-focus-mode="board"] .software-focus-main,
.software-focus-grid[data-focus-mode="desk"] .software-focus-side {
  animation: workspaceFade .18s ease;
}

.software-focus-side .form-grid {
  gap: 10px 12px;
}

.software-focus-side .form-group {
  margin-bottom: 0;
}

.software-focus-side .form-group label {
  font-size: 11px;
}

.software-focus-side .form-group input,
.software-focus-side .form-group select,
.software-focus-side .form-group textarea {
  padding: 10px 11px;
}

.software-focus-side .workspace-panel-copy,
.software-focus-main .workspace-panel-copy {
  position: sticky;
  top: 56px;
  z-index: 1;
  background: color-mix(in srgb, var(--shell-panel) 82%, transparent);
  backdrop-filter: blur(8px);
  padding-bottom: 8px;
}

@media (max-width: 1180px) {
  .workspace-modebar {
    flex-direction: column;
    align-items: stretch;
  }

  .workspace-modebar-actions {
    width: 100%;
  }

  .workspace-mode-btn {
    flex: 1 1 0;
    text-align: center;
  }

  .software-focus-grid[data-focus-mode="desk"],
  .software-focus-grid[data-focus-mode="board"],
  .software-focus-grid[data-focus-mode="split"] {
    grid-template-columns: 1fr;
  }

  .software-focus-grid[data-focus-mode="board"] .software-focus-side,
  .software-focus-grid[data-focus-mode="desk"] .software-focus-main {
    display: none;
  }

  .workspace-pane-card {
    max-height: none;
    overflow: visible;
  }
}

/* Project Intelligence Center */
.software-tabbar.intelligence-tabbar {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  border-bottom: 1px solid var(--shell-line);
  padding-bottom: 12px;
}

.software-tab {
  border: 1px solid var(--shell-line);
  background: var(--panel-bg);
  color: var(--text-main);
  border-radius: 999px;
  padding: 9px 14px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .02em;
  cursor: pointer;
  transition: transform .18s ease, border-color .18s ease, box-shadow .18s ease, background .18s ease;
}

.software-tab:hover {
  transform: translateY(-1px);
  border-color: var(--brand-2);
}

.software-tab.active {
  background: color-mix(in srgb, var(--brand-2) 14%, var(--panel-bg));
  border-color: color-mix(in srgb, var(--brand-2) 42%, var(--shell-line));
  box-shadow: 0 10px 24px rgba(5, 26, 19, 0.08);
}

.intelligence-toolbar-grid {
  width: 100%;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.check-chip {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border-radius: 14px;
  border: 1px solid var(--shell-line);
  background: var(--panel-soft-bg);
  font-size: 12px;
  font-weight: 600;
}

.check-chip input[type="checkbox"] {
  width: 16px;
  height: 16px;
}

.intelligence-grid-wrap {
  overflow: auto;
  max-width: 100%;
}

.intelligence-table {
  min-width: 1100px;
}

.intelligence-ledger-table {
  min-width: 1500px;
}

.intelligence-table thead th {
  position: sticky;
  top: 0;
  z-index: 2;
  white-space: nowrap;
}

.intelligence-table tbody td:first-child,
.intelligence-table thead th:first-child,
.intelligence-table tfoot td:first-child {
  position: sticky;
  left: 0;
  z-index: 1;
  background: inherit;
}

.intelligence-table thead th:first-child {
  z-index: 3;
  background: var(--panel-soft-bg);
}

.intelligence-table tfoot td {
  position: sticky;
  bottom: 0;
  background: color-mix(in srgb, var(--panel-soft-bg) 84%, white 16%);
  font-weight: 800;
  border-top: 1px solid var(--shell-line);
}

.intelligence-table td strong {
  display: block;
}

.intelligence-table tr.success-row td {
  background: color-mix(in srgb, rgba(16,163,127,0.06) 100%, transparent);
}

.intelligence-table tr.warning-row td {
  background: color-mix(in srgb, rgba(223,147,34,0.08) 100%, transparent);
}

.intelligence-table tr.danger-row td {
  background: color-mix(in srgb, rgba(197,61,61,0.08) 100%, transparent);
}

.intelligence-split-grid {
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
}

.muted-card {
  opacity: .74;
}

@media (max-width: 900px) {
  .software-tabbar.intelligence-tabbar {
    overflow: auto;
    flex-wrap: nowrap;
    padding-bottom: 10px;
  }
  .intelligence-table,
  .intelligence-ledger-table {
    min-width: 920px;
  }
}


/* Module identity accents */

body[data-section="daily-capital"] { --brand-2: #146c9c; }

body[data-section="daily-capital"] .daily-capital-hero {
  background: linear-gradient(180deg, color-mix(in srgb, var(--brand-2) 5%, var(--shell-panel)) 0%, var(--shell-panel) 100%);
}

body[data-section="daily-capital"] .daily-capital-toolbar {
  padding: 14px;
  border-radius: 16px;
  border: 1px solid color-mix(in srgb, var(--brand-2) 16%, var(--shell-line));
  background: linear-gradient(180deg, color-mix(in srgb, var(--brand-2) 4%, var(--shell-panel-soft)) 0%, var(--shell-panel) 100%);
}

body[data-section="daily-capital"] .daily-capital-stats .stat {
  border: 1px solid color-mix(in srgb, var(--brand-2) 14%, var(--shell-line));
  background: linear-gradient(180deg, color-mix(in srgb, var(--brand-2) 5%, var(--panel-bg)) 0%, var(--panel-bg) 100%);
  box-shadow: 0 10px 26px color-mix(in srgb, var(--brand-2) 8%, transparent);
}

body[data-section="daily-capital"] .daily-capital-stats .stat-value {
  color: color-mix(in srgb, var(--brand-2) 74%, var(--theme-title-color));
}

body[data-section="daily-capital"] .daily-capital-stats .stat-label {
  letter-spacing: .02em;
}

body[data-section="daily-capital"] .daily-capital-side .software-focus-card {
  background: linear-gradient(180deg, color-mix(in srgb, var(--brand-2) 4%, var(--shell-panel)) 0%, var(--shell-panel) 100%);
}

body[data-section="daily-capital"] .daily-capital-side .workspace-head .kicker,
body[data-section="daily-capital"] .daily-capital-hero .kicker {
  color: color-mix(in srgb, var(--brand-2) 82%, var(--theme-kicker));
}

body[data-section="daily-capital"] .daily-capital-side .otd-local-tabs {
  background: color-mix(in srgb, var(--brand-2) 5%, var(--shell-panel-soft));
  border-color: color-mix(in srgb, var(--brand-2) 14%, var(--shell-line-soft));
}

body[data-section="daily-capital"] .daily-capital-side .otd-local-tab.active {
  background: color-mix(in srgb, var(--brand-2) 12%, var(--shell-panel));
}

body[data-section="daily-capital"] #dailyCapitalLedgerWrap .intelligence-grid-wrap,
body[data-section="daily-capital"] #capitalTrendsWrap .intelligence-grid-wrap,
body[data-section="daily-capital"] #capitalSourceWrap .intelligence-grid-wrap {
  border-radius: 16px;
}

body[data-section="project-intelligence"] { --brand-2: #2258d5; }
body[data-section^="equipment"], body[data-section="equipment-master"], body[data-section="equipment-finance"] { --brand-2: #a85d12; }
body[data-section^="petty-cash"] { --brand-2: #7b3fe4; }
body[data-section^="fundi"] { --brand-2: #0b8b6b; }
body[data-section="daily-report"], body[data-section="reports"] { --brand-2: #1764c0; }
body[data-section^="materials"] { --brand-2: #8a6a08; }
body[data-section^="labor"] { --brand-2: #127a71; }
body[data-section^="quality"] { --brand-2: #6e42c1; }
body[data-section^="safety"] { --brand-2: #b23b3b; }
body[data-section^="photos"], body[data-section^="site-diary"] { --brand-2: #0b7f9b; }

/* Normalize card-like surfaces so module identity styles never trample content. */
body[data-section] .card,
body[data-section] .shell-inner-card,
body[data-section] .software-focus-card,
body[data-section] .workspace-pane-card,
body[data-section] .readonly-block,
body[data-section] .empty-state,
body[data-section] .list-item {
  position: relative;
  isolation: isolate;
  background-clip: padding-box;
}

body[data-section] .topbar {
  border-bottom: 1px solid color-mix(in srgb, var(--brand-2) 24%, var(--shell-line));
  box-shadow: 0 12px 30px color-mix(in srgb, var(--brand-2) 8%, transparent);
}
body[data-section] .brand-title {
  text-shadow: 0 1px 0 rgba(255,255,255,.45);
}

/* Only accent explicitly safe surfaces. Do not target generic first cards anymore,
   because that was hitting too many unrelated cards and clipping edge content. */
body[data-section] .dashboard-hero,
body[data-section] .module-accent-card {
  position: relative;
  border-inline-start: 4px solid color-mix(in srgb, var(--brand-2) 82%, white 18%);
  padding-inline-start: 16px;
  box-shadow: 0 0 0 1px var(--shell-line);
  background-clip: padding-box;
}

body[data-section] .dashboard-hero::before,
body[data-section] .module-accent-card::before,
body[data-section] .card.compact-card::before,
body[data-section] .shell-inner-card::before,
body[data-section] .software-focus-card::before,
body[data-section] .workspace-pane-card::before {
  content: none !important;
}

/* Remove inherited left accent behavior from generic compact cards completely. */
body[data-section] .card.compact-card,
body[data-section] .shell-inner-card,
body[data-section] .software-focus-card,
body[data-section] .workspace-pane-card {
  border-inline-start: 1px solid var(--shell-line);
  padding-inline-start: 13px;
  box-shadow: none;
}

body[data-section] .software-tab.active,
body[data-section] .otd-local-tab.active {
  box-shadow: 0 10px 24px color-mix(in srgb, var(--brand-2) 14%, transparent);
}
.field-help {
  display: block;
  margin-top: 6px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.4;
}
.intelligence-trend-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--brand-2) 10%, var(--panel-soft-bg));
  border: 1px solid color-mix(in srgb, var(--brand-2) 20%, var(--shell-line));
}
.intelligence-table td,
.intelligence-table th {
  vertical-align: top;
}


/* Workspace content-visibility fix: sticky copy/tabs inside scrolling pane cards
   were covering the first rows/fields on multiple split-workspace pages. Keep
   the pane scroll, but let section headers live in normal flow so content stays
   fully reachable and visible. */
.workspace-pane-card {
  scroll-padding-top: 16px;
}

.workspace-pane-card .workspace-panel-copy,
.workspace-pane-card .workspace-pane-tabs,
.workspace-pane-card .otd-local-tabs {
  position: static;
  top: auto;
  z-index: auto;
  background: transparent;
  backdrop-filter: none;
  padding-bottom: 0;
}

.workspace-pane-card .workspace-panel-copy {
  margin-bottom: 12px;
}

.workspace-pane-card .otd-local-tabs,
.workspace-pane-card .workspace-pane-tabs {
  margin-bottom: 14px;
}

/* Keep scroll areas usable without clipping the top and bottom rows. */
.software-focus-main .workspace-pane-card,
.software-focus-side .workspace-pane-card {
  padding-top: 18px;
  padding-bottom: 18px;
}

/* Title/action split cards should never clip their own content. */
.software-focus-card,
.workspace-pane-card {
  overflow-x: hidden;
  overflow-y: auto;
}

/* Daily Capital should look like a first-class accountant workspace */
body[data-section="daily-capital"] .daily-capital-hero.dashboard-hero {
  box-shadow: 0 16px 36px color-mix(in srgb, var(--brand-2) 10%, transparent);
}
body[data-section="daily-capital"] .daily-capital-hero .inline-actions .btn {
  min-width: 180px;
}
body[data-section="daily-capital"] .daily-capital-side .software-focus-card,
body[data-section="daily-capital"] .software-focus-main .software-focus-card {
  border-color: color-mix(in srgb, var(--brand-2) 16%, var(--shell-line));
}

/* --------------------------------------------------------------------------
   Otonde Admin UX Stabilization v11
   - Desktop scroll safety for sidebar/right action panels
   - Mobile drawer + bottom navigation pattern
   - Smaller, calmer mobile information density
---------------------------------------------------------------------------- */

.app-sidebar {
  min-height: 100dvh;
  max-height: 100dvh;
  overflow: hidden;
}

.sidebar-nav {
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  padding-right: 2px;
  scrollbar-width: thin;
  scrollbar-color: rgba(255,255,255,0.22) transparent;
}

.sidebar-nav::-webkit-scrollbar,
.workspace-sticky::-webkit-scrollbar,
.software-focus-side::-webkit-scrollbar,
.otd-local-panel::-webkit-scrollbar,
.card::-webkit-scrollbar,
.shell-inner-card::-webkit-scrollbar {
  width: 7px;
  height: 7px;
}

.sidebar-nav::-webkit-scrollbar-thumb,
.workspace-sticky::-webkit-scrollbar-thumb,
.software-focus-side::-webkit-scrollbar-thumb,
.otd-local-panel::-webkit-scrollbar-thumb,
.card::-webkit-scrollbar-thumb,
.shell-inner-card::-webkit-scrollbar-thumb {
  background: color-mix(in srgb, var(--brand) 35%, transparent);
  border-radius: 999px;
}

.sidebar-utility,
.sidebar-foot {
  flex: 0 0 auto;
}

.workspace-sticky,
.software-focus-side .workspace-sticky {
  max-height: calc(100dvh - var(--shell-topbar-height) - 24px);
  overflow-y: auto;
  overscroll-behavior: contain;
  padding-right: 4px;
}

.software-focus-side,
.software-focus-main,
.workspace-pane-card {
  min-height: 0;
}

[data-focus-mode="split"] .software-focus-side,
[data-focus-mode="desk"] .software-focus-side {
  max-height: calc(100dvh - var(--shell-topbar-height) - 24px);
  overflow-y: auto;
  overscroll-behavior: contain;
}

.otd-local-panel.active {
  min-height: 0;
}

.mobile-shell-bar,
.mobile-drawer,
.mobile-drawer-backdrop,
.mobile-bottom-nav {
  display: none;
}

.mobile-drawer-open {
  overflow: hidden;
}

@media (max-width: 820px) {
  :root,
  :root[data-theme="light"],
  :root[data-theme="dark"],
  :root[data-theme="african"] {
    --shell-topbar-height: 58px;
    --mobile-bottom-nav-height: 68px;
  }

  .software-app {
    min-height: 100dvh;
    display: block;
  }

  .app-main {
    padding-top: var(--shell-topbar-height);
    padding-bottom: calc(var(--mobile-bottom-nav-height) + env(safe-area-inset-bottom, 0px));
    min-height: 100dvh;
  }

  .mobile-shell-bar {
    position: fixed;
    inset: 0 0 auto 0;
    min-height: var(--shell-topbar-height);
    padding: max(6px, env(safe-area-inset-top, 0px)) 12px 6px;
    display: grid;
    grid-template-columns: 42px minmax(0, 1fr) auto;
    align-items: center;
    gap: 10px;
    z-index: 65;
    background: color-mix(in srgb, var(--shell-topbar-bg) 94%, transparent);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-bottom: 1px solid var(--shell-topbar-border);
    box-shadow: 0 12px 34px rgba(15,23,42,0.08);
  }

  .mobile-shell-menu,
  .mobile-drawer-close {
    width: 40px;
    height: 40px;
    border-radius: 14px;
    border: 1px solid var(--shell-line);
    background: var(--shell-panel);
    color: var(--theme-title-color);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 10px 24px rgba(15,23,42,0.08);
  }

  .mobile-shell-menu svg,
  .mobile-drawer-close svg,
  .mobile-bottom-link svg,
  .mobile-drawer-icon svg,
  .mobile-drawer-arrow svg {
    width: 19px;
    height: 19px;
    stroke: currentColor;
  }

  .mobile-shell-brand,
  .mobile-drawer-brand {
    min-width: 0;
    display: flex;
    align-items: center;
    gap: 9px;
    color: var(--theme-title-color);
    text-decoration: none;
  }

  .mobile-shell-logo {
    width: 34px;
    height: 34px;
    border-radius: 12px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    background: white;
    box-shadow: 0 10px 22px rgba(15,23,42,0.10);
    flex: 0 0 auto;
  }

  .mobile-shell-logo img {
    width: 100%;
    height: 100%;
    object-fit: contain;
  }

  .mobile-shell-brand strong,
  .mobile-drawer-brand strong {
    display: block;
    font-size: 12px;
    letter-spacing: .12em;
    line-height: 1.05;
  }

  .mobile-shell-brand small,
  .mobile-drawer-brand small {
    display: block;
    max-width: 150px;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
    color: var(--text-muted);
    font-size: 10px;
    line-height: 1.2;
  }

  .mobile-shell-current {
    max-width: 110px;
    padding: 8px 10px;
    border-radius: 999px;
    background: color-mix(in srgb, var(--brand) 10%, var(--shell-panel));
    color: var(--theme-title-color);
    border: 1px solid color-mix(in srgb, var(--brand) 20%, var(--shell-line));
    font-size: 10.5px;
    font-weight: 800;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .mobile-drawer-backdrop {
    position: fixed;
    inset: 0;
    display: block;
    background: rgba(2, 6, 23, 0.48);
    opacity: 0;
    pointer-events: none;
    transition: opacity .18s ease;
    z-index: 80;
  }

  .mobile-drawer-backdrop.open {
    opacity: 1;
    pointer-events: auto;
  }

  .mobile-drawer {
    position: fixed;
    display: flex;
    flex-direction: column;
    inset: 0 auto 0 0;
    width: min(86vw, 340px);
    z-index: 90;
    transform: translateX(-105%);
    transition: transform .22s ease;
    background: linear-gradient(180deg, var(--shell-sidebar) 0%, var(--shell-sidebar-2) 100%);
    color: var(--shell-sidebar-text);
    box-shadow: 24px 0 60px rgba(2,6,23,0.28);
    padding: max(14px, env(safe-area-inset-top, 0px)) 14px 16px;
    border-right: 1px solid var(--shell-sidebar-border);
  }

  .mobile-drawer.open {
    transform: translateX(0);
  }

  .mobile-drawer-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding-bottom: 14px;
    border-bottom: 1px solid var(--shell-sidebar-border);
  }

  .mobile-drawer-brand {
    color: white;
  }

  .mobile-drawer-brand small {
    color: rgba(255,255,255,0.58);
  }

  .mobile-drawer-close {
    background: rgba(255,255,255,0.08);
    border-color: rgba(255,255,255,0.14);
    color: white;
    box-shadow: none;
  }

  .mobile-drawer-section-title {
    margin: 16px 8px 8px;
    color: rgba(255,255,255,0.46);
    text-transform: uppercase;
    letter-spacing: .14em;
    font-size: 10px;
    font-weight: 800;
  }

  .mobile-drawer-nav {
    min-height: 0;
    overflow-y: auto;
    display: grid;
    gap: 7px;
    padding: 0 2px 12px;
  }

  .mobile-drawer-link {
    display: grid;
    grid-template-columns: 34px minmax(0, 1fr) 18px;
    align-items: center;
    gap: 10px;
    min-height: 46px;
    padding: 7px 10px;
    border-radius: 14px;
    color: rgba(255,255,255,0.76);
    background: rgba(255,255,255,0.04);
    border: 1px solid rgba(255,255,255,0.06);
    text-decoration: none;
    font-size: 12.5px;
    font-weight: 700;
  }

  .mobile-drawer-link.active {
    color: white;
    background: linear-gradient(135deg, color-mix(in srgb, var(--brand) 50%, transparent), color-mix(in srgb, var(--brand-2) 42%, transparent));
    border-color: rgba(255,255,255,0.18);
  }

  .mobile-drawer-icon {
    width: 34px;
    height: 34px;
    border-radius: 12px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: rgba(255,255,255,0.08);
  }

  .mobile-drawer-arrow {
    opacity: .55;
  }

  .mobile-drawer-actions {
    margin-top: auto;
    padding-top: 12px;
    border-top: 1px solid var(--shell-sidebar-border);
  }

  .mobile-bottom-nav {
    position: fixed;
    inset: auto 10px max(8px, env(safe-area-inset-bottom, 0px)) 10px;
    height: 58px;
    z-index: 64;
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 5px;
    padding: 6px;
    border-radius: 22px;
    background: color-mix(in srgb, var(--shell-panel) 94%, transparent);
    border: 1px solid var(--shell-line);
    box-shadow: 0 16px 38px rgba(15,23,42,0.16);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
  }

  .mobile-bottom-link {
    appearance: none;
    border: 0;
    background: transparent;
    border-radius: 16px;
    color: var(--text-muted);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    text-decoration: none;
    font-size: 9.5px;
    font-weight: 800;
    min-width: 0;
    cursor: pointer;
  }

  .mobile-bottom-link span {
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .mobile-bottom-link.active {
    color: white;
    background: linear-gradient(135deg, var(--brand), var(--brand-2));
    box-shadow: 0 10px 22px color-mix(in srgb, var(--brand) 24%, transparent);
  }

  .topbar {
    top: var(--shell-topbar-height);
    z-index: 28;
  }

  .topbar-inner {
    gap: 8px;
  }

  .topbar .brand {
    display: none;
  }

  .topbar-actions,
  .topbar-meta {
    overflow-x: auto;
    flex-wrap: nowrap;
    padding-bottom: 2px;
    scrollbar-width: none;
  }

  .topbar-actions::-webkit-scrollbar,
  .topbar-meta::-webkit-scrollbar {
    display: none;
  }

  .otd-theme-switcher {
    min-width: max-content;
  }

  .otd-theme-btn {
    min-width: 74px;
  }

  .container,
  .otd-software-page .container {
    padding: 12px 10px calc(82px + env(safe-area-inset-bottom, 0px));
  }

  .dashboard-hero,
  .card,
  .shell-inner-card,
  .software-focus-card,
  .otd-review-console {
    border-radius: 18px;
  }

  .dashboard-hero,
  .otd-software-page .card,
  .otd-software-page .shell-inner-card,
  .software-focus-card {
    padding: 14px;
  }

  .stats {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .project-card-title,
  .workspace-head,
  .software-focus-card .project-card-title,
  .software-focus-card .workspace-head {
    gap: 10px;
  }

  .project-card-title .actions,
  .workspace-head .actions,
  .workspace-head-actions,
  .otd-panel-tools,
  .workspace-modebar-actions,
  .otd-board-toolbar-controls {
    width: 100%;
    display: flex;
    overflow-x: auto;
    flex-wrap: nowrap;
    gap: 8px;
    padding-bottom: 3px;
    scrollbar-width: none;
  }

  .project-card-title .actions::-webkit-scrollbar,
  .workspace-head .actions::-webkit-scrollbar,
  .workspace-head-actions::-webkit-scrollbar,
  .otd-panel-tools::-webkit-scrollbar,
  .workspace-modebar-actions::-webkit-scrollbar,
  .otd-board-toolbar-controls::-webkit-scrollbar {
    display: none;
  }

  .project-card-title .actions > *,
  .workspace-head .actions > *,
  .workspace-head-actions > *,
  .otd-panel-tools > *,
  .workspace-modebar-actions > *,
  .otd-board-toolbar-controls > * {
    flex: 0 0 auto;
  }

  .otd-workspace-tabs {
    position: sticky;
    top: calc(var(--shell-topbar-height) + 56px);
    z-index: 22;
    padding: 10px;
    margin-inline: -2px;
  }

  .otd-workspace-tabs-head {
    display: none;
  }

  .otd-workspace-tab-bar,
  .otd-local-tabs {
    overflow-x: auto;
    flex-wrap: nowrap;
    scrollbar-width: none;
    padding-bottom: 6px;
  }

  .otd-workspace-tab-bar::-webkit-scrollbar,
  .otd-local-tabs::-webkit-scrollbar {
    display: none;
  }

  .otd-workspace-tab,
  .otd-local-tab,
  .workspace-mode-btn,
  .workspace-quick-btn {
    white-space: nowrap;
    flex: 0 0 auto;
  }

  .software-focus-grid {
    grid-template-columns: 1fr;
    gap: 12px;
    margin-top: 12px;
  }

  .software-focus-grid[data-focus-mode="board"] .software-focus-side {
    display: none;
  }

  .software-focus-grid[data-focus-mode="split"] .software-focus-side,
  .software-focus-grid[data-focus-mode="desk"] .software-focus-side {
    display: block;
    max-height: none;
    overflow: visible;
  }

  .workspace-sticky,
  .software-focus-side .workspace-sticky {
    position: static;
    max-height: none;
    overflow: visible;
    padding-right: 0;
  }

  .workspace-modebar {
    padding: 10px;
    border-radius: 18px;
  }

  .workspace-modebar-copy span {
    display: none;
  }

  .otd-board-toolbar {
    display: grid;
    gap: 10px;
  }

  .otd-board-toolbar-heading {
    min-width: 0;
  }

  .otd-board-search {
    min-width: 220px;
  }

  .list,
  .workspace-pane-list,
  .otd-software-page .list {
    gap: 10px;
  }

  .list-item {
    padding: 12px;
  }

  .form-grid,
  .otd-software-page .form-grid,
  .otd-software-page .grid.two,
  .otd-software-page .grid.three,
  .otd-software-page .grid.four,
  .otd-software-page .compact-grid,
  .grid.two,
  .grid.three,
  .grid.four,
  .compact-grid {
    grid-template-columns: 1fr !important;
  }

  .app-footer {
    display: none;
  }
}

@media (max-width: 420px) {
  .mobile-shell-bar {
    grid-template-columns: 40px minmax(0, 1fr);
  }

  .mobile-shell-current {
    display: none;
  }

  .mobile-bottom-nav {
    inset-inline: 6px;
    grid-template-columns: repeat(5, minmax(0, 1fr));
  }

  .mobile-bottom-link span {
    font-size: 9px;
  }
}

@media (min-width: 821px) {
  .mobile-shell-bar,
  .mobile-drawer,
  .mobile-drawer-backdrop,
  .mobile-bottom-nav {
    display: none !important;
  }
}
