/* app.css: global custom styles for Badi.PLAN */

/* === CSS Variables === */
:root {
  --base-font-family: 'Inter', 'Segoe UI', Roboto, 'Helvetica Neue', sans-serif;
  --app-radius: 12px;
  --app-gap: 1rem;
  --panel-bg: #fff;
  --panel-border: 1px solid rgba(0,0,0,0.08);
  --panel-elevation: 0 0.125rem 0.25rem rgba(0,0,0,0.075);
  --panel-accent: var(--bs-primary);
  --panel-min-width: 280px;
  --panel-fixed-width: 360px;
}

/* Pickr color picker z-index (above Bootstrap modals) */
.pickr { z-index: 1051; }

/* ── Self-hosted Inter (latin + latin-ext, woff2) ── */
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 100;
  font-display: swap;
  src: url('../fonts/inter-v20-latin_latin-ext-100.woff2') format('woff2');
}
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 200;
  font-display: swap;
  src: url('../fonts/inter-v20-latin_latin-ext-200.woff2') format('woff2');
}
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 300;
  font-display: swap;
  src: url('../fonts/inter-v20-latin_latin-ext-300.woff2') format('woff2');
}
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('../fonts/inter-v20-latin_latin-ext-regular.woff2') format('woff2');
}
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url('../fonts/inter-v20-latin_latin-ext-500.woff2') format('woff2');
}
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url('../fonts/inter-v20-latin_latin-ext-600.woff2') format('woff2');
}
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url('../fonts/inter-v20-latin_latin-ext-700.woff2') format('woff2');
}
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 800;
  font-display: swap;
  src: url('../fonts/inter-v20-latin_latin-ext-800.woff2') format('woff2');
}
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 900;
  font-display: swap;
  src: url('../fonts/inter-v20-latin_latin-ext-900.woff2') format('woff2');
}

/* ── Global base styles ─────────────────────────────────────────────────── */
/* Sets min-height, font, and ensures the main content container fills the viewport */
html, body {
  min-height: 100vh;
  font-family: var(--base-font-family);
}

body > .container.min-vh-100 {
  min-height: 100vh !important;
  height: 100vh !important;
}

.os-scrollbar {
  --os-size: 18px !important;
}

/* Footer version link — subtle, discoverable on hover */
.footer-version-link { color: inherit; text-decoration: none; }
.footer-version-link:hover { text-decoration: underline; opacity: 1; }

/* ── OverlayScrollbars inner wrapper ─────────────────────────────────────── */
/* Maintains flex-column layout so the footer stays at the bottom */
#os-scroll-inner {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* ── Full-page loading overlay ───────────────────────────────────────────── */
/* Fixed, full-viewport, semi-transparent white shield with a spinner.
   Shown during heavy navigations / saves. z-index 1999 (below session overlay 2100). */
div#fullpage-loading-overlay {
    top:0;
    left:0;
    position:fixed;
    z-index:1999;
    width:100vw;
    height:100vh;
    background:rgba(255,255,255,0.5);
    display:flex;
    align-items:center;
    justify-content:center;
}
div#fullpage-loading-overlay .spinner-border {
    width:3rem;
    height:3rem;
}

/* Year dropdown button: prevent white-on-white after selection */
#planYearDropdown,
#planYearDropdown:focus,
#planYearDropdown:active,
#planYearDropdown.show {
    color: var(--bs-primary) !important;
    background-color: transparent !important;
}
#planYearDropdown:hover {
    color: #fff !important;
    background-color: var(--bs-primary) !important;
}

