/* Fix for Font Awesome rotation and flip issues */
.fa-rotate-90 {
    -ms-filter: "progid:DXImageTransform.Microsoft.BasicImage(rotation=1)";
    filter: rotate(90deg);
}

.fa-rotate-180 {
    -ms-filter: "progid:DXImageTransform.Microsoft.BasicImage(rotation=2)";
    filter: rotate(180deg);
}

.fa-rotate-270 {
    -ms-filter: "progid:DXImageTransform.Microsoft.BasicImage(rotation=3)";
    filter: rotate(270deg);
}

.fa-flip-horizontal {
    -ms-filter: "progid:DXImageTransform.Microsoft.BasicImage(rotation=0, mirror=1)";
    filter: scaleX(-1);
}

.fa-flip-both,
.fa-flip-horizontal.fa-flip-vertical,
.fa-flip-vertical {
    -ms-filter: "progid:DXImageTransform.Microsoft.BasicImage(rotation=2, mirror=1)";
    filter: scaleY(-1);
}

/* Fix for text-size-adjust issue */
body {
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
}

/* Fix for table header alignment */
th {
    text-align: -webkit-match-parent;
    text-align: match-parent;
}

/* --- Modern UI Enhancements --- */
.card,
.shadow-card {
    box-shadow: 0 4px 24px rgba(44, 62, 80, 0.08);
    border-radius: 12px;
    background: #fff;
    border: none;
    transition: none !important;
    transform: none !important;
    box-shadow: none !important;
}

.card:hover,
.shadow-card:hover {
    box-shadow: 0 8px 32px rgba(44, 62, 80, 0.16);
    z-index: 2;
}

.table {
    background: #fff;
    border-radius: 0px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(44, 62, 80, 0.06);
}

.table th .table td {
    vertical-align: middle;
    padding: 0.85rem 1rem;
    font-size: 0.95rem !important;
}

.table thead th {
    background: #a8e6e5 !important;
    color: black !important;
    border: none;
    font-weight: 700 !important;
    letter-spacing: 0.5px;
}

.table-striped>tbody>tr:nth-of-type(odd) {
    background-color: #f4f8fb;
}

.btn {
    border-radius: 6px !important;
    font-weight: 600;
    letter-spacing: 0.5px;
    transition: box-shadow 0.2s, background 0.2s, transform 0.15s cubic-bezier(.4, 2, .3, 1);
}

