* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    padding: 20px;
    max-width: 1200px;
    margin: 0 auto;
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    color: #333;
    min-height: 100vh;
}

.container {
    background: white;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    margin-bottom: 20px;
}

header {
    background: #3498db;
    color: white;
    padding: 20px;
    text-align: center;
}

h1 {
    font-size: 24px;
    margin-bottom: 5px;
}

.card {
    padding: 25px;
}

.form-group {
    margin-bottom: 20px;
}

label {
    display: block;
    font-weight: 600;
    margin-bottom: 8px;
    color: #2c3e50;
}

select, input {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid #ddd;
    border-radius: 8px;
    font-size: 16px;
    transition: border-color 0.3s;
}

select:focus, input:focus {
    border-color: #3498db;
    outline: none;
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.2);
}

button {
    background: #3498db;
    color: white;
    border: none;
    padding: 15px;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.3s;
    margin-top: 10px;
}

button:hover {
    background: #2980b9;
}

.message {
    padding: 12px;
    border-radius: 8px;
    margin-top: 15px;
    display: none;
}

.error {
    background: #ffecec;
    color: #e74c3c;
    border: 1px solid #f5b7b1;
}

.success {
    background: #eafaf1;
    color: #27ae60;
    border: 1px solid #a9dfbf;
}

.modern-menu-header {
    margin-bottom: 20px;
}

.menu-title {
    font-size: 18px;
    font-weight: 700;
    color: #2c3e50;
    margin-bottom: 12px;
    letter-spacing: 0.5px;
}

