/* Main styling */
body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: #f0f2f5; /* Lighter background */
    color: #333;
}

.sidebar {
    position: fixed;
    top: 0;
    bottom: 0;
    left: 0;
    z-index: 100;
    padding: 48px 0 0;
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, .15); /* More pronounced shadow */
    background-color: #2c3e50; /* Darker, modern blue-grey */
}

.sidebar-sticky {
    position: relative;
    top: 0;
    height: calc(100vh - 48px);
    padding-top: 1rem; /* More padding */
    overflow-x: hidden;
    overflow-y: auto;
}

.sidebar .nav-link {
    font-weight: 500;
    color: #ecf0f1; /* Lighter text for contrast */
    padding: .75rem 1.5rem; /* Increased horizontal padding */
    transition: all 0.3s ease; /* Smooth transitions */
}

.sidebar .nav-link.active {
    color: #fff;
    background-color: #34495e; /* Slightly lighter active background */
    border-left: 5px solid #1abc9c; /* Accent color */
    padding-left: 1rem; /* Adjust padding for border */
}

.sidebar .nav-link:hover {
    color: #fff;
    background-color: #34495e;
    border-left: 5px solid #1abc9c; /* Accent color on hover */
    padding-left: 1rem; /* Adjust padding for border */
}

.sidebar-heading {
    font-size: .85rem; /* Slightly larger font */
    text-transform: uppercase;
    color: #bdc3c7; /* Muted text */
    padding: 0 1.5rem 0.5rem; /* More padding */
    letter-spacing: 0.05em; /* Spaced out letters */
}

/* Header adjustments */
.navbar-dark .navbar-brand {
    color: #fff;
    font-weight: 600;
}

.navbar-dark .navbar-nav .nav-link {
    color: #ecf0f1;
}

/* Dashboard cards */
.card {
    border: none;
    border-radius: .75rem; /* More rounded corners */
    box-shadow: 0 0.25rem 0.75rem rgba(0, 0, 0, .08); /* Softer, larger shadow */
    margin-bottom: 2rem; /* More space between cards */
    transition: transform 0.3s ease, box-shadow 0.3s ease; /* Smooth hover effects */
}

.card:hover {
    transform: translateY(-5px); /* Lift effect on hover */
    box-shadow: 0 0.5rem 1.5rem rgba(0, 0, 0, .12);
}

.card-header {
    background-color: #34495e; /* Darker header */
    color: #fff; /* White text */
    border-bottom: none;
    padding: 1.25rem 1.5rem; /* More padding */
    font-size: 1.1rem;
    font-weight: 600;
    border-top-left-radius: .75rem;
    border-top-right-radius: .75rem;
}

.card-body {
    padding: 1.5rem; /* More padding */
}

/* Tables */
.table {
    margin-bottom: 0;
    border-collapse: separate; /* For rounded corners */
    border-spacing: 0;
}

.table thead th {
    background-color: #f8f9fa; /* Light header background */
    color: #555;
    border-bottom: 2px solid #dee2e6;
    padding: 1rem;
}

.table tbody tr {
    transition: background-color 0.2s ease;
}

.table tbody tr:hover {
    background-color: #e9ecef; /* Light hover effect */
}

.table td, .table th {
    vertical-align: middle;
    padding: 1rem;
    border-top: 1px solid #dee2e6;
}

/* Forms */
.form-control, .form-select {
    border-radius: .5rem; /* More rounded */
    padding: .5rem .75rem;
    border: 1px solid #ced4da;
    box-shadow: inset 0 1px 2px rgba(0, 0, 0, .075);
}

.form-control:focus, .form-select:focus {
    border-color: #80bdff;
    box-shadow: 0 0 0 0.25rem rgba(0, 123, 255, .25);
}

.btn {
    border-radius: .5rem; /* More rounded */
    padding: .5rem 1rem;
    font-weight: 500;
    transition: all 0.2s ease;
}

.btn-primary {
    background-color: #1abc9c; /* Modern primary color */
    border-color: #1abc9c;
}

.btn-primary:hover {
    background-color: #16a085;
    border-color: #16a085;
}

.btn-success {
    background-color: #2ecc71;
    border-color: #2ecc71;
}

