/* === PROJECT TABLE STYLES — macOS26 light mode === */

:root {
  --row-h: 50px;
  --status-none: #b0b6c6;
  --status-quoted: #5a6eff;
  --status-open: #1e90ff;
  --status-pending: #f6a73b;
  --status-inprogress: #e2e200;
  --status-onapproval: #a85de0;
  --status-signedoff: #28c46f;
  --status-invoiced: #ffcc00;
  --status-archived: #b3b3b3;
  --status-paid: #34c759;
  --status-complete: #30d179;
  --status-cancelled: #a0a0a0;
  --status-declined: #c0392b;
}

table.projects {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
  color: #222;
}

table.projects thead {
  background: rgba(0, 0, 0, 0.05);
  text-transform: uppercase;
  font-size: 12px;
  letter-spacing: 0.05em;
}

table.projects th,
table.projects td {
  text-align: left;
  padding: 12px 16px;
  border-bottom: 1px solid rgba(0, 0, 0, 0.08);
  vertical-align: middle;
}

table.projects tbody tr {
  height: var(--row-h);
}

table.projects td {
  height: var(--row-h);
  box-sizing: border-box;
}

/* === Hover + row background === */
table.projects tbody tr {
  transition: background 0.2s ease;
}

table.projects tbody tr:hover {
  background: rgba(0, 0, 0, 0.03);
}

/* === Inline edit fields === */
table.projects td input,
table.projects td textarea {
  background: transparent;
  border: none;
  color: #222;
  font: inherit;
  width: 100%;
  padding: 0;
  outline: none;
  transition: all 0.2s ease;
  -webkit-appearance: none !important;
  -moz-appearance: none !important;
  appearance: none !important;
}

table.projects td input:hover,
table.projects td textarea:hover {
  border-bottom: 1px dotted rgba(0, 0, 0, 0.2);
  cursor: text;
}

table.projects td input:focus,
table.projects td textarea:focus {
  background: rgba(0, 0, 0, 0.03);
}

/* === Month divider === */
.month-divider td {
  background: rgba(0, 0, 0, 0.02);
  color: #666;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 8px 16px;
  border-top: 1px solid rgba(0, 0, 0, 0.08);
}

/* === Table widths === */
.projects th:nth-child(1),
.projects td:nth-child(1) {
  width: 160px;
}

.projects th:nth-child(2),
.projects td:nth-child(2) {
  width: 340px;
}

.projects th:nth-child(3),
.projects td:nth-child(3) {
  width: 120px;
}

.projects th:nth-child(4),
.projects td:nth-child(4) {
  width: 120px;
}

.projects th:nth-child(5),
.projects td:nth-child(5) {
  width: 130px;
}

.projects th:nth-child(7),
.projects td:nth-child(7) {
  width: 100px;
}

.projects th:nth-child(10),
.projects td:nth-child(10),
.projects th:nth-child(11),
.projects td:nth-child(11),
.projects th:nth-child(12),
.projects td:nth-child(12),
.projects th:nth-child(13),
.projects td:nth-child(13) {
  width: 110px;
  text-align: left;
}

/* === STATUS CELL === */
.status-cell {
  padding: 0 !important;
}

.status-wrapper {
  display: flex;
  align-items: center;
  height: 100%;
  width: 100%;
  gap: 8px;
}

/* === Currency Cell === */
.currency-cell {
  position: relative;
}

.currency-cell input {
  padding-left: 2px !important;
  margin-left: 7px !important;
}

.currency-cell::before {
  content: "£";
  position: absolute;
  left: 8px;
  top: 50%;
  transform: translateY(-50%);
  color: #777;
  font-size: inherit;
  pointer-events: none;
}

/* === Status dot === */
.status-dot {
  flex-shrink: 0;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  box-shadow: 0 0 0 2px rgba(0, 0, 0, 0.1);
}

.status-none .status-dot {
  background: var(--status-none);
}

.status-quoted .status-dot {
  background: var(--status-quoted);
}

.status-open .status-dot {
  background: var(--status-open);
}

.status-pending .status-dot {
  background: var(--status-pending);
}

.status-inprogress .status-dot {
  background: var(--status-inprogress);
}

.status-onapproval .status-dot {
  background: var(--status-onapproval);
}

.status-signedoff .status-dot {
  background: var(--status-signedoff);
}

.status-invoiced .status-dot {
  background: var(--status-invoiced);
}

.status-archived .status-dot {
  background: var(--status-archived);
}

.status-paid .status-dot {
  background: var(--status-paid);
}

