/*
 * Global styles for the invoice application. This stylesheet covers
 * the form used to create invoices, the list of saved invoices, and
 * the visual appearance of the rendered invoice itself. Colours and
 * spacing have been chosen to mirror the original PDF invoice as
 * closely as possible while maintaining good readability on screen.
 */

/* Base typography and layout */
body {
  margin: 0;
  padding: 0;
  font-family: Arial, Helvetica, sans-serif;
  background-color: #f5f7fa;
  color: #333;
}

.container {
  max-width: 900px;
  margin: 40px auto;
  background: #ffffff;
  padding: 30px;
  border-radius: 8px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

h1, h2 {
  margin-top: 0;
  color: #0a3d62;
}

h2 {
  margin-bottom: 10px;
}

hr {
  border: none;
  border-top: 1px solid #e0e6ed;
  margin: 20px 0;
}

/* Form specific styles */
.form-group {
  margin-bottom: 15px;
}

.form-group label {
  display: block;
  font-weight: bold;
  margin-bottom: 5px;
}

.form-group input,
.form-group textarea {
  width: 100%;
  padding: 8px;
  border: 1px solid #cdd5df;
  border-radius: 4px;
  font-size: 14px;
  box-sizing: border-box;
}

.items-container {
  margin-bottom: 15px;
}

.item-row {
  display: grid;
  grid-template-columns: 2fr 0.8fr 0.8fr;
  gap: 10px;
  margin-bottom: 10px;
}

.item-row input {
  padding: 8px;
  border: 1px solid #cdd5df;
  border-radius: 4px;
  font-size: 14px;
}

button {
  cursor: pointer;
  border: none;
  padding: 10px 15px;
  font-size: 14px;
  border-radius: 4px;
  display: inline-block;
}

button.btn-add {
  background-color: #1d65a6;
  color: #ffffff;
  margin-top: 5px;
}

button.btn-add:hover {
  background-color: #0a3d62;
}

button.btn-submit {
  background-color: #0a3d62;
  color: #ffffff;
}

button.btn-submit:hover {
  background-color: #063056;
}

/* Table styles for list page */
table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 15px;
  font-size: 14px;
}

th, td {
  text-align: left;
  padding: 10px;
  border-bottom: 1px solid #e6eaf0;
}

th {
  background-color: #0a3d62;
  color: #ffffff;
}

tbody tr:nth-child(even) {
  background-color: #f9fafb;
}

a {
  color: #1d65a6;
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

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

/* Invoice template styles */
.invoice-wrapper {
  max-width: 850px;
  margin: 20px auto;
  background: #ffffff;
  padding: 30px;
  border: 1px solid #d9dee9;
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
  font-size: 14px;
}

.invoice-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 2px solid #0a3d62;
  padding-bottom: 15px;
}

.brand {
  flex: 1;
}

.brand h1 {
  margin: 0;
  font-size: 32px;
  color: #0a3d62;
  font-weight: bold;
}

.brand p {
  margin: 0;
  font-size: 14px;
  color: #1d65a6;
  letter-spacing: 1px;
}

.invoice-info {
  text-align: right;
  flex: 1;
}

.invoice-info h2 {
  margin: 0 0 5px 0;
  font-size: 24px;
  color: #0a3d62;
}

.invoice-info table {
  width: 100%;
}

.invoice-info td {
  padding: 2px 0;
  font-size: 14px;
  color: #333;
}

.customer-info {
  margin-top: 20px;
  font-size: 14px;
  border-bottom: 1px solid #e6eaf0;
  padding-bottom: 10px;
}

.customer-info p {
  margin: 2px 0;
}

.items-table {
  margin-top: 20px;
}

.items-table table {
  width: 100%;
  border-collapse: collapse;
}

.items-table th {
  background-color: #0a3d62;
  color: #ffffff;
  padding: 8px;
  font-weight: bold;
  font-size: 14px;
}

.items-table td {
  padding: 8px;
  border-bottom: 1px solid #e6eaf0;
  font-size: 14px;
}

.items-table .center {
  text-align: center;
}

.items-table .right {
  text-align: right;
}

.summary {
  margin-top: 20px;
  width: 100%;
  display: flex;
  justify-content: flex-end;
}

.summary table {
  width: 300px;
  border-collapse: collapse;
}

.summary td {
  padding: 8px;
  font-size: 14px;
}

.summary tr td:first-child {
  font-weight: bold;
}

.payment-info {
  margin-top: 20px;
  font-size: 14px;
  color: #0a3d62;
}

.payment-info p {
  margin: 2px 0;
}

footer {
  margin-top: 30px;
  text-align: center;
  font-size: 12px;
  color: #6c7a89;
}

/* Print styles */
@media print {
  body {
    background: #ffffff;
    margin: 0;
  }
  .container, .invoice-wrapper {
    box-shadow: none;
    border: none;
  }
  button, .btn-add, .btn-submit, .mt-20 {
    display: none;
  }
  a {
    text-decoration: none;
  }
}