.btn-success:hover {
    background-color: #27ae60;
    border-color: #27ae60;
}

.btn-info {
    background-color: #3498db;
    border-color: #3498db;
}

.btn-info:hover {
    background-color: #2980b9;
    border-color: #2980b9;
}

.btn-outline-secondary {
    color: #6c757d;
    border-color: #6c757d;
}

.btn-outline-secondary:hover {
    background-color: #6c757d;
    color: #fff;
}

/* Badges */
.badge {
    padding: .4em .6em;
    border-radius: .35rem;
    font-weight: 600;
}

.badge.bg-success {
    background-color: #2ecc71 !important;
}

.badge.bg-warning {
    background-color: #f39c12 !important;
    color: #fff;
}

.badge.bg-danger {
    background-color: #e74c3c !important;
}

/* Modals */
.modal-content {
    border-radius: .75rem;
    box-shadow: 0 0.5rem 1.5rem rgba(0, 0, 0, .25);
}

.modal-header {
    background-color: #34495e; /* Consistent header color */
    color: #fff;
    border-bottom: none;
    border-top-left-radius: .75rem;
    border-top-right-radius: .75rem;
}

.modal-title {
    color: #fff !important; /* Ensure title is white */
}

.modal-footer {
    border-top: none;
    padding: 1rem 1.5rem;
    display: flex;
    justify-content: center; /* Center buttons */
    gap: 10px; /* Space between buttons */
}

.modal-body {
    max-height: 70vh; /* Set a max height for scrollability */
    overflow-y: auto; /* Enable vertical scrolling */
}

/* Alerts */
.alert {
    border-radius: .5rem;
    padding: 1rem 1.5rem;
}

/* Custom invoice styling */
.invoice-wrapper {
    font-family: 'Arial', sans-serif;
    color: #333;
    line-height: 1.6;
    padding: 15mm; /* Match original padding */
}

.invoice-header .company-name {
    font-size: 2.2rem;
    margin-bottom: 5px;
    color: #2c3e50;
}

.invoice-header .invoice-title {
    font-size: 1.4rem;
    margin: 0;
    color: #555;
}

.invoice-details strong {
    color: #2c3e50;
}

.invoice-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 20px;
}

.invoice-table th, .invoice-table td {
    border: 1px solid #eee;
    padding: 10px;
    text-align: left;
}

.invoice-table th {
    background-color: #f8f8f8;
    font-weight: bold;
}

.invoice-table .text-end {
    text-align: right;
}

.invoice-table .badge {
    font-size: 0.85em;
    padding: 0.4em 0.6em;
    border-radius: 0.25rem;
}

.invoice-table .badge.bg-success {
    background-color: #2ecc71;
}

.invoice-table .badge.bg-warning {
    background-color: #f39c12;
}

.invoice-table .badge.bg-danger {
    background-color: #e74c3c;
}

.invoice-note {
    background-color: #fff3cd;
    border-color: #ffc107;
    color: #856404;
    padding: 10px;
    border-left: 4px solid #ffc107;
    border-radius: 5px;
    margin-bottom: 20px;
}

.invoice-signatures {
    margin-top: 40px;
    padding-top: 20px;
    border-top: 1px solid #ddd;
    display: flex;
    justify-content: space-between;
    padding-bottom: 20px; /* Add space below signatures */
}

.invoice-signatures .signature-block {
    flex: 1;
    padding: 0 20px; /* Add horizontal padding for space */
}

.invoice-signatures .signature-block.text-end {
    text-align: right;
}

.invoice-signatures .signature-line {
    border-top: 1px solid #333;
    width: 200px;
    margin-top: 30px;
}

.invoice-signatures .signature-block.text-end .signature-line {
    margin-left: auto;
}

/* Print specific styles */
@media print {
    body * {
        visibility: hidden;
    }
    .invoice-wrapper, .invoice-wrapper * {
        visibility: visible;
    }
    .invoice-wrapper {
        position: absolute;
        left: 0;
        top: 0;
        width: 100%;
        padding: 0;
        margin: 0;
        border: none;
    }
    .modal-footer {
        display: none; /* Hide buttons when printing */
    }
}