.status-cancelled .status-dot {
  background: var(--status-cancelled);
}

.status-declined .status-dot {
  background: var(--status-declined);
}

/* === Styled dropdown === */
.status-select,
table.projects td select {
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
  width: 100%;
  height: 100%;
  line-height: var(--row-h);
  background: #fff;
  font-size: 13px;
  font-weight: 400;
  color: #222;
  cursor: pointer;
  backdrop-filter: blur(12px);
  transition: background 0.2s ease, border 0.2s ease;
  box-sizing: border-box;
}

.status-select:hover,
table.projects td select:hover {
  background: rgba(0, 0, 0, 0.04);
  border-color: transparent !important;
}

.status-select:focus,
table.projects td select:focus {
  outline: none;
  border-color: transparent !important;
  background: rgba(0, 0, 0, 0.06);
}

.status-select option {
  background: rgba(255, 255, 255, 0.98);
  color: #222;
  font-size: 13px;
  padding: 8px 12px;
}

/* === Cancelled rows === */
tr.cancelled {
  opacity: 0.45;
  text-decoration: line-through;
}

/* === Empty state === */
.projects-empty {
  text-align: center;
  padding: 40px;
  color: #777;
  font-style: italic;
  background: rgba(0, 0, 0, 0.02);
  border-radius: var(--round);
}

/* === Row actions === */
.row-actions {
  padding: 0 10px;
  border-bottom: 1px solid rgba(0, 0, 0, 0.06);
  vertical-align: middle;
}

.row-actions .link {
  background: transparent;
  border: 0;
  color: #4a4a4a;
  cursor: pointer;
}

.row-actions .link:hover {
  color: #000;
}

/* === Row action icons (light theme visibility fix) === */
.row-actions svg,
.row-actions .icon svg,
.row-actions .link svg {
  fill: #222;
  /* default dark ink for visibility */
  transition: fill 0.2s ease, opacity 0.2s ease;
}

/* Force darker ink on hover, out-specific the base .icon-btn:hover rule */
.row-actions .icon-btn:hover .icon svg,
.row-actions .link:hover .icon svg,
.row-actions .link:hover svg {
  fill: #222;
  opacity: 0.8;
}

/* Optional: subtle hover backing for target area */
.row-actions .icon-btn:hover,
.row-actions .link:hover {
  background: rgba(0, 0, 0, 0.06);
}


/* === Notes Cell Fix === */
.notes-cell {
  padding: 0;
  text-align: center;
  vertical-align: middle;
}

.notes-dot-btn {
  all: unset;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  cursor: pointer;
  transition: transform 0.2s ease, background 0.2s ease, box-shadow 0.2s ease;
  position: relative;
  top: 0px;
}

/* States */
.notes-dot-btn.no-notes {
  background: transparent;
  box-shadow: 0 0 0 2px rgba(0, 0, 0, 0.1);
}

.notes-dot-btn.has-notes {
  background: #30d158;
  box-shadow: 0 0 0 2px rgba(48, 209, 120, 0.4);
}

.notes-dot-btn:hover {
  transform: scale(1.15);
}

/* === Mini Notes Modal === */
#notesModal {
  position: fixed;
  inset: 0;
  background: rgba(240, 240, 240, 0.55);
  backdrop-filter: blur(14px);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 9999;
}

#notesModal.show {
  display: flex;
}

.notes-modal-content {
  width: 420px;
  max-width: 90vw;
  background: rgba(255, 255, 255, 0.96);
  border-radius: 16px;
  padding: 24px;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.25);
  transform: scale(0.95);
  animation: modalFadeIn 0.3s ease forwards;
}

.notes-modal-content h3 {
  margin-top: 0;
  margin-bottom: 12px;
  font-size: 1.2rem;
  color: #111;
}

.notes-modal-content textarea {
  width: 100%;
  min-height: 140px;
  padding: 10px;
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.03);
  border: 1px solid rgba(0, 0, 0, 0.1);
  color: #222;
  resize: vertical;
}

.notes-modal-actions {
  margin-top: 16px;
  text-align: right;
}

.notes-modal-actions button {
  margin-left: 8px;
  padding: 6px 14px;
  border-radius: 6px;
  border: none;
  cursor: pointer;
  background: #30d158;
  color: #fff;
  font-weight: 500;
}

.notes-modal-actions button.cancel {
  background: rgba(0, 0, 0, 0.08);
}

@keyframes modalFadeIn {
  to {
    opacity: 1;
    transform: scale(1);
  }
}