/* ── Action menu vertical stack ───────────────────────────── */
.js-action-menu {
  min-width: 160px;
  padding: 0.25rem 0;
  background: #fff;
  border-radius: 0.5rem;
  box-shadow: 0 4px 16px rgba(0,0,0,0.10);
  display: flex;
  flex-direction: column;
  gap: 2px;
  z-index: 50;
}

.js-action-menu button {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  border: none;
  background: none;
  margin: 0;
  outline: none;
  box-shadow: none;
}
/* ============================================================
   Luveedu Projects — Main Stylesheet
   ============================================================ */

/* ── Fonts ─────────────────────────────────────────────────── */
* {
  font-family: 'DM Sans', system-ui, -apple-system, sans-serif;
}
h1, h2, h3, h4, h5, h6, .font-heading {
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
}

/* ── Scrollbar ─────────────────────────────────────────────── */
::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #4b5563; border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: #6366f1; }

/* ── Spinner ───────────────────────────────────────────────── */
.spinner {
  width: 18px; height: 18px;
  border: 2px solid rgba(99,102,241,0.2);
  border-top-color: #6366f1;
  border-radius: 50%;
  animation: spin 0.65s linear infinite;
  display: inline-block;
  vertical-align: middle;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ── Toast ─────────────────────────────────────────────────── */
@keyframes slideInRight {
  from { transform: translateX(110%); opacity: 0; }
  to   { transform: translateX(0);    opacity: 1; }
}
.toast-anim { animation: slideInRight 0.28s cubic-bezier(.22,.68,0,1.2); }

/* ── Modal overlay ─────────────────────────────────────────── */
.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
}
.modal-overlay.hidden { display: none; }

.modal-backdrop-layer {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(3px);
  animation: fadeIn 0.18s ease;
}

.modal-box {
  position: relative;
  z-index: 201;
  animation: scaleIn 0.22s cubic-bezier(.22,.68,0,1.2);
}

@keyframes fadeIn  { from { opacity: 0; } to { opacity: 1; } }
@keyframes scaleIn { from { transform: scale(0.95); opacity: 0; } to { transform: scale(1); opacity: 1; } }

.modal-backdrop { animation: fadeIn 0.18s ease; }
.modal-content  { animation: scaleIn 0.22s cubic-bezier(.22,.68,0,1.2); }

.ui-modal-close-btn {
  width: 2rem !important;
  height: 2rem !important;
  border: 1px solid #d1d5db !important;
  border-radius: 0.5rem !important;
  color: #4b5563 !important;
  background: #fff !important;
}

.ui-modal-close-btn:hover {
  border-color: #9ca3af !important;
  background: #f3f4f6 !important;
  color: #111827 !important;
}

.ui-modal-close-icon {
  width: 1rem !important;
  height: 1rem !important;
}

.dark .ui-modal-close-btn {
  border-color: #374151 !important;
  background: #111827 !important;
  color: #d1d5db !important;
}

.dark .ui-modal-close-btn:hover {
  border-color: #4b5563 !important;
  background: #1f2937 !important;
  color: #fff !important;
}

.tiny-char-count {
  margin-top: 0.35rem;
  font-size: 0.75rem;
  color: #6b7280;
  text-align: right;
}

.dark .tiny-char-count {
  color: #9ca3af;
}

/* ── Page enter ────────────────────────────────────────────── */
.page-enter { animation: fadeSlideUp 0.25s ease; }
@keyframes fadeSlideUp {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ── Sidebar ───────────────────────────────────────────────── */
#sidebar {
  background: linear-gradient(180deg, #0f172a 0%, #1e1b4b 55%, #0f172a 100%);
  border-right: 1px solid rgba(255, 255, 255, 0.08);
}
#sidebar nav a,
#sidebar nav button {
  color: rgba(255, 255, 255, 0.75);
}
#sidebar nav a:hover,
#sidebar nav button:hover {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.1);
}
#sidebar nav a.nav-active {
  color: #c7d2fe !important;
}
#sidebar.collapsed { width: 64px !important; }
#sidebar.collapsed .sidebar-label,
#sidebar.collapsed .sidebar-section-label { display: none !important; }
#sidebar.collapsed + #mainWrapper,
#sidebar.collapsed ~ #mainWrapper { margin-left: 64px !important; }

.nav-active {
  background: rgba(99, 102, 241, 0.2) !important;
  color: #c7d2fe !important;
  font-weight: 600;
}

.submenu {
  overflow: hidden;
  max-height: 0;
  opacity: 0;
  transition: max-height 0.28s ease, opacity 0.2s ease;
}
.submenu.open {
  max-height: 500px;
  opacity: 1;
}