.menu-divider {
    height: 2px;
    background: linear-gradient(90deg, #3498db, transparent);
    border-radius: 2px;
}

.modern-menu-items {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.modern-menu-item {
    display: flex;
    align-items: center;
    padding: 18px 20px;
    background: #f8fafc;
    border-radius: 14px;
    text-decoration: none;
    color: #2c3e50;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border: 1px solid transparent;
    position: relative;
    overflow: hidden;
}

.modern-menu-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    background: #3498db;
    transform: scaleY(0);
    transition: transform 0.3s ease;
    border-radius: 4px 0 0 4px;
}

.modern-menu-item:hover {
    background: white;
    border-color: #e3e8f0;
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(52, 152, 219, 0.15);
}

.modern-menu-item:hover::before {
    transform: scaleY(1);
}

.modern-menu-item:hover .modern-menu-arrow {
    opacity: 1;
    transform: translateX(0);
}

.modern-menu-icon {
    width: 44px;
    height: 44px;
    background: linear-gradient(135deg, #3498db 0%, #2980b9 100%);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 16px;
    color: white;
    font-size: 20px;
    transition: all 0.3s ease;
}

.modern-menu-item:hover .modern-menu-icon {
    transform: rotate(10deg) scale(1.05);
}

.modern-menu-text {
    font-weight: 600;
    font-size: 16px;
    flex-grow: 1;
}

.modern-menu-arrow {
    opacity: 0;
    transform: translateX(-10px);
    transition: all 0.3s ease;
    color: #3498db;
    font-weight: bold;
}

/* Mobile styles */
@media (max-width: 768px) {
    .modern-menu {
        padding: 20px;
        border-radius: 16px;
    }

    .modern-menu-item {
        padding: 16px;
    }

    .modern-menu-icon {
        width: 40px;
        height: 40px;
        font-size: 18px;
        margin-right: 14px;
    }

    .modern-menu-text {
        font-size: 15px;
    }
}

.report-container {
    margin-top: 30px;
    background: white;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    display: block;
}

.report-header {
    background: #2c3e50;
    color: white;
    padding: 15px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.report-title {
    font-size: 18px;
    font-weight: 600;
}

.report-period {
    font-size: 14px;
}

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

.report-table th {
    background-color: #3498db;
    color: white;
    padding: 12px 15px;
    text-align: left;
}

.report-table td {
    padding: 10px 15px;
    border-bottom: 1px solid #eee;
}

.report-table tr:nth-child(even) {
    background-color: #f9f9f9;
}

.report-table tr:hover {
    background-color: #f1f1f1;
}

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

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

.total-row {
    font-weight: bold;
    background-color: #e8f4fc;
}

.grand-total-row {
    font-weight: bold;
    background-color: #2c3e50;
    color: white;
}

.no-data {
    text-align: center;
    padding: 20px;
    color: #7f8c8d;
}

.btn-print {
    background: #27ae60;
    color: white;
    border: none;
    padding: 8px 15px;
    border-radius: 5px;
    cursor: pointer;
    font-size: 14px;
}

.btn-print:hover {
    background: #219653;
}

.btn-pdf {
    background: #e74c3c;
}

.btn-pdf:hover {
    background: #c0392b;
}

.button-group {
    display: flex;
    gap: 10px;
}

.button-group button {
    flex: 1;
}

.loading {
    display: none;
    text-align: center;
    padding: 15px;
}

.loading-spinner {
    border: 4px solid #f3f3f3;
    border-top: 4px solid #3498db;
    border-radius: 50%;
    width: 30px;
    height: 30px;
    animation: spin 1s linear infinite;
    margin: 0 auto;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }
    100% {
        transform: rotate(360deg);
    }
}

.table-container {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

@media (max-width: 768px) {
    .report-table {
        min-width: 600px;
    }

    .report-header {
        flex-direction: column;
        text-align: center;
        gap: 10px;
    }

    .report-period {
        font-size: 13px;
    }
}

@media (max-width: 480px) {
    .report-table {
        font-size: 14px;
    }

    .report-table th,
    .report-table td {
        padding: 8px 10px;
    }
}

.form-row {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
    align-items: flex-end;
}

.select-container {
    height: 48px;
    display: flex;
    align-items: center;
}

.form-group {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-width: 200px;
}

/* Date input groups with integrated labels */
.input-group {
    display: flex;
    align-items: center;
    border: 1px solid #dce1e6;
    border-radius: 8px;
    overflow: hidden;
    background: #fff;
    height: 48px; /* set overall height */
    margin-bottom: 16px;
}

.input-group-text {
    background: #f6f8fa;
    padding: 0 12px; /* vertical padding removed, fixed by height */
    font-weight: bold;
    color: #1a2b3c;
    border-right: 1px solid #dce1e6;
    display: flex;
    align-items: center;
    height: 100%; /* stretch full height */

}

.input-group input {
    flex: 1;
    border: none;
    outline: none;
    padding: 0 12px; /* keep only horizontal padding */
    font-size: 16px;
    height: 100%; /* stretch full height */
    line-height: 48px; /* vertical centering */
}

/* Remove the external labels for date inputs */
.form-group.date-group label {
    display: none;
}

/* On small screens, client on top alone, then dates side by side */
@media (max-width: 600px) {
    .form-row {
        flex-direction: column;
    }

    .form-group {
        width: 100%;
    }

    /* Special: keep dates on same line when stacked */
    .form-group:nth-child(2),
    .form-group:nth-child(3) {
        display: inline-flex;
        flex: 1;
    }

    .form-group:nth-child(2) {
        margin-right: 10px;
    }
}

.bold-option {
    font-weight: bold;
}

.select-container {
    display: flex;
    align-items: center;
    flex: 1;
    min-width: 200px;
    width: 100%;
    border-radius: 8px;
    margin-bottom: 15px;
}

.select-container .choices {
    width: 100% !important;
}

/* Choices.js customization */
.choices__inner {
    min-height: 48px !important;
    padding: 0 16px !important;
    font-size: 16px !important;
    border-radius: 8px !important;
    border: 2px solid #ddd !important;
    display: flex !important;
    align-items: center;
    background: white !important;
}

.required-field .choices__inner {
    border-color: #e74c3c !important;
    box-shadow: 0 0 0 3px rgba(231, 76, 60, 0.2) !important;
}

.choices__list--single {
    display: flex !important;
    align-items: center;
}

.choices__list--single .choices__item {
    color: #333 !important;
    font-weight: 600;
}

.choices[data-type*="select-one"]:after {
    right: 16px;
    border-color: #333 transparent transparent;
}

.choices__list--dropdown {
    border-radius: 8px !important;
    border: 2px solid #3498db !important;
    margin-top: 4px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    z-index: 999;
}

.choices__list--dropdown .choices__item--selectable {
    padding: 12px 16px !important;
    font-size: 16px;
}

.choices__list--dropdown .choices__item--selectable.is-highlighted {
    background-color: #3498db !important;
    color: white !important;
}

.choices__inner {
    min-height: 48px !important;
    padding: 0 16px !important;
    font-size: 16px !important;
    border-radius: 8px !important;
    border: 2px solid #ddd !important;
    display: flex !important;
    align-items: center !important;
    background: white !important;
}

.choices__list--single .choices__item {
    line-height: 1.2;
    font-weight: 600;
}

/* Form layout fixes */
.form-row {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
    align-items: flex-end;
}

.form-group {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-width: 200px;
}

label {
    display: block;
    font-weight: 600;
    margin-bottom: 8px;
    color: #2c3e50;
}

label[for="sel_client"]::after {
    content: " *";
    color: #e74c3c;
}

.attention .choices__inner {
    border-color: #e74c3c !important;
    box-shadow: 0 0 0 3px rgba(231, 76, 60, 0.2) !important;
}

/* Filter section */
.filter-section {
    display: flex;
    flex-direction: column;
    gap: 16px;
    margin-bottom: 20px;
}

/* Mobile-first styles */
.filter-row {
    display: flex;
    flex-direction: column;
    gap: 12px;
    width: 100%;
}

.filter-row .choices {
    width: 100% !important;
}

.filter-row .date-range {
    display: flex;
    flex-direction: row;
    gap: 12px;
}

.filter-row .date-input-group {
    flex: 1;
}