/* ── Universal mini confirm popup ───────────────────────────────────────── */
.mini-confirm-overlay {
  position: fixed;
  inset: 0;
  z-index: 2000;
  background: rgba(0, 0, 0, 0.25);
  display: flex;
  align-items: center;
  justify-content: center;
  animation: miniConfirmFadeIn 0.12s ease;
}
@keyframes miniConfirmFadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}
.mini-confirm-box {
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.18);
  padding: 1.25rem 1.5rem 1rem;
  min-width: 280px;
  max-width: 360px;
  text-align: center;
}
.mini-confirm-icon {
  font-size: 2rem;
  margin-bottom: 0.6rem;
}
.mini-confirm-icon-warning  { color: #e2a20c; }
.mini-confirm-icon-danger   { color: #dc3545; }
.mini-confirm-icon-info     { color: #0dcaf0; }
.mini-confirm-icon-success  { color: #198754; }
.mini-confirm-icon-primary  { color: #0d6efd; }
.mini-confirm-icon-secondary{ color: #6c757d; }
.mini-confirm-body {
  font-size: 0.88rem;
  line-height: 1.5;
  padding: 0.6rem 0.9rem !important;
  margin-bottom: 0.9rem !important;
  text-align: center;
}
.mini-confirm-btns {
  display: flex;
  gap: 0.5rem;
  justify-content: center;
}
.mini-confirm-btns .btn {
  min-width: 70px;
}
.mini-confirm-plain {
  font-size: 0.88rem;
  line-height: 1.5;
  margin-bottom: 0.9rem;
  text-align: center;
}

/* Compact alerts with icons */
.alert-compact {
  padding: 0.5rem 0.75rem;
  font-size: 0.875rem;
  line-height: 1.4;
}
.alert-compact i.bi {
  font-size: 1rem;
  flex-shrink: 0;
}

/* ── Online user avatars (navbar) ───────────────────────────────────────── */

/* Mobile: hide online avatars and the hamburger toggler.
   On small screens the collapse menu only contains avatars,
   so both become unnecessary (applies to ALL pages). */
@media (max-width: 991.98px) {
  #online-avatars {
    display: none !important;
  }
  /* When online-avatars is hidden the bell has no ms-auto sibling to
     push it right, so apply it directly on mobile only. */
  #notifications-dropdown {
    margin-left: auto;
  }
}

#online-avatars {
  gap: 3px;
  flex-wrap: wrap;
  margin-right: 0.6rem;
}
@media (min-width: 992px) {
  #online-avatars { flex-wrap: nowrap; }
}
/* Enter / leave transitions for online avatar circles */
#online-avatars .avatar {
  transition: opacity 150ms ease;
}
#online-avatars .avatar.avatar-entering,
#online-avatars .avatar.avatar-leaving {
  opacity: 0;
}
/* ── Unified avatar circle ──────────────────────────────────────────────── */
/* Base style — shared by all avatar sizes (online, user-dropdown, activity,
   admin user-list, settings profile).  Size modifiers: .avatar-sm (28 px),
   .avatar-md (32 px), .avatar-lg (56 px).  The element's inline style sets
   border-color, color (darkened initials), and background (light wash). */
.avatar {
  position: relative;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  line-height: 1;
  letter-spacing: 0.03em;
  border: 2px solid;
  outline: 1px solid rgba(0, 0, 0, 0.15);
  outline-offset: -1px;
  cursor: default;
  flex-shrink: 0;
  user-select: none;
}
/* 28 px — online avatars, activity table, admin user-list, author filter */
.avatar-sm {
  width: 28px;
  height: 28px;
  min-width: 28px;
  font-size: 0.65rem;
}
/* 32 px — navbar user-dropdown avatar */
.avatar-md {
  width: 32px;
  height: 32px;
  min-width: 32px;
  font-size: 0.72rem;
  border-width: 2.5px;
  cursor: pointer;
  transition: box-shadow 0.15s ease, transform 0.15s ease;
}
.avatar-md:hover {
  box-shadow: 0 0 0 3px rgba(var(--bs-primary-rgb), 0.25);
  transform: scale(1.08);
}
/* 56 px — settings profile page */
.avatar-lg {
  width: 56px;
  height: 56px;
  min-width: 56px;
  font-size: 1.3rem;
  font-weight: 600;
  border-width: 3px;
}
/* Green online-status dot (positioned inside avatar) */
.avatar-online-dot {
  position: absolute;
  bottom: -2px;
  right: -2px;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--bs-success);
  border: 2px solid #fff;
  pointer-events: none;
}
[data-bs-theme="dark"] .avatar-online-dot { border-color: #23272b; }
/* Larger dot for md avatars (user dropdown) */
.avatar-md .avatar-online-dot {
  bottom: -1px;
  right: -1px;
  width: 10px;
  height: 10px;
}

/* ── User avatar dropdown (navbar) ──────────────────────────────────────── */
#user-avatar-dropdown {
  margin-left: 0.25rem;
}
.user-avatar-caret {
  font-size: 0.65rem;
  margin-left: 3px;
  opacity: 0.85;
  transition: transform 0.2s ease, opacity 0.2s ease;
  color: #555;
}
#user-avatar-dropdown:hover .user-avatar-caret,
#user-avatar-dropdown.show .user-avatar-caret {
  opacity: 0.8;
}
#user-avatar-dropdown.show .user-avatar-caret {
  transform: rotate(180deg);
}