.btn-primary {
    background: linear-gradient(90deg, #0cb8b6 0%, #3a8dde 100%);
    border: none;
}

.btn-primary:hover {
    background: linear-gradient(90deg, #3a8dde 0%, #0cb8b6 100%);
    box-shadow: 0 2px 8px rgba(44, 62, 80, 0.12);
}

.btn:active {
    transform: scale(0.96);
    box-shadow: 0 2px 8px rgba(44, 62, 80, 0.18);
}

.form-control,
.form-select {
    border-radius: 6px;
    border: 1px solid #ced4da;
    font-size: 1rem;
    padding: 0.7rem 1rem;
    background-color: #f8fafc;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.form-select {
    padding-right: 3rem;
}

.form-control:focus,
.form-select:focus {
    border-color: #3a8dde;
    box-shadow: 0 0 0 0.2rem rgba(58, 141, 222, 0.15);
    background: #fff;
}

input[type="checkbox"],
input[type="radio"] {
    accent-color: #0cb8b6;
}

.alert {
    border-radius: 8px;
    font-size: 1rem;
}

::-webkit-scrollbar {
    width: 8px;
    background: #f4f8fb;
}

::-webkit-scrollbar-thumb {
    background: #cce3f6;
    border-radius: 8px;
}

/* --- Advanced Animations --- */
.animate-fade-in {
    animation: fadeIn 0.8s cubic-bezier(.4, 2, .3, 1);
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: none;
    }
}

/* --- Tab Card Fixes for Active State --- */
.tab-card.active,
.tab-card.active * {
    color: #222 !important;
    background: #e0f7fa !important;
    font-weight: 700;
    box-shadow: 0 4px 16px rgba(44, 62, 80, 0.10);
    border-bottom: 3px solid #0cb8b6;
}

.table tr,
.table tr:hover,
.table td,
.table td:hover,
.table th,
.table th:hover {
    transition: none !important;
    transform: none !important;
    box-shadow: none !important;
}

.table th {
    text-align: center !important;
    font-weight: 700 !important;
}

.table,
.table th,
.table thead th {
    border-radius: 2px !important;
}

.history-table th,
.history-table td {
    font-size: 0.5rem !important;
    padding: 0.04rem 0.08rem !important;
}

.history-page,
.history-page>*,
.history-page .container,
.history-page .row,
.history-page .history-table,
.history-page table,
.history-page .table-responsive,
.history-page .table-responsive>table {
    margin-top: 0 !important;
    margin-bottom: 0 !important;
    padding-top: 0 !important;
    padding-bottom: 0 !important;
}

.history-page h1,
.history-page h2 {
    margin-top: 0.05rem !important;
    margin-bottom: 0.05rem !important;
    font-size: 1.1rem !important;
}

.history-page form,
.history-page .history-filters {
    margin-top: 0 !important;
    margin-bottom: 0 !important;
    padding-top: 0 !important;
    padding-bottom: 0 !important;
}

.history-page .mb-4,
.history-page .container-fluid,
.history-page .row,
.history-page .table-responsive,
.history-page .d-flex {
    margin-top: 0 !important;
    margin-bottom: 0 !important;
    padding-top: 0 !important;
    padding-bottom: 0 !important;
}

.history-page .table th,
.history-page .table td {
    padding: 0 !important;
    margin: 0 !important;
    line-height: 1 !important;
    min-height: 0 !important;
    height: 0.8em !important;
    vertical-align: middle !important;
    font-size: 0.5rem !important;
    box-sizing: border-box !important;
    display: block !important;
}

.history-page .table tr {
    height: 0.8em !important;
    min-height: 0 !important;
    padding: 0 !important;
    margin: 0 !important;
}

.history-table-tight th,
.history-table-tight td {
    padding: 0 !important;
    font-size: 0.45rem !important;
    line-height: 0.8 !important;
    height: 0.8em !important;
    min-height: 0 !important;
    vertical-align: middle !important;
    border-top-width: 1px !important;
    border-bottom-width: 1px !important;
    box-sizing: border-box !important;
}

.history-table-tight tr {
    height: 0.8em !important;
    min-height: 0 !important;
}

.history-table-tight {
    border-spacing: 0 !important;
    border-collapse: collapse !important;
}

.history-table-tight th,
.history-page .table th {
    background: #e0f7fa !important;
    color: #111 !important;
    font-weight: 700 !important;
    border: 1px solid #b2ebf2 !important;
}

#more h6,
#more .section-title {
    font-weight: bold !important;
    text-decoration: none !important;
}

#more h6 a.btn,
#more h6 a.btn-primary,
#more h6 a,
#more .section-title a.btn,
#more .section-title a.btn-primary,
#more .section-title a {
    text-decoration: none !important;
    font-weight: normal !important;
    color: #222 !important;
}

#more h5 {
    text-decoration: none !important;
}

/* View button as blue (#2196F3) */
.table .btn-info,
.btn-info,
#more .table .btn-info,
#more .btn-info,
.table .btn-info:not(.btn-outline-info),
.btn-info:not(.btn-outline-info) {
    background: #2196F3 !important;
    color: black !important;
    border-color: #2196F3 !important;
    box-shadow: none !important;
}

/* Download button as blue */
.table .btn-success,
.btn-success,
#more .table .btn-success,
#more .btn-success {
    background-color: #007bff !important;
    color: #0f0000 !important;
    border-color: #007bff !important;
    box-shadow: none !important;
}

/* Light Green Download Button */
.btn-download {
    background-color: #b2f2bb;
    color: black;
    border: 1px solid #8ce99a;
    padding: 6px 14px;
    border-radius: 6px;
    font-weight: 600;
    text-decoration: none;
    font-size: 12px;
}

.btn-download:hover {
    background-color: #8ce99a;
    color: black;
}

/* Black Back Button */
.btn-back {
    background-color: black;
    color: white;
    border: 1px solid #000;
    padding: 6px 14px;
    border-radius: 6px;
    font-weight: 600;
    text-decoration: none;
    font-size: 12px;
}

.btn-back:hover {
    background-color: #333;
    color: white;
}