/* General Styling */
body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    background-color: #f0f2f5;
    margin: 0;
    font-size: 14px; /* MODIFIED: Set a smaller base font size */
}

.container {
    max-width: 1200px;
    margin: 15px auto; /* MODIFIED: Reduced top/bottom margin */
    padding: 15px;     /* MODIFIED: Reduced padding */
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

h1,
h2 {
    color: #333;
}

a {
    color: #007bff;
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

/* Navigation */
.navbar {
    background-color: #343a40;
    padding: 8px 15px; /* MODIFIED: Reduced padding */
    border-radius: 8px;
    margin-bottom: 15px; /* MODIFIED: Reduced margin */
}

.navbar a {
    color: #fff;
    margin-right: 15px;
    font-weight: 500;
    padding: 6px 10px; /* MODIFIED: Reduced padding */
    border-radius: 5px;
}

.navbar a:hover,
.navbar a.active {
    background-color: #495057;
}

/* Forms */
.form-section {
    border: 1px solid #dee2e6;
    padding: 15px; /* MODIFIED: Reduced padding */
    border-radius: 8px;
    margin-bottom: 15px; /* MODIFIED: Reduced margin */
}

.form-section legend {
    font-size: 1.1em; /* MODIFIED: Slightly smaller legend */
    font-weight: 600;
    padding: 0 10px;
    color: #495057;
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); /* MODIFIED: Smaller min-width */
    gap: 15px; /* MODIFIED: Reduced gap */
}

.form-group {
    display: flex;
    flex-direction: column;
}

label {
    margin-bottom: 5px;
    font-weight: 500;
    color: #495057;
}

input[type="text"],
input[type="date"],
input[type="number"],
select,
textarea {
    width: 100%;
    padding: 8px; /* MODIFIED: Reduced padding to make inputs shorter */
    border: 1px solid #ced4da;
    border-radius: 4px;
    box-sizing: border-box;
    font-size: 1em; /* MODIFIED: Ensure form elements inherit base font size */
}

textarea {
    resize: vertical;
}

/* Buttons */
.btn {
    padding: 8px 12px; /* MODIFIED: Reduced padding */
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-weight: 500;
}

.btn-primary {
    background-color: #007bff;
    color: white;
}

.btn-primary:hover {
    background-color: #0056b3;
}

.btn-success {
    background-color: #28a745;
    color: white;
}

.btn-danger {
    background-color: #dc3545;
    color: white;
}

.btn-secondary {
    background-color: #6c757d;
    color: white;
}

/* Tables */
table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 5px; /* MODIFIED: Reduced margin */
}

th,
td {
    padding: 5px; /* MODIFIED: Reduced padding for denser tables */
    border: 0px solid #dee2e6;
    text-align: left;
}

th {
    background-color: #f8f9fa;
}

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

/* Dashboard Cards */
.dashboard-cards {
    display: flex;
    gap: 15px; /* MODIFIED: Reduced gap */
    justify-content: space-around;
}

.card {
    background-color: #fff;
    padding: 15px; /* MODIFIED: Reduced padding */
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    text-align: center;
    flex-grow: 1;
}

.card h3 {
    margin-top: 0;
    color: #6c757d;
}

.card p {
    font-size: 1.8em; /* MODIFIED: Slightly smaller text */
    font-weight: 600;
    color: #343a40;
    margin-bottom: 0;
}

/* Invoice View */
.invoice-view {
    border: 1px solid #ccc;
    padding: 10px;
}

.invoice-header {
    text-align: center;
    margin-bottom: 10px;
}

.invoice-footer {
    text-align: center;
    margin-top: 10px;
    font-style: italic;
}

.invoice-actions {
    text-align: center;
    margin-top: 15px; /* MODIFIED: Reduced margin */
    padding: 15px;    /* MODIFIED: Reduced padding */
    background-color: #f8f9fa;
    border-radius: 8px;
}