/* Active-page indicator ring */
#user-avatar-dropdown.show .avatar-md {
  box-shadow: 0 0 0 3px rgba(var(--bs-primary-rgb), 0.35);
}

#user-avatar-dropdown .dropdown-menu {
  min-width: 200px;
  font-size: 0.88rem;
  z-index: 1065;
}
#user-avatar-dropdown .dropdown-item.active {
  background-color: var(--bs-primary);
  color: #fff;
}
#user-avatar-dropdown .dropdown-item:not(.active):hover {
  background-color: var(--bs-tertiary-bg);
}

/* ── Navbar app sizing / layout overrides ───────────────────────────────────────── */
.navbar-app {
  font-size: 0.92rem;
  padding-top: 0.05rem;
  padding-bottom: 0.05rem;
}
.navbar-brand-app   { font-size: 1.1rem; }
.navbar-brand-icon  { font-size: 1.2rem; }
.navbar-sep         { height: 1.4rem; opacity: 0.25; }
.navbar-toolbar-sep { height: 1.2rem; opacity: 0.3; }

/* ── Bell notification dropdown ───────────────────────────────────────────── */
.navbar-bell-icon        { font-size: 1.4rem; }
.navbar-bell-badge       { font-size: 0.6rem; padding: 0.25em 0.45em; top: -4px; right: 2px; }
.navbar-bell-menu        { min-width: 340px; max-width: 400px; z-index: 1060; }
@media (max-width: 575.98px) {
  #notifications-dropdown { position: static !important; }
  .navbar-bell-menu { min-width: 0 !important; width: auto !important; max-width: 100% !important; left: 0.5rem !important; right: 0.5rem !important; transform: none !important; }
}
.navbar-bell-title       { font-size: 0.9rem; }
#bell-close              { font-size: 1rem; line-height: 1; }
#bell-list               { max-height: 360px; overflow-y: auto; }
.navbar-bell-empty-text,
.navbar-bell-footer-link { font-size: 0.82rem; }

/* ── App footer ──────────────────────────────────────────────────────────── */
.app-footer            { font-size: 0.75rem; color: #bbb; }
.app-footer .container { opacity: 0.6; }

/* ── Login / form utilities ────────────────────────────────────────────── */
.form-check-scale { transform: scale(1.25); margin-right: 0.5rem; }

/* ============================================ */
/* === NOTIFICATION BELL                    === */
/* ============================================ */
#notifications-dropdown .nav-link { line-height: 1; transition: transform 0.15s ease; }
#notifications-dropdown .nav-link:hover { transform: scale(1.12); }

/* ── Admin teams & resources list ────────────────────────────────────────── */
/* Removes default list-group borders and adds visual polish for the
   draggable teams/resources management page. */
/* Admin teams/resources: remove Bootstrap list-group-item borders (override, not vendor edit) */
#teams-list.list-group > .list-group-item,
#teams-list .resources-list.list-group > .list-group-item {
  border: none !important;
  /*box-shadow: none !important;
  border-radius: 0 !important;*/
}

/* Ensure resource list items align visually with team items */
#teams-list .resources-list .list-group-item {
  padding-left: 3.5rem; /* keep visual indent for resource items */
}

/* Subtle highlight for all team/resource items */
#teams-list .list-group-item > .d-flex,
#teams-list .resources-list .list-group-item {
  filter: brightness(1.08);
  box-shadow: inset 0 0 0 100px rgba(255,255,255,0.10);
  transition: filter 0.2s ease, box-shadow 0.2s ease;
}

/* --- Archived / deactivated team & resource items --- */
#teams-list .item-archived {
  opacity: 0.35;
  filter: grayscale(50%) saturate(40%);
  color: #999 !important;
  transition: opacity 0.2s ease, filter 0.2s ease;
}
#teams-list .item-archived:hover {
  opacity: 1;
  filter: none;
}
#teams-list .item-archived .badge {
  opacity: 0.8;
}

