* { box-sizing: border-box; }

body {
  font-family: 'Helvetica Neue', sans-serif;
  background-color: #f0f4f8;
  color: #333;
  padding: 15px;
}

header {
  background-color: #0056b3;
  color: white;
  padding: 10px 15px;
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
}

header nav a {
  color: white;
  padding: 6px 10px;
  text-decoration: none;
  background-color: #007bff;
  border-radius: 4px;
}

header nav a:hover {
  background-color: #0056b3;
}

table {
  width: 100%;
  background-color: white;
  border: 1px solid #cce;
  border-collapse: collapse;
  margin-top: 15px;
}

thead {
  background-color: #dceeff;
  color: #003366;
}

th, td {
  border: 1px solid #cce;
  padding: 10px;
}

tr.paid {
  background-color: #def7e2;
}

a.button, .button {
  background-color: #007bff;
  color: white;
  padding: 6px 12px;
  border-radius: 4px;
  text-decoration: none;
}

a.button:hover {
  background-color: #0056b3;
}

footer {
  margin-top: 30px;
  font-size: 12px;
  color: #555;
  text-align: center;
}


footer p {
    margin: 5px 0 0;
}

/* Table styling - modern, compact */
table {
    width: 100%;
    border-collapse: collapse;
    margin: 15px 0;
    font-size: 13px;
}

thead {
    background-color: #f2f2f2;
}

th, td {
    padding: 8px 10px;
    text-align: left;
    border: 1px solid #ddd;
    background-color: #fff;
    box-shadow: 0 0 0 1px #e0e0e0;
    white-space: nowrap;
}

th {
    background-color: #f8f9fa;
    color: #333;
    text-transform: uppercase;
    font-size: 12px;
    letter-spacing: 0.3px;
}

tr.paid td, .paid {
    background-color: #e6f9ed;
}

tr:hover td {
    background-color: #f1f9ff;
}

/* Buttons - general smaller */
a.button, button, .button {
    background-color: #007BFF;
    color: white;
    border: none;
    padding: 6px 12px;
    border-radius: 4px;
    cursor: pointer;
    text-decoration: none;
    font-size: 13px;
    display: inline-block;
    margin: 0.25em 0.25em;
}

a.button:hover, button:hover, .button:hover {
    background-color: #0056b3;
}

/* Color-coded buttons */
a.button.add-payment,
button.add-payment {
    background-color: #28a745;
}

a.button.add-payment:hover,
button.add-payment:hover {
    background-color: #218838;
}

a.button.add-jobs,
button.add-jobs {
    background-color: #fd7e14;
}

a.button.add-jobs:hover,
button.add-jobs:hover {
    background-color: #e86c0d;
}

a.button.invoice,
button.invoice {
    background-color: #17a2b8;
}

a.button.invoice:hover,
button.invoice:hover {
    background-color: #138496;
}

/* Form styles */
label {
    display: block;
    margin-top: 8px;
    font-weight: bold;
    font-size: 13px;
}

input[type="text"], input[type="number"], input[type="date"], select {
    width: 100%;
    padding: 6px;
    margin-top: 4px;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 13px;
}

.readonly {
    background-color: #f5f5f5;
}

.button-group {
    margin-top: 15px;
    display: flex;
    gap: 8px;
}

/* Flex container for add_jobs */
.flex-container {
    display: flex;
    gap: 30px;
    flex-wrap: wrap;
}

.flex-container > div {
    flex: 1 1 380px;
}

/* Messages */
.error {
    color: red;
    margin-top: 12px;
    font-size: 13px;
}

.success {
    color: green;
    margin-top: 12px;
    font-size: 13px;
}

.msg {
    margin-top: 15px;
    color: #333;
    font-size: 13px;
}

.grand-total {
    font-weight: bold;
    margin-top: 12px;
    font-size: 14px;
}

/* CATEGORY TOGGLE BUTTON */
.category-toggle {
    width: 100%;
    padding: 12px 16px;
    font-size: 16px;
    font-weight: bold;
    background-color: #343a40;
    color: #fff;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    text-align: left;
    margin: 12px 0 6px;
    transition: background-color 0.3s ease;
}
.category-toggle:hover {
    background-color: #212529;
}

/* CATEGORY CONTENT */
.category-content {
    padding: 10px 10px 15px;
    background-color: #f8f9fa;
    border-radius: 6px;
    margin-bottom: 15px;
    transition: all 0.3s ease;
}

/* JOB BUTTONS */
.job-buttons-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
    gap: 10px;
    margin-top: 10px;
}
.job-button {
    padding: 20px;
    background: #007bff;
    color: white;
    font-size: 18px;
    font-weight: bold;
    border: none;
    border-radius: 8px;
    cursor: pointer;
}
.job-button:hover {
    background: #0056b3;
}

/* MODALS */
.modal {
    display: none;
    position: fixed;
    z-index: 9999;
    left: 0; top: 0;
    width: 100%; height: 100%;
    background: rgba(0,0,0,0.6);
    justify-content: center;
    align-items: center;
}
.modal-content {
    background: white;
    padding: 20px;
    width: 90%;
    max-width: 400px;
    margin: 100px auto;
    border-radius: 10px;
    position: relative;
}
.close {
    position: absolute;
    top: 10px; right: 20px;
    font-size: 24px;
    cursor: pointer;
}

/* CALCULATOR */
.calculator {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    margin: 15px 0;
}
.calculator button {
    font-size: 20px;
    padding: 15px;
    background: #f1f1f1;
    border: none;
    border-radius: 6px;
    cursor: pointer;
}
.calculator button:hover {
    background: #ddd;
}
.add-btn {
    background: #28a745;
    color: white;
    width: 100%;
    padding: 12px;
    font-size: 16px;
    border: none;
    border-radius: 6px;
}

/* READY NOTIFY */
.notify-ready.ready-sent {
    background-color: #28a745;
    color: #fff;
    font-weight: bold;
}

/* RESPONSIVE */
@media screen and (max-width: 768px) {
    header {
        flex-direction: column;
        gap: 8px;
    }

    .flex-container {
        flex-direction: column;
    }

    table, input[type="text"], input[type="number"], input[type="date"], select, button, a.button {
        font-size: 12px;
    }

    input[type="text"], input[type="number"], input[type="date"], select {
        width: 100%;
    }

    table, thead, tbody, th, td, tr {
        display: block;
    }

    thead tr {
        display: none;
    }

    tr {
        margin-bottom: 1em;
        border: 1px solid #ccc;
        padding: 0.5em;
        background-color: #fafafa;
    }

    td {
        border: none;
        border-bottom: 1px solid #eee;
        position: relative;
        padding-left: 50%;
    }

    td::before {
        content: attr(data-label);
        position: absolute;
        left: 1em;
        top: 0.75em;
        font-weight: bold;
    }

    .button {
        display: block;
        margin: 0.5em 0;
    }

/* Wrap buttons nicely in action columns */
td[data-label="Actions"],
td:last-child {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    justify-content: flex-start;
    padding-left: 0 !important;
}

/* On mobile: make sure buttons look good */
@media screen and (max-width: 768px) {
    td[data-label="Actions"] .button,
    td:last-child .button {
        flex: 1 1 auto;
        margin: 4px 0;
        white-space: nowrap;
    }
}

