/* Matrix Scrollbar */
.matrix-scroll::-webkit-scrollbar { height: 10px; width: 10px; }
.matrix-scroll::-webkit-scrollbar-track { background: #f1f5f9; }
.matrix-scroll::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 5px; }
.matrix-scroll::-webkit-scrollbar-thumb:hover { background: #94a3b8; }

/* Sticky Headers */
.sticky-col-header { position: sticky; top: 0; z-index: 20; background-color: #f8fafc; }
.sticky-row-header { position: sticky; left: 0; z-index: 30; background-color: #f8fafc; box-shadow: 2px 0 5px rgba(0,0,0,0.05); width: 350px;}
.sticky-row-proj-header { position: sticky; left: 0; z-index: 30; background-color: #FFF; box-shadow: 2px 0 5px rgba(0,0,0,0.05); width: 350px;}
.sticky-row-total-header { position: sticky; left: 0; z-index: 30; background-color: #535455; box-shadow: 2px 0 5px rgba(0,0,0,0.05); width: 350px; }
.sticky-row-cashflow-footer { position: sticky; left: 0; z-index: 30; background-color: #4f39f6; box-shadow: 2px 0 5px rgba(0,0,0,0.05); width: 350px; }
.sticky-corner { position: sticky; top: 0; left: 0; z-index: 40; background-color: #f8fafc; box-shadow: 2px 0 5px rgba(0,0,0,0.05); width: 350px;}

/* Animations & Transitions */
.picker-section { transition: all 0.2s ease-in-out; overflow: hidden; max-height: 0; opacity: 0; }
.picker-section.open { max-height: 300px; opacity: 1; margin-top: 0.5rem; }

.hover-trigger .hover-target { visibility: hidden; opacity: 0; transition: opacity 0.1s; }
.hover-trigger:hover .hover-target { visibility: visible; opacity: 1; }

.inline-editable { cursor: pointer; border-bottom: 1px dashed #cbd5e1; transition: all 0.2s; }
.inline-editable:hover { background-color: #eff6ff; border-bottom-color: #6366f1; color: #4338ca; }

/* Toggle Switch Styles - Fixed */
.toggle-checkbox { right: 0; z-index: 10; border-color: #cbd5e1; transition: all 0.3s; }
.toggle-checkbox:checked { right: 0; border-color: #6366f1; }
.toggle-checkbox:checked + .toggle-label { background-color: #6366f1; }
.toggle-checkbox:checked + .toggle-label:before { transform: translateX(100%); }

.toggle-label { 
    width: 36px; 
    height: 20px; 
    position: relative; 
    display: block; 
    background: #e2e8f0; 
    border-radius: 9999px; 
    cursor: pointer; 
    transition: all 0.3s; 
}
.toggle-label:before { 
    content: ''; 
    position: absolute; 
    top: 2px; 
    left: 2px; 
    width: 16px; 
    height: 16px; 
    background: white; 
    border-radius: 50%; 
    transition: all 0.3s; 
    box-shadow: 0 1px 3px rgba(0,0,0,0.1); 
}

.company-inline-edit {
  width: 180px;
  transition: border-color 0.15s ease;
}
.group:hover .company-inline-edit {
  border-color: #cbd5e1; /* slate-300 */
}

.collapse-container {
  overflow: hidden;
  transition: max-height 0.18s ease-in-out;
  max-height: 2000px; /* default expanded */
}

.collapse-container.collapsed {
  max-height: 0 !important;
}

.inline_edit_border{
  border-bottom-style: dashed;
}

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

.animate-fadeIn {
  animation: fadeIn 0.15s ease-out;
}

.toggle-switch {
  position: relative;
  display: inline-block;
  width: 40px;
  height: 20px;
  background-color: rgba(0, 0, 0, 0.25);
  border-radius: 20px;
  transition: all 0.3s;
}
.toggle-switch::after {
  content: '';
  position: absolute;
  width: 18px;
  height: 18px;
  border-radius:50%;
  background-color: white;
  top: 1px;
  left: 1px;
  transition: all 0.3s;
}

.toggle-checkbox:checked + .toggle-switch::after {
  left : 20px;
}
.toggle-checkbox:checked + .toggle-switch {
  background-color: #4f46e5;
}
.toggle-checkbox {
  display : none;
}

.purple-colour{
  background-color: oklch(0.511 0.262 276.966);
}

.modal-fields{
    padding: 4px 6px;
    border: 1px solid #ccc;
    border-radius: 3px;
    margin-left: 5px;
    margin-top: 10px;
}

.modal-alert{
    background-color: rgb(0, 188, 125, 0.85);
    width: 100%;
    position: absolute;
    height: 65px;
    text-align: center;
    line-height: 49px;
}

.modal-alert-red{
  background-color: rgb(255, 81, 92, 0.5);
  width: 100%;
    position: absolute;
    height: 65px;
    text-align: center;
    line-height: 49px;
}

.row-max-width{
  width:350px;
}

.monthly-cashflow-bg{
  background-color: rgba(79, 57, 246, 0.1)
}

.blurred-text {
  filter: blur(4px);
  opacity: 0.4;
  user-select: none;
}

/* --- Simple tooltip styling --- */
.tooltip {
  position: relative;
  display: inline-block;
  cursor: help;
}

.tooltip .tooltip-text {
  visibility: hidden;
  opacity: 0;
  width: 220px;
  background-color: rgba(79, 57, 246, 0.85); /* #1e293b;slate-800 */
  color: #fff;
  text-align: left;
  padding: 6px 10px;
  border-radius: 6px;
  position: absolute;
  z-index: 10000;
  bottom: 125%;
  left: 50%;
  transform: translateX(-50%);
  transition: opacity 0.2s ease;
  font-size: 11px;
  line-height: 1.4;
}

.tooltip:hover .tooltip-text {
  visibility: visible;
  opacity: 1;
}

.mt-16{
  margin-top:16px;
}

.float-right{
  float:right;
}


.invoice-mb{
  margin-bottom: 20px;
}

/* Tab Styles */
.tab-button {
  transition: all 0.2s ease;
  padding: 5px 20px;
  border: 1px solid #ccc;
  border-top-left-radius: 6px;
  border-top-right-radius: 6px;
  border-bottom: 0;
  margin-right:5px;
}

button.active{
    background-color: var(--color-indigo-50);
}

.tab-content {
  animation: fadeIn 0.2s ease-in;
}

.modal-widths{
  max-width: 600px;
  min-width: 400px;
  min-height: 500px;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.justify-flexend{
  justify-content: flex-end;
}

.lineheightinherit{
  line-height:1.5 !important;
}

.faviconsize{
  max-height: 24px;
  max-width: 24px;
}

/* Attribution view */
/* These elements set their base colour via inline style (per-render, data-driven), which
   otherwise beats a plain class rule on :hover — !important restores the hover affordance. */
.attribution-chip:hover { background-color: #eef2ff !important; border-color: #c7d2fe !important; }
.attribution-nav-btn:hover { background-color: #f8fafc !important; }
.attribution-remove-btn:hover { color: #be123c !important; }
.attribution-summary-project-card:hover { border-color: #c7d2fe !important; }
.attribution-summary-row:hover { background-color: #fafbff !important; }
.attribution-summary-note:hover { border-bottom-color: #cbd5e1 !important; }
.attribution-summary-note:focus { border-bottom-color: #4f46e5 !important; }
.attribution-fraction-btn:hover { background-color: #eef2ff !important; }
.attribution-fraction-option:hover { background-color: #eef2ff !important; border-color: #c7d2fe !important; }