/* -----------------------------
   Panel component (unified)
   - Lightweight card-like wrapper used for content panels and sidebars
   - Supports flexible side-by-side layout via `.panel-row` and fixed-width helpers
   -----------------------------*/
.panel {
  background: var(--panel-bg);
  border-radius: var(--app-radius);
  border: var(--panel-border);
  box-shadow: var(--panel-elevation);
  overflow: hidden;
  width: 100%;
  display: flex;
  flex-direction: column;
}

/* Sidebar navigation — extends .panel with nav-specific padding.
   overflow:visible ensures nav pill focus rings are not clipped. */
.sidebar-nav {
  padding: 0.75rem;
  overflow: visible;
}

.panel-header {
  background-color: rgba(13,110,253,0.04);
  font-weight: 700;
  color: var(--bs-body-color);
  border-left: 4px solid var(--panel-accent);
  padding: 0.65rem 1rem;
}

.panel-body {
  padding: 1rem;
}

.panel-actions {
  padding: 0.75rem 1rem;
  border-top: 1px solid rgba(0,0,0,0.04);
  display: flex;
  gap: 0.5rem;
  justify-content: flex-end;
}

/* Row helper: place panels side-by-side responsively */
.panel-row {
  display: flex;
  gap: var(--app-gap);
  align-items: flex-start;
  flex-wrap: wrap;
}
.panel-row .panel {
  /* By default, panels inside a .panel-row split available space evenly.
     Use --app-gap to calculate basis so two panels become ~50% each. */
  flex: 1 1 calc(50% - (var(--app-gap) / 2));
  min-width: var(--panel-min-width);
}

@media (max-width: 767.98px) {
  .panel-row .panel {
    flex-basis: 100%;
  }
}

/* Fixed / narrow / wide helpers for forms that need two-column layouts */
.panel-fixed {
  flex: 0 0 var(--panel-fixed-width);
  max-width: var(--panel-fixed-width);
}
.panel--narrow { flex: 0 0 320px; max-width: 320px; }
.panel--wide   { flex: 2 1 0; }

/* Panel option rows: reusable two-column layout used in user settings
   - left: option label / description
   - right: control (select, input, buttons)
   Behaves responsively: control column is constrained, label grows. */
.panel-options {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
.panel-option {
  display: grid;
  grid-template-columns: 1fr minmax(220px, 420px);
  gap: 0.75rem;
  align-items: center;
  padding: 0.6rem 0.1rem;
  border-bottom: 1px solid rgba(0,0,0,0.08);
}
.panel-option:last-child { border-bottom: none; }
.panel-option .option-label {
  font-weight: 600;
  color: var(--bs-body-color);
}
.panel-option .option-hint {
  font-size: 0.875rem;
  color: #6c757d;
}

@media (max-width: 575.98px) {
  .panel-option {
    grid-template-columns: 1fr;
    align-items: start;
  }
  .panel-option .option-label { margin-bottom: 0.25rem; }
}

/* ── 2FA verification code inputs ───────────────────────────────────────── */
.tfa-code-inputs {
  gap: 0.5rem;
}
.tfa-digit {
  width: 3rem;
  height: 3.5rem;
  font-size: 1.5rem;
  font-weight: 700;
  border-radius: 0.5rem;
  border: 2px solid #dee2e6;
  transition: border-color 0.15s, box-shadow 0.15s;
  caret-color: var(--bs-primary);
  padding: 0;
}
.tfa-digit:focus {
  border-color: var(--bs-primary);
  box-shadow: 0 0 0 0.2rem rgba(13, 110, 253, 0.25);
  outline: none;
}
.tfa-digit::selection {
  background: rgba(13, 110, 253, 0.15);
}
/* Responsive: slightly smaller on mobile */
@media (max-width: 400px) {
  .tfa-digit {
    width: 2.5rem;
    height: 3rem;
    font-size: 1.25rem;
  }
  .tfa-code-inputs {
    gap: 0.35rem;
  }
}

/* ── Session / Cookie Timeout Overlay ─────────────────────────────────────── */
#session-timeout-overlay {
  position: fixed;
  inset: 0;
  z-index: 2100;
  background: rgba(0, 0, 0, 0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.4s ease;
  backdrop-filter: blur(4px);
}
#session-timeout-overlay.visible {
  opacity: 1;
}
.session-timeout-box {
  background: #fff;
  border-radius: 16px;
  padding: 2.5rem 2rem;
  max-width: 420px;
  width: 90%;
  text-align: center;
  box-shadow: 0 8px 40px rgba(0,0,0,0.25);
  animation: sessionTimeoutPulse 0.4s ease;
}
@keyframes sessionTimeoutPulse {
  0% { transform: scale(0.92); opacity: 0; }
  100% { transform: scale(1); opacity: 1; }
}
.session-timeout-icon {
  font-size: 2.5rem;
  color: var(--bs-warning);
  margin-bottom: 0.75rem;
}
.session-timeout-title {
  font-size: 1.35rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
}
.session-timeout-desc {
  font-size: 1rem;
  color: #555;
  margin-bottom: 0.25rem;
}
.session-timeout-desc strong {
  font-size: 1.5rem;
  color: var(--bs-danger);
}
.session-timeout-tip {
  font-size: 0.82rem;
  color: #777;
  border-top: 1px solid #eee;
  padding-top: 0.75rem;
}
.session-timeout-tip strong {
  color: var(--bs-primary);
  font-size: inherit;
}