/* ── Card hover — ONLY on .lv-card, not on inputs/tables ───── */
/* Use explicit class to avoid polluting all bordered elements */
.lv-card {
  transition: box-shadow 0.2s ease, transform 0.2s ease;
}
.lv-card:hover {
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
  transform: translateY(-2px);
}
.dark .lv-card:hover {
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.35);
}

/* Stat cards on dashboard — explicit hover */
a.stat-card-link {
  transition: box-shadow 0.2s ease, transform 0.2s ease;
}
a.stat-card-link:hover {
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
  transform: translateY(-2px);
}

/* ── Progress bar ──────────────────────────────────────────── */
.progress-fill {
  height: 100%;
  border-radius: 4px;
  transition: width 0.5s cubic-bezier(.4, 0, .2, 1);
}

/* ── Quill dark mode ───────────────────────────────────────── */
.ql-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 8px;
  border: 1px solid #d1d5db;
  border-bottom: 0;
  background: #f9fafb;
}
.ql-toolbar .ql-btn {
  border: 1px solid #d1d5db;
  background: #ffffff;
  color: #374151;
  border-radius: 6px;
  font-size: 12px;
  line-height: 1;
  padding: 6px 8px;
  cursor: pointer;
}
.ql-toolbar .ql-btn:hover {
  background: #f3f4f6;
}
.ql-container {
  border: 1px solid #d1d5db;
  background: #ffffff;
}
.ql-editor {
  min-height: 100px;
  padding: 10px 12px;
  outline: none;
  color: #111827;
  line-height: 1.5;
  white-space: pre-wrap;
  word-break: break-word;
}
.ql-editor:empty:before {
  content: attr(data-placeholder);
  color: #9ca3af;
  pointer-events: none;
}
.dark .ql-toolbar  { background: #1f2937 !important; border-color: #374151 !important; border-radius: 6px 6px 0 0; }
.dark .ql-container{ background: #111827 !important; border-color: #374151 !important; border-radius: 0 0 6px 6px; color: #f9fafb !important; }
.dark .ql-editor   { color: #f9fafb !important; }
.dark .ql-toolbar .ql-btn {
  background: #111827;
  border-color: #374151;
  color: #d1d5db;
}
.dark .ql-toolbar .ql-btn:hover { background: #1f2937; }
.ql-toolbar  { border-radius: 6px 6px 0 0 !important; }
.ql-container{ border-radius: 0 0 6px 6px !important; }

/* ── Legacy form classes (create-invoice, create-quotation) ── */
.card {
  background: #ffffff;
  border: 1px solid #e5e7eb;
  border-radius: 6px;
}
.dark .card {
  background: #111827;
  border-color: #1f2937;
}
.form-label {
  display: block;
  font-size: 0.75rem;
  font-weight: 600;
  color: #374151;
  margin-bottom: 0.375rem;
}
.dark .form-label { color: #d1d5db; }
.form-input, .form-select, .form-textarea {
  width: 100%;
  padding: 0.5rem 0.75rem;
  font-size: 0.875rem;
  border: 1px solid #d1d5db;
  border-radius: 6px;
  background: #f3f4f6;
  color: #111827;
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.form-input:focus, .form-select:focus, .form-textarea:focus {
  border-color: #6366f1;
  box-shadow: 0 0 0 2px rgba(99,102,241,0.2);
  background: #ffffff;
}
.dark .form-input, .dark .form-select, .dark .form-textarea {
  background: #1f2937;
  border-color: #374151;
  color: #f9fafb;
}

/* ── Shared filter toolbar layout ─────────────────────────── */
.filter-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  width: 100%;
}

.filter-toolbar > .filter-search {
  flex: 1 1 100%;
  max-width: 100%;
}

.filter-toolbar .filter-search input {
  width: 100% !important;
}

.filter-toolbar select {
  flex: 1 1 calc(50% - 0.5rem);
  min-width: 10rem;
  width: 100% !important;
}

.filter-toolbar > a,
.filter-toolbar > button {
  flex: 0 0 auto;
  width: auto;
  justify-content: center;
  white-space: nowrap;
}

@media (min-width: 640px) {
  .filter-toolbar {
    flex-wrap: nowrap;
    justify-content: flex-end !important;
  }

  .filter-toolbar > .filter-search {
    flex: 0 0 40%;
    max-width: 40%;
  }

  .filter-toolbar select {
    flex: 1 1 0;
    min-width: 0;
  }
}
.dark .form-input:focus, .dark .form-select:focus, .dark .form-textarea:focus {
  border-color: #6366f1;
  background: #111827;
}

/* ── Project task board polish ─────────────────────────────── */
.taskboard-grid {
  scroll-behavior: smooth;
}

.taskboard-grid select,
.taskboard-grid input[type="date"] {
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.taskboard-grid select:focus,
.taskboard-grid input[type="date"]:focus {
  outline: none;
  border-color: #6366f1;
  box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.2);
}

.task-action-btn {
  width: 1.85rem;
  height: 1.85rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 0.5rem;
  border: 1px solid;
  transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

/* ── TinyMCE editor polish ───────────────────────────────── */
.tox.tox-tinymce {
  border-radius: 0.375rem;
  border-color: #d1d5db;
}

.tox .tox-edit-area__iframe {
  background: #f3f4f6;
}

.tox .tox-edit-area:focus,
.tox .tox-edit-area:focus-within,
.tox .tox-edit-area__iframe:focus {
  outline: none !important;
  box-shadow: none !important;
}

.task-action-success {
  border-color: #a7f3d0;
  background: #ecfdf5;
  color: #047857;
}
.task-action-success:hover {
  border-color: #6ee7b7;
  background: #d1fae5;
}

.task-action-danger {
  border-color: #fecaca;
  background: #fef2f2;
  color: #b91c1c;
}
.task-action-danger:hover {
  border-color: #fca5a5;
  background: #fee2e2;
}

.task-action-warn {
  border-color: #fde68a;
  background: #fffbeb;
  color: #b45309;
}
.task-action-warn:hover {
  border-color: #fcd34d;
  background: #fef3c7;
}

.task-action-info {
  border-color: #bfdbfe;
  background: #eff6ff;
  color: #1d4ed8;
}
.task-action-info:hover {
  border-color: #93c5fd;
  background: #dbeafe;
}

.dark .task-action-success {
  border-color: #065f46;
  background: rgba(16, 185, 129, 0.15);
  color: #6ee7b7;
}
.dark .task-action-success:hover {
  border-color: #10b981;
  background: rgba(16, 185, 129, 0.25);
}

.dark .task-action-danger {
  border-color: #7f1d1d;
  background: rgba(239, 68, 68, 0.15);
  color: #fca5a5;
}
.dark .task-action-danger:hover {
  border-color: #ef4444;
  background: rgba(239, 68, 68, 0.25);
}

.dark .task-action-warn {
  border-color: #78350f;
  background: rgba(245, 158, 11, 0.15);
  color: #fcd34d;
}
.dark .task-action-warn:hover {
  border-color: #f59e0b;
  background: rgba(245, 158, 11, 0.25);
}

.dark .task-action-info {
  border-color: #1e3a8a;
  background: rgba(59, 130, 246, 0.15);
  color: #93c5fd;
}
.dark .task-action-info:hover {
  border-color: #3b82f6;
  background: rgba(59, 130, 246, 0.25);
}
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  padding: 0.5rem 1rem;
  font-size: 0.875rem;
  font-weight: 500;
  border-radius: 6px;
  border: 1px solid transparent;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
  text-decoration: none;
}
.btn-primary   { background: #4f46e5; color: #fff; border-color: #4f46e5; }
.btn-primary:hover { background: #4338ca; }
.btn-secondary { background: #f3f4f6; color: #374151; border-color: #d1d5db; }
.btn-secondary:hover { background: #e5e7eb; }
.dark .btn-secondary { background: #1f2937; color: #d1d5db; border-color: #374151; }
.dark .btn-secondary:hover { background: #374151; }
.btn-xs { padding: 0.2rem 0.5rem; font-size: 0.75rem; }
.btn-sm { padding: 0.3rem 0.75rem; font-size: 0.8rem; }

/* ── Dashboard date filter buttons ────────────────────────── */
.dash-filter-btn {
  padding: 0.375rem 0.875rem;
  font-size: 0.8rem;
  font-weight: 500;
  border-radius: 6px;
  border: 1px solid #e5e7eb;
  background: #ffffff;
  color: #6366f1;
  cursor: pointer;
  transition: all 0.15s ease;
  white-space: nowrap;
}
.dark .dash-filter-btn {
  background: #111827;
  border-color: #374151;
  color: #818cf8;
}
.dash-filter-btn:hover {
  border-color: #6366f1;
  background: #eef2ff;
  color: #4338ca;
}
.dark .dash-filter-btn:hover {
  background: #1e1b4b;
  border-color: #6366f1;
}
.dash-filter-btn.active {
  background: #ffffff;
  border-color: #6366f1;
  color: #4338ca;
  font-weight: 600;
  box-shadow: 0 0 0 1px #6366f1;
}
.dark .dash-filter-btn.active {
  background: #111827;
  border-color: #818cf8;
  color: #818cf8;
  box-shadow: 0 0 0 1px #818cf8;
}

/* ── Shared filter row polish (one-line flex, no visible scrollbar strip) ── */
.filter-row,
.flex.flex-nowrap.items-center.gap-2.sm\:ml-auto.overflow-x-auto.pb-1,
.flex.items-center.gap-2.overflow-x-auto.flex-nowrap.pb-1 {
  overflow-y: visible;
  padding-bottom: 0;
}

@media (max-width: 1279px) {
  .filter-row,
  .flex.flex-nowrap.items-center.gap-2.sm\:ml-auto.overflow-x-auto.pb-1,
  .flex.items-center.gap-2.overflow-x-auto.flex-nowrap.pb-1 {
    overflow-x: auto;
    -ms-overflow-style: none;
    scrollbar-width: none;
  }

  .filter-row::-webkit-scrollbar,
  .flex.flex-nowrap.items-center.gap-2.sm\:ml-auto.overflow-x-auto.pb-1::-webkit-scrollbar,
  .flex.items-center.gap-2.overflow-x-auto.flex-nowrap.pb-1::-webkit-scrollbar {
    height: 0;
  }
}

@media (min-width: 1280px) {
  .filter-row,
  .flex.flex-nowrap.items-center.gap-2.sm\:ml-auto.overflow-x-auto.pb-1,
  .flex.items-center.gap-2.overflow-x-auto.flex-nowrap.pb-1 {
    overflow-x: visible;
  }
}

.filter-row > * {
  flex-shrink: 0;
}

/* Keep compact badge/chip text on one line inside tables */
table .inline-flex {
  white-space: nowrap;
}

/* ── Select2 ───────────────────────────────────────────────── */
.select2-container--default .select2-selection--single {
  height: 38px;
  border: 1px solid #d1d5db;
  border-radius: 6px;
  background: #f3f4f6;
  display: flex;
  align-items: center;
  padding: 0 0.75rem;
  font-size: 0.875rem;
  color: #111827;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.select2-container--default .select2-selection--single .select2-selection__rendered {
  color: #111827;
  line-height: 36px;
  padding: 0;
}
.select2-container--default .select2-selection--single .select2-selection__arrow {
  height: 36px;
  right: 8px;
}
.select2-container--default.select2-container--focus .select2-selection--single {
  border-color: #6366f1;
  box-shadow: 0 0 0 2px rgba(99,102,241,0.2);
  outline: none;
  background: #ffffff;
}
.select2-dropdown {
  border: 1px solid #d1d5db;
  border-radius: 6px;
  box-shadow: 0 4px 16px rgba(0,0,0,0.1);
  font-size: 0.875rem;
  overflow: hidden;
}
.select2-container--default .select2-results__option--highlighted[aria-selected] {
  background: #6366f1;
  color: #fff;
}
.select2-container--default .select2-results__option[aria-selected=true] {
  background: #eef2ff;
  color: #4338ca;
}
.select2-search--dropdown .select2-search__field {
  border: 1px solid #d1d5db;
  border-radius: 4px;
  padding: 6px 10px;
  font-size: 0.875rem;
  outline: none;
  background: #f9fafb;
}
.select2-search--dropdown .select2-search__field:focus {
  border-color: #6366f1;
}
.dark .select2-container--default .select2-selection--single {
  background: #1f2937;
  border-color: #374151;
  color: #f9fafb;
}
.dark .select2-container--default .select2-selection--single .select2-selection__rendered {
  color: #f9fafb;
}
.dark .select2-container--default .select2-selection--single .select2-selection__arrow b {
  border-color: #9ca3af transparent transparent transparent;
}
.dark .select2-container--default.select2-container--focus .select2-selection--single {
  border-color: #6366f1;
  background: #111827;
}
.dark .select2-dropdown {
  background: #1f2937;
  border-color: #374151;
  color: #f9fafb;
}
.dark .select2-results__option { color: #f9fafb; }
.dark .select2-container--default .select2-results__option--highlighted[aria-selected] {
  background: #6366f1;
  color: #fff;
}
.dark .select2-container--default .select2-results__option[aria-selected=true] {
  background: #312e81;
  color: #c7d2fe;
}
.dark .select2-search--dropdown .select2-search__field {
  background: #111827;
  border-color: #374151;
  color: #f9fafb;
}
.dark .select2-search--dropdown {
  background: #1f2937;
  border-bottom: 1px solid #374151;
}

/* ── Mobile sidebar ────────────────────────────────────────── */
@media (max-width: 1023px) {
  #sidebar { transform: translateX(-100%); transition: transform 0.3s ease; }
  #sidebar.mobile-open { transform: translateX(0); }
  #mainWrapper { margin-left: 0 !important; }
}
