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

:root {
    --primary-color: #0d6efd;
    --secondary-color: #6c757d;
    --success-color: #198754;
    --danger-color: #dc3545;
    --warning-color: #ffc107;
    --info-color: #0dcaf0;
    --light-color: #f8f9fa;
    --dark-color: #212529;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

main {
    flex: 1;
}

.header-custom {
    background: linear-gradient(135deg, var(--primary-color) 0%, #0a58ca 100%) !important;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    border-bottom: 3px solid rgba(255, 255, 255, 0.1);
}

.header-custom h1 {
    font-weight: 700;
    letter-spacing: 1px;
    animation: slideDown 0.6s ease-out;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.card {
    border-top: 3px solid var(--primary-color);
    transition: all 0.3s ease;
}

.card-header {
    font-weight: 600;
    border-bottom: 2px solid rgba(0, 0, 0, 0.1);
}

.nav-tabs {
    border-bottom: 2px solid #dee2e6;
}

.nav-tabs .nav-link {
    color: var(--secondary-color);
    border: none;
    border-bottom: 3px solid transparent;
    font-weight: 500;
    transition: all 0.3s ease;
}

.nav-tabs .nav-link:hover {
    border-bottom-color: var(--primary-color);
    color: var(--primary-color);
}

.nav-tabs .nav-link.active {
    background-color: transparent;
    color: var(--primary-color);
    border-bottom-color: var(--primary-color);
}

#inputSection .card-body h6 {
    color: var(--primary-color);
    font-weight: 600;
    border-bottom: 2px solid var(--primary-color);
    padding-bottom: 0.5rem;
}

.input-group {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    border-radius: .375rem;
}

.input-group .form-control,
.input-group .btn {
    border: 1px solid #dee2e6;
}

.form-control:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.2rem rgba(13, 110, 253, 0.15);
}

.btn {
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    transition: all 0.3s ease;
    border: none;
    border-radius: .375rem;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary-color) 0%, #0a58ca 100%);
}

.btn-primary:hover {
    background: linear-gradient(135deg, #0a58ca 0%, #004085 100%);
}

.btn-danger {
    background: linear-gradient(135deg, var(--danger-color) 0%, #bd2130 100%);
}

.btn-danger:hover {
    background: linear-gradient(135deg, #bd2130 0%, #a01c2a 100%);
}

.btn-success {
    background: linear-gradient(135deg, var(--success-color) 0%, #155724 100%);
}

.btn-success:hover {
    background: linear-gradient(135deg, #155724 0%, #0a3a1f 100%);
}

.btn-outline-primary:hover,
.btn-outline-success:hover,
.btn-outline-info:hover {
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.15);
}

.badge {
    padding: 0.5rem 0.75rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
}

.badge:hover {
    filter: brightness(1.1);
}

.alert {
    border: none;
    border-left: 4px solid;
    border-radius: .375rem;
    animation: slideIn 0.3s ease-out;
}

.alert-info {
    background-color: rgba(13, 202, 240, 0.1);
    border-left-color: var(--info-color);
    color: #004085;
}

.alert-secondary {
    background-color: rgba(108, 117, 125, 0.1);
    border-left-color: var(--secondary-color);
    color: #383d41;
}

.table {
    border-collapse: collapse;
}

.table thead th {
    font-weight: 700;
    text-transform: uppercase;
    font-size: 0.85rem;
    letter-spacing: 0.5px;
    vertical-align: middle;
    border-bottom: 2px solid #dee2e6;
}

.table tbody tr {
    transition: all 0.2s ease;
    border-bottom: 1px solid #dee2e6;
}

.table tbody tr:hover {
    background-color: rgba(13, 110, 253, 0.05);
}

.table tfoot tr {
    background-color: rgba(108, 117, 125, 0.1);
    font-weight: 600;
}

.table td,
.table th {
    padding: 1rem;
    vertical-align: middle;
}

#statisticsRow .card {
    border-top: 4px solid var(--primary-color);
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.95) 0%, rgba(248, 249, 250, 0.95) 100%);
}

#statisticsRow .card:nth-child(2) {
    border-top-color: var(--info-color);
}

#statisticsRow .card:nth-child(3) {
    border-top-color: var(--success-color);
}

#statisticsRow .card:nth-child(4) {
    border-top-color: var(--warning-color);
}

#statisticsRow .card-body {
    padding: 1.5rem;
}

#statisticsRow .card-body small {
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

footer {
    background: linear-gradient(135deg, var(--dark-color) 0%, #1a1d20 100%) !important;
    border-top: 2px solid rgba(255, 255, 255, 0.1);
    margin-top: auto;
}

@media (max-width: 768px) {
    .display-5 {
        font-size: 1.75rem;
    }

    .card {
        margin-bottom: 1rem;
    }

    .table {
        font-size: 0.9rem;
    }

    .table td,
    .table th {
        padding: 0.75rem;
    }

    .btn-group {
        flex-wrap: wrap;
        width: 100%;
    }

    .btn-group .btn {
        flex: 1;
        min-width: 100px;
        margin-bottom: 0.5rem;
    }
}

@media (max-width: 576px) {
    .container {
        padding: 0 0.5rem;
    }

    .btn-lg {
        padding: 0.5rem;
        font-size: 0.9rem;
    }

    .header-custom {
        padding: 1rem !important;
    }

    .d-flex.flex-wrap.gap-2 {
        gap: 0.5rem !important;
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

.d-none {
    animation: fadeOut 0.3s ease-out forwards;
}

@keyframes fadeOut {
    from {
        opacity: 1;
    }
    to {
        opacity: 0;
        display: none;
    }
}

.text-shadow {
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.1);
}

.smooth-transition {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 10px;
}

::-webkit-scrollbar-thumb {
    background: var(--primary-color);
    border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
    background: #0a58ca;
}

@media print {
    header,
    footer,
    .btn-group,
    .btn,
    .nav-tabs,
    main > .container > .row > .col-lg-8 > .d-flex,
    main > .container > .row > .col-lg-8 > .mt-4.text-center {
        display: none !important;
    }

    body {
        background: white;
    }

    .table {
        page-break-inside: avoid;
    }
}
