/*Organizational Diagram*/
#canvas-wrap{
  position:relative;
  width: calc(100% - 320px);
  min-height:640px;
  background:#fefefe;
  border-radius:10px;
  box-shadow:var(--shadow);
  overflow:auto;
  border:1px solid rgba(11,22,40,0.03);
}

#connectors{
  position:absolute;
  inset:0;
  width:100%;
  height:100%;
  pointer-events:none;
}
#nodes {
  position: relative;
  width: 2000px;
  height: 1400px
}

/* Node card */
.node {
  position:absolute;
  min-width:160px;
  padding:10px;
  background-color:#fefefe;
  border-radius:10px;
  box-shadow:0 8px 20px rgba(20,30,60,0.08);
  border:1px solid rgba(15,23,42,0.04);
  cursor:grab;
  user-select:none;
  touch-action:none;
  transition:box-shadow 0.12s, transform 0.06s;
}
.node:active { cursor:grabbing; transform:scale(0.995); box-shadow:0 10px 24px rgba(12,32,80,0.12) }

.node .name { font-weight:600; font-size:14px; margin-bottom:4px }
.node .title { font-size:12px; color:var(--muted) }

.node .avatar {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  background-color: #00b4ff;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-weight: 700;
  margin-right: 8px;
}
.node .tools{
  position:absolute;right:6px;top:6px;display:flex;gap:6px;font-size:12px;color:var(--muted)
}
.node .delete-btn{
  border:none;background:none;color:#ef4444;font-weight:bold;
  cursor:pointer;padding:2;font-size:14px;line-height:1;
  z-index: 1000;
}
.node .delete-btn:hover{color:#dc2626;transform:scale(1.2)}

/* legend / controls */
#legend{width:300px;padding:12px;background:#fff;border-radius:8px;box-shadow:var(--shadow);border:1px solid rgba(0,0,0,0.03);font-size:13px}
#legend button{margin-top:8px;padding:8px 10px;border-radius:6px;border:1px solid #e6eefc;background:#f7fbff;color:var(--accent);cursor:pointer}
#legend label{display:block;margin-top:8px}
#legend input{margin-left:6px;padding:6px;border-radius:6px;border:1px solid #e5e7eb}

.navbar {
  height: 60px !important;
  padding-left: 16px;
  padding-right: 16px;
  background-color: #ffffff;
  color: #000000;
  position: fixed;
  z-index: 2;
  border-bottom: 1px solid #e1e5e9;
}

/* Timesheet status */
.status-hero {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1.5rem;
  padding: 1.5rem 1.75rem;
  background: linear-gradient(135deg, #f0f7ff 0%, #ffffff 62%, #effbf5 100%);
  border: 1px solid #e5edf7;
  border-radius: 14px;
}
.status-kicker {
  color: #2375d8;
  font-size: .76rem;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
}
.status-score-badges { display: flex; flex-wrap: wrap; flex-shrink: 0; gap: 1rem; }
.status-score-separator { width: 1px; align-self: stretch; flex-shrink: 0; margin: .5rem 0; background: #dfeaf7; }
.status-score-badge {
  min-width: 110px;
  padding: .8rem 1rem;
  color: #17345e;
  text-align: center;
  background: #fff;
  border: 1px solid #dfeaf7;
  border-radius: 12px;
  box-shadow: 0 8px 20px rgba(35, 82, 132, .08);
}
.status-score-badge strong { font-size: 2.25rem; line-height: 1; }
.status-score-label { display: block; color: #73839a; font-size: .7rem; text-transform: uppercase; }
.status-overview-card, .status-message-card, .status-ranking-card { border: 1px solid #e5edf7; border-radius: 14px; box-shadow: 0 8px 24px rgba(35, 82, 132, .06); }
.status-seed-icon { color: #29ae72; font-size: 2rem; }
.status-metric-card { height: 100%; padding: 1rem; border-right: 1px solid #e8eef5; }
.status-metric-card:last-child { border-right: 0; }
.status-metric-card h4 { margin: .75rem 0 .25rem; color: #17345e; font-size: 1rem; }
.status-metric-card p { margin: 0; color: #73839a; font-size: .84rem; }
.status-chart-wrap { position: relative; width: 112px; height: 112px; margin: 0 auto; }
.status-chart-wrap canvas { width: 112px !important; height: 112px !important; }
.status-chart-wrap strong { position: absolute; inset: 0; display: grid; place-items: center; color: #17345e; font-size: 1.35rem; }
.status-period-list { display: flex; flex-direction: column; gap: .75rem; }
.status-period-row { display: flex; flex-direction: column; gap: .65rem; padding: .75rem 0; border-bottom: 1px solid #e8eef5; color: #536b84; font-size: .9rem; }
.status-period-row:last-child { border-bottom: 0; }
.status-period-heading { display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.status-period-heading strong { color: #17345e; font-size: 1rem; }
.status-period-heading span { color: #73839a; font-size: .75rem; }
.status-metrics { display: grid; grid-template-columns: repeat(3, 1fr); gap: .5rem; }
.status-metrics span { display: flex; flex-direction: column; gap: .15rem; padding: .55rem .4rem; border-radius: 8px; background: #f4f8fc; text-align: center; }
.status-metrics small { color: #73839a; font-size: .65rem; }
.status-metrics strong { color: #17345e; font-size: .95rem; }
.status-scope-toggle { border: 1px solid #dbe7f4; border-radius: 8px; overflow: hidden; }
.status-scope-toggle .btn { color: #5b6e88; background: #fff; border: 0; }
.status-scope-toggle .btn.active, .status-scope-toggle .btn:hover { color: #fff; background: #2375d8; }
.status-ranking-table thead th { color: #71819a; font-size: .72rem; letter-spacing: .06em; text-transform: uppercase; border-bottom-color: #e5edf7; }
.status-ranking-table tbody td { color: #304766; border-bottom-color: #edf2f7; }
.status-ranking-table tbody tr:last-child td { border-bottom: 0; }
.status-current-user { background: #f4f9ff; }
.rank-number { width: 42px; color: #2375d8 !important; font-weight: 700; }
.table-meter { display: inline-block; width: 90px; height: 7px; margin-right: .5rem; vertical-align: middle; background: #e7edf4; border-radius: 10px; overflow: hidden; }
.table-meter span { display: block; height: 100%; background: #2eaf75; border-radius: inherit; }
.ranking-score { color: #17345e; }
@media (max-width: 768px) {
  .status-hero { align-items: flex-start; flex-direction: column; }
  .status-score-badges { width: 100%; }
  .status-score-badge { align-self: stretch; flex: 1; }
  .status-metric-card { border-right: 0; border-bottom: 1px solid #e8eef5; }
  .status-metric-card:last-child { border-bottom: 0; }
  .status-scope-toggle { width: 100%; }
  .status-scope-toggle .btn { flex: 1; font-size: .78rem; }
}

.flex-grow-1 {
  flex-grow: 1;
}

#sidenave-toggle {
  border: 0;
  background-color: transparent;
  color: #000000;
  padding: 8px;
  border-radius: 4px;
  transition: background-color 0.3s ease;
}

#sidenave-toggle:hover {
  background-color: #00AEEF;
}

.container-fluid {
  padding-top: 60px;
}

#sidebar {
  position: fixed;
  overflow: auto;
}

.table-responsive {
  overflow-x: auto;
  white-space: nowrap;
}

.table-responsive table {
  min-width: 100%;
}

.table-responsive td,
.table-responsive th {
  white-space: nowrap;
}

/*Calendar*/
body {
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial;
}

/* Calendar weekdays header row */
.calendar-weekdays .col {
  padding: 0.5rem 0;
  border-radius: .25rem;
  background: transparent;
}

/* Calendar grid: responsive */
.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 0.5rem;
}

/* Each day cell */
.calendar-day {
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  padding: 4px;
  border: 1px solid #ddd;
  border-radius: 4px;
  background: #fff;
  min-height: 120px; /* ensure enough space for content */
  position: relative;
}

.calendar-day.empty {
  background: transparent;
  border: 1px dashed rgba(0,0,0,0.04);
  cursor: default;
}

.calendar-day:not(.empty):hover {
  background: #f8f9fa;
}

/* Date number (top-left) */
.date-number {
  font-weight: 700;
  font-size: 0.95rem;
  color: #212529;
}

/* Activity list */
.activity-list {
  list-style: none;
  padding: 0;
  margin: 2px 0 0 0;
  flex-grow: 1;
}

.activity-list li {
  display: flex;
  justify-content: space-between;
  font-size: 0.6rem;
  white-space: nowrap;
  overflow: hidden;
  line-height: 1.2;        /* compact line spacing */
}

.project-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  flex: 1;
  margin-right: 4px;
}

.hours {
  flex-shrink: 0;
  margin-left: 4px;
}

.more-indicator {
  font-size: 0.6rem;
  color: #666;
  text-align: right;
  flex: 1;
}

.total-hours {
  display: flex;
  justify-content: space-between;
  font-size: 0.75rem; /* slightly bigger */
  font-weight: 600;
  margin-top: auto; /* push to bottom */
  border-top: 1px solid #eee;
  padding-top: 2px;
  font-weight: bold;
}


/* Highlight current date */
.current-date {
  border: 2px solid #0d6efd;
  background: #e7f1ff;
}

.dashboard-scrollable-card {
    max-height: 70vh;
    overflow-y: auto;
}

/* Hide weekdays in brackets on desktop */
.weekday-mobile {
  display: none;
}

.recent-project-hours {
  width: 7ch;
  min-width: 7ch;
}

.dashboard-quick-entries-table td,
.dashboard-quick-entries-table th {
  padding-top: 0.2rem;
  padding-bottom: 0.2rem;
  vertical-align: middle;
}

.dashboard-quick-entries-table .form-control-sm,
.dashboard-quick-entries-table .btn-sm {
  min-height: 1.75rem;
  padding-top: 0.15rem;
  padding-bottom: 0.15rem;
}

/* --------- RESPONSIVENESS --------- */

/* Medium screens (tablets) */
@media (max-width: 992px) {
  .calendar-grid {
    grid-template-columns: repeat(4, 1fr); /* 4 columns */
  }
  .calendar-day {
    min-height: 100px;
  }
  .date-number {
    font-size: 0.9rem;
  }
}

/* Small screens (mobile) */
@media (max-width: 576px) {
  .calendar-grid {
    grid-template-columns: repeat(2, 1fr); /* 2 columns */
  }
  .calendar-day {
    min-height: 90px;
    padding: 0.4rem;
  }
  .date-number {
    font-size: 0.85rem;
  }
  .activity-list {
    font-size: 0.8rem;
    max-height: calc(90px - 1.6rem);
  }
}

@media (max-width: 768px) {
  .calendar-weekdays {
    display: none !important;
  }

  .weekday-mobile {
    display: inline;
  }
}

#home-link {
    text-decoration: none;
    color: inherit;
    display: flex;
    align-items: center;
}

.dashboard-summary-row {
  align-items: stretch;
}

.dashboard-summary-cards {
  margin: 0;
}

.dashboard-summary-card {
  height: 100%;
  min-height: 3.25rem;
  border-radius: 0.75rem;
  width: 100%;
  display: inline-flex;
  align-items: center;
  justify-content: flex-start;
  text-align: left;
  padding: 0;
  border: 0;
  box-shadow: none;
  cursor: pointer;
  transition: transform 0.12s ease, opacity 0.12s ease;
}

.dashboard-summary-card:hover {
  transform: translateY(-1px);
  opacity: 0.98;
}

.dashboard-summary-card-header {
  border-bottom: 0;
  font-size: 0.92rem;
  font-weight: 600;
  padding: 0.55rem 0.85rem;
  display: flex;
  align-items: center;
  width: 100%;
}

.dashboard-summary-content {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  flex-wrap: nowrap;
  width: 100%;
}

.dashboard-summary-content span:last-child {
  margin-left: auto;
  font-weight: 700;
}

.dashboard-summary-value {
  font-weight: 700;
  white-space: nowrap;
}

.dashboard-add-entry-wrapper {
  align-items: stretch;
}

.dashboard-add-entry-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  white-space: nowrap;
  width: auto;
  min-height: 3.25rem;
  height: 100%;
  padding: 0.65rem 1rem;
}

@media (max-width: 991.98px) {
  .dashboard-add-entry-wrapper {
    justify-content: flex-start !important;
    margin-top: 0.25rem;
  }

  .dashboard-add-entry-btn {
    width: auto;
  }
}

/* Custom styling for tooltip icon */
.bi-info-circle {
  cursor: pointer;
  font-size: 0.8rem;
}

.position-levels-separator {
  border-bottom: 1px solid #dee2e6;
}

.position-row-clickable {
  cursor: pointer;
}

.user-row-clickable {
  cursor: pointer;
}

.sortable-table-header {
  align-items: center;
  background: transparent;
  border: 0;
  color: inherit;
  cursor: pointer;
  display: inline-flex;
  gap: 0.35rem;
  font: inherit;
  padding: 0;
  width: 100%;
}

.sortable-table-header:focus-visible {
  outline: 2px solid #00AEEF;
  outline-offset: 2px;
}

.sortable-table-header .fa-solid {
  color: #6c757d;
  font-size: 0.8rem;
}

.bill-details-table {
  table-layout: fixed;
}

.bill-details-table th,
.bill-details-table td {
  overflow-wrap: anywhere;
  white-space: normal;
  word-break: break-word;
}

.bill-details-table th:first-child,
.bill-details-table td:first-child {
  width: 5rem;
}

.bill-details-table th:nth-child(2),
.bill-details-table td:nth-child(2) {
  width: 8rem;
}

.bill-details-table th:last-child,
.bill-details-table td:last-child {
  width: 9rem;
}

#hours-summary-user-select + .select2-container .select2-selection--multiple .select2-selection__choice {
  display: none;
}

#hours-summary-user-select + .select2-container .select2-selection--multiple {
  min-height: 38px;
}

.hours-summary-filter-form .select2-container {
  width: 165px !important;
}

.hours-summary-date-filter {
  width: 165px;
}

.hours-summary-filter-btn {
  width: 42px;
  height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.selected-filter-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.selected-filter-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  border: 1px solid #dee2e6;
  border-radius: 999px;
  background-color: #ffffff;
  padding: 0.35rem 0.75rem;
  line-height: 1;
}

.selected-filter-chip-remove {
  border: 0;
  background: transparent;
  color: #6c757d;
  padding: 0;
  line-height: 1;
}

.position-level-actions {
  display: flex;
  gap: 0.5rem;
}

.position-level-actions .btn {
  flex: 0 0 auto;
  width: 2.375rem;
}

.position-level-actions .remove-level-btn {
  width: 2.375rem;
}

@media (max-width: 767.98px) {
  .position-level-actions {
    flex-direction: column;
  }

  .position-level-actions .btn,
  .position-level-actions .remove-level-btn {
    width: 100%;
  }

  .hours-summary-filter-form .select2-container,
  .hours-summary-date-filter,
  .hours-summary-filter-btn {
    width: 100% !important;
  }
}

/* Shared layout */
.sidebar {
    /* place sidebar below the fixed header and make it scrollable */
    top: 60px;
    height: calc(100vh - 60px);
    background-color: #ffffff;
    transition: all 0.3s ease;
    width: 250px;
    position: fixed;
    z-index: 1040;
    border-right: 1px solid #e1e5e9;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}
.sidebar-scroll {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    padding-bottom: 1rem;
}
.sidebar-footer {
    flex: 0 0 auto;
    padding: 12px 16px;
    color: #6c757d;
    background-color: #ffffff;
    border-top: 1px solid #e1e5e9;
    font-size: 0.75rem;
    text-align: center;
}
.sidebar .nav-link {
    color: #000000;
}
.sidebar .nav-link:hover {
    color: #ffffff;
    background-color: #00AEEF;
}
.sidebar .nav-link.active {
    color: #ffffff;
    background-color: #00AEEF;
}
.sidebar.collapsed {
    margin-left: -250px;
}
.main-content {
    transition: all 0.3s ease;
    margin-left: 250px;
    width: calc(100% - 250px);
}
.main-content.expanded {
    margin-left: 0;
    width: 100%;
}
.timesheet-status-sign {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    margin-right: 12px;
    border: 1px solid rgba(0, 0, 0, 0.15);
    box-shadow: 0 0 0 3px rgba(0, 0, 0, 0.04);
    color: #ffffff;
    font-size: 0.85rem;
    font-weight: 700;
    line-height: 1;
    text-decoration: none;
}
.timesheet-status-sign::after {
    content: '';
    position: absolute;
    inset: -2px;
    border: 2px solid var(--status-color);
    border-radius: inherit;
    pointer-events: none;
    animation: timesheet-status-pulse 2s ease-out infinite;
}
@keyframes timesheet-status-pulse {
    0% { transform: scale(1); opacity: 0.55; }
    80%, 100% { transform: scale(1.4); opacity: 0; }
}
@media (prefers-reduced-motion: reduce) {
    .timesheet-status-sign::after { display: none; animation: none; }
}
.timesheet-status-sign:hover,
.timesheet-status-sign:focus {
    color: #ffffff;
}
.timesheet-status-tooltip {
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
    min-width: 125px;
}
.timesheet-status-tooltip-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}
.timesheet-status-tooltip-dot {
    width: 9px;
    height: 9px;
    border-radius: 50%;
    flex-shrink: 0;
}
.timesheet-status-sign.status-red,
.timesheet-status-tooltip-dot.status-red {
    --status-color: #dc3545;
    background-color: var(--status-color);
}
.timesheet-status-sign.status-yellow,
.timesheet-status-tooltip-dot.status-yellow {
    --status-color: #ffc107;
    background-color: var(--status-color);
}
.timesheet-status-sign.status-green,
.timesheet-status-tooltip-dot.status-green {
    --status-color: #198754;
    background-color: var(--status-color);
}
@media (max-width: 768px) {
    .sidebar {
        margin-left: -250px;
    }
    .sidebar.show {
        margin-left: 0;
    }
    .main-content {
        margin-left: 0 !important;
        width: 100% !important;
    }
}

.navbar-logo {
    height: 40px;
    width: auto;
    margin-right: 10px;
}