/* ── Markdown rendered content (.md-rendered) ─────────────────────────────── */
.md-rendered h1 { font-size: 1.15rem; font-weight: 700; margin-bottom: 0.8rem; border-bottom: 2px solid #dee2e6; padding-bottom: 0.4rem; }
.md-rendered h2 { font-size: 1.25rem; font-weight: 600; margin-top: 1.5rem; margin-bottom: 0.5rem; color: #0d6efd; }
.md-rendered h3 { font-size: 1rem; font-weight: 600; margin-top: 1rem; margin-bottom: 0.3rem; }
.md-rendered h4 { font-size: 0.95rem; font-weight: 600; margin-top: 0.8rem; margin-bottom: 0.2rem; }
.md-rendered ul { margin-bottom: 0.5rem; padding-left: 1.5rem; }
.md-rendered li { margin-bottom: 0.15rem; font-size: 0.9rem; }
.md-rendered code { background: #f1f3f5; padding: 0.15em 0.4em; border-radius: 3px; font-size: 0.85em; }
.md-rendered pre { background: #f8f9fa; border: 1px solid #dee2e6; border-radius: 6px; padding: 1rem; overflow-x: auto; margin-bottom: 1rem; }
.md-rendered pre code { background: none; padding: 0; font-size: 0.82em; }
.md-rendered a { color: #0d6efd; }
.md-rendered hr { margin: 1.5rem 0; }
.md-rendered p { font-size: 0.92rem; margin-bottom: 0.5rem; }
.md-rendered table { width: 100%; border-collapse: collapse; margin-bottom: 1rem; font-size: 0.88rem; }
.md-rendered th { background: #f1f3f5; font-weight: 600; text-align: left; padding: 0.5rem 0.75rem; border: 1px solid #dee2e6; }
.md-rendered td { padding: 0.4rem 0.75rem; border: 1px solid #dee2e6; vertical-align: top; }
.md-rendered tr:hover { background: #f8f9fa; }

/* ============================================ */
/* === CONNECTION ERROR OVERLAY (all pages) === */
/* ============================================ */
/* Shared visual system for SSE offline (#sse-offline-overlay),     */
/* DB connection loss (#db-error-overlay), and the reload overlay    */
/* (#plan-reload-overlay). All use:                                  */
/* .app-overlay + .app-overlay-box/icon/title/desc + element         */

body.app-overlay-active {
  pointer-events: none !important;
  user-select: none !important;
}
body.app-overlay-active .app-overlay {
  pointer-events: auto !important;
}
/* Hide OverlayScrollbars tracks when any blocking overlay is active  */
/* (OvS body-scroll tracks sit at z-index 99999 and would poke through) */
body.app-overlay-active > .os-scrollbar,
body.plan-reload-active > .os-scrollbar { display: none; }

.app-overlay {
  position: fixed;
  inset: 0;
  z-index: 99998; /* just below reload overlay (99999) */
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0);
  backdrop-filter: blur(0px);
  opacity: 0;
  transition: background 0.4s ease, backdrop-filter 0.4s ease, opacity 0.4s ease;
}
.app-overlay.visible {
  background: rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(4px);
  opacity: 1;
}

.app-overlay-box {
  background: #fff;
  border-radius: 16px;
  box-shadow: 0 8px 40px rgba(0,0,0,0.3);
  padding: 40px 48px;
  text-align: center;
  max-width: 440px;
  width: 90%;
  animation: appOverlayBoxIn 0.4s ease-out;
  outline: none;
}

@keyframes appOverlayBoxIn {
  0%   { opacity: 0; transform: scale(0.9) translateY(20px); }
  100% { opacity: 1; transform: scale(1) translateY(0); }
}

.app-overlay-icon {
  font-size: 48px;
  margin-bottom: 12px;
  animation: appOverlayPulse 1.8s ease-in-out infinite;
}
.app-overlay-icon.recovered {
  animation: none;
  color: var(--bs-success) !important;
}

@keyframes appOverlayPulse {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0.3; }
}

.app-overlay-title {
  font-size: 20px;
  font-weight: 700;
  color: #212529;
  margin-bottom: 8px;
}

.app-overlay-desc {
  font-size: 14px;
  color: #6c757d;
  line-height: 1.5;
  margin-bottom: 24px;
}

.app-overlay-spinner {
  display: inline-block;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  border: 4px solid #e9ecef;
  animation: appOverlayRingSpin 0.85s linear infinite;
}
.app-overlay-spinner.recovered {
  animation: none;
  border-color: var(--bs-success);
}

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

/* Per-overlay accent colours */
#sse-offline-overlay .app-overlay-icon         { color: #ffc107; }
#sse-offline-overlay .app-overlay-spinner  { border-top-color: #ffc107; }
#db-error-overlay .app-overlay-icon            { color: #dc3545; }
#db-error-overlay .app-overlay-spinner     { border-top-color: #dc3545; }
/* ============================================ */
/* === RELOAD OVERLAY (all pages)           === */
/* === Shares .app-overlay visual    === */
/* ============================================ */

body.plan-reload-active {
  pointer-events: none !important;
  user-select: none !important;
}
body.plan-reload-active #plan-reload-overlay {
  pointer-events: auto !important;
}

/* Sits above conn-error overlays; all other visuals from .app-overlay */
#plan-reload-overlay {
  z-index: 99999;
}

/* Blue accent + spin for the reload icon */
#plan-reload-overlay .app-overlay-icon {
  color: #0d6efd;
  animation: reloadSpin 1.5s linear infinite;
}

@keyframes reloadSpin {
  0%   { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

.plan-reload-countdown {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: #0d6efd;
  color: #fff;
  font-size: 28px;
  font-weight: 700;
  box-shadow: 0 0 0 0 rgba(13, 110, 253, 0.4);
  animation: countdownPulse 1s ease-in-out infinite;
}

@keyframes countdownPulse {
  0%   { box-shadow: 0 0 0 0 rgba(13, 110, 253, 0.4); }
  70%  { box-shadow: 0 0 0 14px rgba(13, 110, 253, 0); }
  100% { box-shadow: 0 0 0 0 rgba(13, 110, 253, 0); }
}
/* ── Help page (.plan-help-body) ─────────────────────────────────────────────────── */
.plan-help-section-title {
  font-weight: 700;
  color: #0d6efd;
  margin-top: 0;
  margin-bottom: 1.1rem;
}
.plan-help-divider {
  margin-top: 2rem;
  margin-bottom: 1.75rem;
  border-color: #dee2e6;
}
.plan-help-body h6 {
  font-weight: 700;
  margin-top: 1.4rem;
  margin-bottom: 0.45rem;
  color: #0a58ca;
  font-size: 0.92rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}
.plan-help-body h6:first-of-type {
  margin-top: 0;
}
.plan-help-body ul {
  padding-left: 1.3rem;
  margin-bottom: 0.75rem;
}
.plan-help-body li {
  margin-bottom: 0.25rem;
}
.plan-help-body p {
  margin-bottom: 0.6rem;
}
.plan-help-body kbd {
  background: #e9ecef;
  color: #212529;
  border: 1px solid #ced4da;
  border-radius: 3px;
  padding: 0.1rem 0.35rem;
  font-size: 0.8rem;
  box-shadow: 0 1px 0 #ced4da;
}
.plan-help-body .table {
  font-size: 0.88rem;
}

/* ── Custom color-select dropdown ──────────────────────────────────────────── */
.color-select {
  position: relative;
}
/* Trigger button — override Bootstrap's hardcoded dark SVG caret,
   add our own CSS border-trick caret that respects currentColor */
.color-select-trigger.form-select {
  display: flex;
  align-items: center;
  gap: 6px;
  background-image: none !important;
  cursor: pointer;
  user-select: none;
  transition: background-color 0.15s ease, color 0.15s ease;
  text-align: left;
}
.color-select-trigger.form-select::after {
  content: '';
  display: block;
  flex-shrink: 0;
  margin-left: auto;
  width: 0;
  height: 0;
  border-top: 5px solid currentColor;
  border-right: 4px solid transparent;
  border-left: 4px solid transparent;
  opacity: 0.6;
  transition: transform 0.15s ease;
}
.color-select.is-open .color-select-trigger.form-select::after {
  transform: rotate(180deg);
}
.color-select.is-open .color-select-trigger.form-select {
  border-bottom-left-radius: 0;
  border-bottom-right-radius: 0;
}
/* Panel overflow fix — .panel uses overflow:hidden which clips dropdowns */
.panel:has(.color-select.is-open) {
  overflow: visible;
}
/* Dropdown panel */
.color-select-panel {
  position: absolute;
  top: 100%;
  left: 0;
  min-width: max(100%, 220px);
  z-index: 1055;
  background: var(--bs-body-bg);
  border: 1px solid var(--bs-border-color);
  border-top: none;
  border-bottom-left-radius: var(--bs-border-radius);
  border-bottom-right-radius: var(--bs-border-radius);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.13);
  max-height: 340px;
  overflow-y: auto;
  display: none;
}
.color-select.is-open .color-select-panel {
  display: block;
}
/* Shared option/group base */
.color-select-option,
.color-select-group {
  display: flex;
  align-items: center;
  gap: 7px;
  width: 100%;
  padding: 0.35rem 0.75rem;
  border: none;
  text-align: left;
  cursor: pointer;
  background: transparent;
  color: inherit;
  font-family: inherit;
  font-size: 0.85rem;
  line-height: 1.4;
  transition: filter 0.1s;
}
.color-select-option:hover,
.color-select-option:focus,
.color-select-group:hover,
.color-select-group:focus {
  filter: brightness(0.88) saturate(1.1);
  outline: none;
}
/* Uncolored options (placeholder, ungrouped resources) use bg highlight instead */
.color-select-option:not([style]):hover,
.color-select-option:not([style]):focus {
  filter: none;
  background-color: var(--bs-secondary-bg);
}
/* Selected indicator */
.color-select-option.is-selected {
  font-weight: 600;
}
.color-select-option.is-selected:not([style]) {
  background-color: var(--bs-secondary-bg);
}
.color-select-group.is-selected {
  box-shadow: inset 0 0 0 2px rgba(0, 0, 0, 0.22);
}
/* Resource rows — indented */
.color-select-resource {
  padding-left: 1.6rem;
  font-size: 0.82rem;
}
/* Team rows — group headers in team-resource mode AND full items in team-only mode */
.color-select-group {
  font-weight: 700;
  font-size: 0.85rem;
}
/* Color swatch dot (inside panel options) */
.color-select-swatch {
  display: inline-block;
  width: 10px;
  height: 10px;
  min-width: 10px;
  border-radius: 50%;
  border: 1px solid rgba(0, 0, 0, 0.18);
  flex-shrink: 0;
}
/* Trigger label text */
.color-select-label {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
/* Divider row (e.g. "Bez zespołu") */
.color-select-divider {
  padding: 0.2rem 0.75rem;
  font-size: 0.75rem;
  color: var(--bs-secondary-color);
  user-select: none;
  pointer-events: none;
}
/* Dark-mode tweaks */
[data-bs-theme="dark"] .color-select-panel {
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.4);
}
[data-bs-theme="dark"] .color-select-option.is-selected:not([style]) {
  background-color: rgba(255, 255, 255, 0.08);
}
