/****************************/
/*******Basics & Typo********/
/****************************/

html, body {
	font-family: 'Source Sans 3', system-ui, -apple-system, sans-serif;
	background-color: #f4f6f9;
}

/****************************/
/*******Dashboard shell******/
/****************************/

.sidebar {
	position: fixed;
	top: 56px; /* navbar height */
	bottom: 0;
	left: 0;
	z-index: 100;
	width: 240px;
	overflow-y: auto;
	padding-top: 0.5rem;
}

.sidebar .sidebar-heading {
	font-size: 0.75rem;
	letter-spacing: 0.04em;
}

.sidebar .nav-link {
	color: #495057;
	border-radius: 0.375rem;
	margin: 0.1rem 0.6rem;
	padding: 0.45rem 0.75rem;
}

.sidebar .nav-link:hover {
	background-color: rgba(0, 0, 0, 0.05);
}

.sidebar .nav-link.active {
	color: #fff;
	background-color: #0d6efd;
}

.main-content {
	margin-top: 56px;
}

@media (min-width: 768px) {
	.main-content {
		margin-left: 240px;
	}
}

/* Subtle lift for cards so they read as distinct panels against the
   light-gray page background */
.card {
	box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
}

/* =========================
   TABLE LAYOUT CONTROL
   ========================= */

.table-wrap {
	max-width: 1600px;
	margin: 0 auto;
}

/* Keep table from exploding */
.budget-table {
	table-layout: fixed;
	width: 100%;
}

/* Default cell behavior */
.budget-table th,
.budget-table td {
	vertical-align: top;
	word-wrap: break-word;
	white-space: normal;
	padding: 0.35rem 0.1rem;
	font-size: 0.75rem;
}

/* === Column widths ===
   13 columns now (Edit/Delete merged into one Actions column) - tightened
   throughout to cut down how much this table has to horizontally scroll. */
.budget-table th:nth-child(1),
.budget-table td:nth-child(1) { width: 100px; }  /* Date */
.budget-table tr:nth-child(1) td { margin:0; } /* New entry row */
.budget-table tr:nth-child(1) input, .budget-table tr:nth-child(1) select { border:0;padding:1em 0em 1em 0em; font-size: 0.7rem;cursor:pointer} /* New entry row */

.budget-table th:nth-child(2),
.budget-table td:nth-child(2) { width: 85px; }   /* Cost Center */

.budget-table th:nth-child(3),
.budget-table td:nth-child(3) { width: 70px; }   /* PSP */

.budget-table th:nth-child(4),
.budget-table td:nth-child(4) { width: 140px; }  /* Activity name */

.budget-table th:nth-child(5),
.budget-table td:nth-child(5) { width: 120px; }  /* Creditor */

.budget-table th:nth-child(6),
.budget-table td:nth-child(6) { width: 160px; }  /* Activity */

.budget-table th:nth-child(7),
.budget-table td:nth-child(7) { width: 90px; }   /* User */

.budget-table th:nth-child(8),
.budget-table td:nth-child(8),
.budget-table th:nth-child(9),
.budget-table td:nth-child(9) { width: 100px; }  /* Amounts */

.budget-table th:nth-child(10),
.budget-table td:nth-child(10) { width: 60px; }  /* Currency */

.budget-table th:nth-child(11),
.budget-table td:nth-child(11) { width: 90px; }  /* Invoice */

.budget-table th:nth-child(12),
.budget-table td:nth-child(12) { width: 140px; } /* Comments */

.budget-table th:nth-child(13),
.budget-table td:nth-child(13) {
  width: 90px;
  text-align: center;
} /* Actions (Edit+Delete, or Save+Cancel) */


.budget-table input,
.budget-table select,
.budget-table textarea {
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
}

.budget-table td > input,
.budget-table td > select {
  padding: 0.4rem;
  margin:0;
}

/* =========================
   MOBILE: STACK EACH ROW INTO ITS OWN CARD
   ========================= */
@media (max-width: 767.98px) {
  .budget-table thead {
    display: none;
  }

  .budget-table,
  .budget-table tbody,
  .budget-table tr,
  .budget-table td {
    display: block;
    width: 100% !important;
  }

  .budget-table tr {
    margin-bottom: 0.75rem;
    border: 1px solid #dee2e6;
    border-radius: 0.5rem;
    padding: 0.5rem 0.75rem;
    background: #fff;
  }

  .budget-table td {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    text-align: right;
    border: none;
    border-bottom: 1px solid #f1f1f1;
    padding: 0.4rem 0;
  }

  .budget-table td:last-child {
    border-bottom: none;
    justify-content: center;
  }

  /* Pseudo-header per field, driven by the data-label attribute already
     on each <td> in index.pug */
  .budget-table td::before {
    content: attr(data-label);
    flex: 0 0 auto;
    text-align: left;
    font-weight: 600;
    font-size: 0.7rem;
    color: #6c757d;
    text-transform: uppercase;
  }

  .budget-table td:last-child::before {
    content: none;
  }

  .budget-table td > input,
  .budget-table td > select {
    max-width: 65%;
    margin-left: auto;
  }
}
