/* BizAi Theme Colors */
:root {
    --bizai-primary: #1a237e;
    --bizai-secondary: #283593;
    --bizai-accent: #3949ab;
    --bizai-light: #e8eaf6;
    --bizai-hover: #0d47a1;
    --bizai-success: #2e7d32;
    --bizai-success-hover: #1b5e20;
    --bizai-danger: #dc3545;
    --bizai-danger-hover: #c82333;
    --bizai-warning: #ffc107;
    --bizai-warning-hover: #e0a800;
    --bizai-info: #17a2b8;
    --bizai-info-hover: #138496;
    --bizai-nav-link: #c5cae9;
    --bizai-nav-link-hover: #e8eaf6;
    --bizai-table-header: #3949ab;
    --bizai-table-hover: #f8f9ff;
    --bizai-table-stripe: #ffffff;
    --bizai-table-border: #e8eaf6;
}

/* Links */
a:not(.btn):not(.nav-link):not(.brand-link) {
    color: var(--bizai-primary) !important;
    text-decoration: none;
    transition: all 0.2s ease;
}

a:not(.btn):not(.nav-link):not(.brand-link):hover {
    color: var(--bizai-hover) !important;
    text-decoration: underline;
}

/* Bootstrap 4.6.2 button overrides */
.btn {
    font-weight: 400;
    transition: color .15s ease-in-out,background-color .15s ease-in-out,border-color .15s ease-in-out,box-shadow .15s ease-in-out;
}

/* Primary buttons */
.btn-primary {
    background-color: var(--bizai-primary) !important;
    border-color: var(--bizai-primary) !important;
    color: #fff !important;
}

.btn-primary:hover, .btn-primary:focus, .btn-primary:active {
    background-color: var(--bizai-hover) !important;
    border-color: var(--bizai-hover) !important;
    color: #fff !important;
}

.btn-outline-primary {
    color: var(--bizai-primary) !important;
    border-color: var(--bizai-primary) !important;
    background-color: transparent !important;
}

.btn-outline-primary:hover, .btn-outline-primary:focus, .btn-outline-primary:active {
    background-color: var(--bizai-primary) !important;
    color: #fff !important;
}

/* Success buttons */
.btn-success {
    background-color: var(--bizai-success) !important;
    border-color: var(--bizai-success) !important;
    color: #fff !important;
}

.btn-success:hover, .btn-success:focus, .btn-success:active {
    background-color: var(--bizai-success-hover) !important;
    border-color: var(--bizai-success-hover) !important;
}

.btn-outline-success {
    color: var(--bizai-success) !important;
    border-color: var(--bizai-success) !important;
    background-color: transparent !important;
}

.btn-outline-success:hover, .btn-outline-success:focus, .btn-outline-success:active {
    background-color: var(--bizai-success) !important;
    color: #fff !important;
}

/* Danger buttons */
.btn-danger {
    background-color: var(--bizai-danger) !important;
    border-color: var(--bizai-danger) !important;
    color: #fff !important;
}

.btn-danger:hover, .btn-danger:focus, .btn-danger:active {
    background-color: var(--bizai-danger-hover) !important;
    border-color: var(--bizai-danger-hover) !important;
}

.btn-outline-danger {
    color: var(--bizai-danger) !important;
    border-color: var(--bizai-danger) !important;
    background-color: transparent !important;
}

.btn-outline-danger:hover, .btn-outline-danger:focus, .btn-outline-danger:active {
    background-color: var(--bizai-danger) !important;
    color: #fff !important;
}

/* Warning buttons */
.btn-warning {
    background-color: var(--bizai-warning) !important;
    border-color: var(--bizai-warning) !important;
    color: #212529 !important;
}

.btn-warning:hover, .btn-warning:focus, .btn-warning:active {
    background-color: var(--bizai-warning-hover) !important;
    border-color: var(--bizai-warning-hover) !important;
}

.btn-outline-warning {
    color: var(--bizai-warning) !important;
    border-color: var(--bizai-warning) !important;
    background-color: transparent !important;
}

.btn-outline-warning:hover, .btn-outline-warning:focus, .btn-outline-warning:active {
    background-color: var(--bizai-warning) !important;
    color: #212529 !important;
}

/* Info buttons */
.btn-info {
    background-color: var(--bizai-info) !important;
    border-color: var(--bizai-info) !important;
    color: #fff !important;
}

.btn-info:hover, .btn-info:focus, .btn-info:active {
    background-color: var(--bizai-info-hover) !important;
    border-color: var(--bizai-info-hover) !important;
}

.btn-outline-info {
    color: var(--bizai-info) !important;
    border-color: var(--bizai-info) !important;
    background-color: transparent !important;
}

.btn-outline-info:hover, .btn-outline-info:focus, .btn-outline-info:active {
    background-color: var(--bizai-info) !important;
    color: #fff !important;
}

/* Disabled state */
.btn:disabled, .btn.disabled {
    opacity: 0.65;
    pointer-events: none;
}

/* Button sizes */
.btn-lg {
    padding: 0.5rem 1rem;
    font-size: 1.25rem;
    line-height: 1.5;
    border-radius: 0.3rem;
}

.btn-sm {
    padding: 0.25rem 0.5rem;
    font-size: 0.875rem;
    line-height: 1.5;
    border-radius: 0.2rem;
}

/* Table styles */
.table {
    border-color: var(--bizai-table-border);
    background-color: white;
}

/* Nagłówki tabel */
.table thead th,
.table-striped thead th,
.table-bordered thead th,
.table-striped.table-bordered thead th {
    background-color: var(--bizai-table-header);
    color: white !important;
    border-bottom: 1px solid var(--bizai-table-border);
    vertical-align: middle;
    font-weight: 500;
}

/* Linki w nagłówkach - nadpisanie domyślnych styli */
.table thead th a,
.table-striped thead th a,
.table-bordered thead th a,
.table-striped.table-bordered thead th a,
.table thead th a:not(.btn):not(.nav-link):not(.brand-link),
.table-striped thead th a:not(.btn):not(.nav-link):not(.brand-link),
.table-bordered thead th a:not(.btn):not(.nav-link):not(.brand-link),
.table-striped.table-bordered thead th a:not(.btn):not(.nav-link):not(.brand-link) {
    color: white !important;
    text-decoration: none;
    transition: all 0.2s ease;
}

.table thead th a:hover,
.table-striped thead th a:hover,
.table-bordered thead th a:hover,
.table-striped.table-bordered thead th a:hover,
.table thead th a:not(.btn):not(.nav-link):not(.brand-link):hover,
.table-striped thead th a:not(.btn):not(.nav-link):not(.brand-link):hover,
.table-bordered thead th a:not(.btn):not(.nav-link):not(.brand-link):hover,
.table-striped.table-bordered thead th a:not(.btn):not(.nav-link):not(.brand-link):hover {
    color: var(--bizai-nav-link) !important;
    text-decoration: none;
    opacity: 0.9;
}

.table-striped tbody tr:nth-of-type(odd) {
    background-color: var(--bizai-table-stripe);
}

.table-striped tbody tr:nth-of-type(even) {
    background-color: var(--bizai-light);
}

.table-hover tbody tr:hover {
    background-color: var(--bizai-table-hover);
}

.table td {
    border-top: 1px solid var(--bizai-table-border);
    vertical-align: middle;
    padding: 0.75rem;
    color: #333;
}

/* List group styles */
.list-group-item {
    border-color: var(--bizai-table-border);
    background-color: white;
}

.list-group-item:hover {
    background-color: var(--bizai-table-hover);
}

.list-group-item.active {
    background-color: var(--bizai-accent);
    border-color: var(--bizai-accent);
}

/* Card styles */
.card {
    border-color: var(--bizai-table-border);
    background-color: white;
}

.card-header {
    background-color: white;
    border-bottom: 1px solid var(--bizai-table-border);
    font-weight: 500;
}

/* Dropdown styles update */
.dropdown-menu {
    border-color: var(--bizai-table-border);
}

.dropdown-item:hover {
    background-color: var(--bizai-table-hover);
}

.dropdown-item.active, .dropdown-item:active {
    background-color: var(--bizai-primary);
    color: white;
}

/* Form control borders */
.form-control {
    border-color: var(--bizai-table-border);
}

.form-control:focus {
    border-color: var(--bizai-primary);
    box-shadow: 0 0 0 0.2rem rgba(26, 35, 126, 0.15);
}

/* Sidebar menu styles */
.nav-sidebar .nav-item > .nav-link {
    color: var(--bizai-nav-link) !important;
    transition: all 0.3s ease;
}

.nav-sidebar .nav-item > .nav-link:hover {
    background-color: rgba(255,255,255,0.1) !important;
    color: var(--bizai-nav-link-hover) !important;
}

.nav-sidebar .nav-item > .nav-link.active {
    background-color: rgba(255,255,255,0.2) !important;
    color: white !important;
    font-weight: 500;
}

.nav-treeview > .nav-item > .nav-link {
    color: var(--bizai-nav-link) !important;
    padding-left: 1rem;
}

.nav-treeview > .nav-item > .nav-link:hover {
    color: var(--bizai-nav-link-hover) !important;
}

.nav-treeview > .nav-item > .nav-link.active {
    background-color: rgba(255,255,255,0.2) !important;
    color: white !important;
}

/* Pagination */
.page-item.active .page-link {
    background-color: var(--bizai-primary) !important;
    border-color: var(--bizai-primary) !important;
}

.page-link {
    color: var(--bizai-primary);
}

.page-link:hover {
    color: var(--bizai-hover);
}

/* Alert styles */
.alert-primary {
    background-color: var(--bizai-light);
    border-color: var(--bizai-primary);
    color: var(--bizai-primary);
}

/* Badge styles */
.badge-primary {
    background-color: var(--bizai-primary) !important;
}

/* Progress bar */
.progress-bar {
    background-color: var(--bizai-primary);
}

/* Custom sidebar styles */
.sidebar-dark-primary {
    background-color: var(--bizai-primary) !important;
}

.sidebar-dark-primary .nav-sidebar > .nav-item > .nav-link.active {
    background-color: rgba(255,255,255,0.1) !important;
}

/* Logo switching styles */
.brand-image-expanded {
    display: block !important;
}

.brand-image-collapsed {
    display: none !important;
}

body.sidebar-collapse .brand-image-expanded {
    display: none !important;
}

body.sidebar-collapse .brand-image-collapsed {
    display: block !important;
}

/* Adjust collapsed sidebar brand-link padding */
body.sidebar-collapse .brand-link {
    padding: 0.3rem !important;
}

/* Login form styles */
.login-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--bizai-light) 0%, #ffffff 100%);
}

.login-box {
    width: 360px;
}

.login-box .card {
    box-shadow: 0 0 20px rgba(26, 35, 126, 0.1);
    border: none;
    border-radius: 10px;
    transition: all 0.3s ease;
}

.login-box .card:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 30px rgba(26, 35, 126, 0.15);
}

.login-card-body {
    padding: 2rem;
}

.login-logo {
    max-height: 50px;
    margin-bottom: 1.5rem;
    filter: drop-shadow(0 2px 5px rgba(0,0,0,0.1));
}

.login-box .form-control {
    height: calc(2.5rem + 2px);
    border-radius: 5px;
    border-color: var(--bizai-table-border);
}

.login-box .form-control:focus {
    border-color: var(--bizai-primary);
    box-shadow: 0 0 0 0.2rem rgba(26, 35, 126, 0.15);
}

.login-box .form-control::placeholder {
    color: #9fa8da;
    opacity: 0.8;
}

.login-box .btn-primary {
    height: calc(2.5rem + 2px);
    border-radius: 5px;
    font-weight: 500;
}

/* Custom checkbox */
.bizai-checkbox {
    position: relative;
    padding-left: 1.5rem;
}

.bizai-checkbox input[type="checkbox"] {
    position: absolute;
    opacity: 0;
    cursor: pointer;
}

.bizai-checkbox input[type="checkbox"] + label {
    position: relative;
    cursor: pointer;
    padding: 0;
    color: #495057;
}

.bizai-checkbox input[type="checkbox"] + label:before {
    content: '';
    margin-right: 10px;
    display: inline-block;
    vertical-align: text-top;
    width: 18px;
    height: 18px;
    background: white;
    border: 1px solid var(--bizai-table-border);
    border-radius: 3px;
    transition: all 0.3s ease;
}

.bizai-checkbox input[type="checkbox"]:hover + label:before {
    border-color: var(--bizai-primary);
}

.bizai-checkbox input[type="checkbox"]:checked + label:before {
    background: var(--bizai-primary);
    border-color: var(--bizai-primary);
}

.bizai-checkbox input[type="checkbox"]:checked + label:after {
    content: '';
    position: absolute;
    left: 4px;
    top: 9px;
    background: white;
    width: 2px;
    height: 2px;
    box-shadow: 2px 0 0 white, 4px 0 0 white, 4px -2px 0 white, 4px -4px 0 white, 4px -6px 0 white, 4px -8px 0 white;
    transform: rotate(45deg);
}

/* Sidebar project selector */
.form-control-sidebar {
    background-color: rgba(255,255,255,0.1) !important;
    border: none !important;
    color: white !important;
}

.form-control-sidebar option {
    background-color: white;
    color: var(--bizai-primary);
    padding: 8px;
}

.form-control-sidebar:focus {
    background-color: rgba(255,255,255,0.2) !important;
    border: none !important;
    box-shadow: none !important;
}

/* Alert box styles */
.alert {
    border-radius: 8px;
    border: none;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.alert-info {
    background-color: var(--bizai-light);
    color: var(--bizai-primary);
    border-left: 4px solid var(--bizai-primary);
}

.alert-info .alert-link {
    color: var(--bizai-primary);
    text-decoration: underline;
    font-weight: 500;
}

.alert-info .alert-link:hover {
    color: var(--bizai-hover);
    text-decoration: none;
}

.alert .alert-title {
    font-weight: 600;
    margin-bottom: 0.5rem;
}

/* Admin provider management styles */
.provider-admin-controls {
    border-left: 3px solid var(--bizai-warning);
    padding-left: 0.75rem;
    margin-top: 0.5rem;
}

.btn.admin-action {
    position: relative;
    overflow: hidden;
}

.btn.admin-action::before {
    content: '\f521'; /* FontAwesome crown icon */
    font-family: "Font Awesome 5 Free";
    font-weight: 900;
    margin-right: 0.25rem;
    font-size: 0.75em;
}

.provider-buttons-group {
    display: flex;
    gap: 0.375rem;
    flex-wrap: wrap;
    align-items: center;
}

.provider-buttons-group .btn {
    flex-shrink: 0;
}

/* Enhanced tooltips for admin actions */
.admin-tooltip {
    position: relative;
}

.admin-tooltip::after {
    content: attr(title);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    background: var(--bizai-primary);
    color: white;
    padding: 0.25rem 0.5rem;
    border-radius: 0.25rem;
    font-size: 0.75rem;
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s, visibility 0.2s;
    z-index: 1000;
}

.admin-tooltip:hover::after {
    opacity: 1;
    visibility: visible;
}

/* Organization index provider stats styles */
.provider-stats {
    min-height: 60px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.provider-stats .badge {
    margin-bottom: 0.25rem;
    font-size: 0.75em;
}

.provider-stats small {
    line-height: 1.3;
    max-width: 180px;
    word-wrap: break-word;
}

/* Organization table improvements */
.table-primarycolor-actions th {
    background-color: var(--bizai-table-header);
    color: white;
    font-weight: 500;
    border-bottom: 2px solid var(--bizai-primary);
}

.table-primarycolor-actions td {
    vertical-align: middle;
    padding: 0.75rem 0.5rem;
}

.table-primarycolor-actions .btn-xs {
    padding: 0.125rem 0.5rem;
    font-size: 0.75rem;
    margin: 0.125rem;
}

/* Provider management buttons in organization list */
.provider-management-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem;
    margin-top: 0.5rem;
}

/* ===== REPORTS WIDGETS STYLING ===== */

/* Widget container improvements */
.reports-widget {
    transition: all 0.3s ease;
    border: 1px solid rgba(0,0,0,0.08);
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 4px rgba(0,0,0,0.04);
}

.reports-widget:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    border-color: var(--bizai-accent);
}

/* Widget header styling */
.reports-widget .card-header {
    background: linear-gradient(135deg, var(--bizai-primary) 0%, var(--bizai-secondary) 100%);
    border-bottom: none;
    padding: 1rem 1.25rem;
    position: relative;
    overflow: hidden;
    text-align: left;
}

/* Widget header title styling */
.reports-widget .card-header .widget-header-title {
    color: #ffffff !important;
    font-size: 14px !important;
    font-weight: 500;
    margin: 0;
    padding: 0;
    line-height: 1.4;
    display: block;
    text-align: left;
}

/* Dodatkowa specyficzność dla pewności - nadpisanie Bootstrap/AdminLTE */
.card-header .widget-header-title,
.widget-header-title,
span.widget-header-title,
.reports-widget span.widget-header-title,
.card .card-header .widget-header-title {
    color: #ffffff !important;
    text-shadow: none !important;
}

.reports-widget .card-header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(45deg, transparent 30%, rgba(255,255,255,0.1) 50%, transparent 70%);
    animation: shimmer 3s infinite;
}

@keyframes shimmer {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

.reports-widget .card-title {
    color: white !important;
    font-weight: 600;
    font-size: 1.1rem;
    margin-bottom: 0.25rem;
    text-shadow: 0 1px 2px rgba(0,0,0,0.2);
}

.reports-widget .card-header small {
    color: var(--bizai-light) !important;
    font-size: 0.85rem;
    opacity: 0.9;
}

.reports-widget .card-header .fas,
.reports-widget .card-header .far {
    color: var(--bizai-light);
    margin-right: 0.5rem;
    font-size: 1.2rem;
}

/* Widget body styling */
.reports-widget .card-body {
    padding: 1.5rem 1.25rem;
    background: #ffffff;
}

/* Chart container improvements */
.reports-chart-container {
    position: relative;
    margin-bottom: 1.5rem;
    border-radius: 6px;
    overflow: hidden;
    background: #fafbfc;
    border: 1px solid #e9ecef;
}

.reports-chart-container::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--bizai-primary), var(--bizai-accent), var(--bizai-secondary));
    z-index: 1;
}

/* Table styling for widgets */
.reports-widget .table {
    margin-bottom: 0;
    font-size: 0.9rem;
}

.reports-widget .table thead th {
    background-color: var(--bizai-light);
    color: var(--bizai-primary);
    font-weight: 600;
    border-bottom: 2px solid var(--bizai-primary);
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 0.75rem 0.5rem;
}

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

.reports-widget .table tbody tr:hover {
    background-color: var(--bizai-table-hover);
}

.reports-widget .table tbody td {
    padding: 0.75rem 0.5rem;
    vertical-align: middle;
    border-top: 1px solid var(--bizai-table-border);
}

/* Loading and error states */
.reports-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 200px;
    color: var(--bizai-secondary);
}

.reports-loading .spinner-border {
    color: var(--bizai-primary);
}

.reports-error {
    text-align: center;
    padding: 2rem;
    color: var(--bizai-danger);
}

/* Static widget specific styles */
.static-widget-info {
    background: linear-gradient(135deg, var(--bizai-info) 0%, #20c997 100%);
    border: none;
    color: white;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(23, 162, 184, 0.2);
}

.static-widget-info .fas {
    color: rgba(255,255,255,0.9);
}

/* Responsive improvements */
@media (max-width: 768px) {
    .reports-widget .card-header {
        padding: 0.75rem 1rem;
    }
    
    .reports-widget .card-body {
        padding: 1rem;
    }
    
    .reports-widget .card-title {
        font-size: 1rem;
    }
    
    .reports-chart-container {
        margin-bottom: 1rem;
    }
}

/* Chart specific improvements */
.reports-pie-chart {
    min-height: 120px;
    position: relative;
}

.reports-column-chart {
    min-height: 100px;
    position: relative;
}

.reports-line-chart {
    min-height: 80px;
    position: relative;
}

/* Compact widget layout for time period comparisons */
.reports-widget-compact {
    margin-bottom: 0.75rem;
}

.reports-widget-compact .card-body {
    padding: 0.75rem;
}

.reports-widget-compact .card-header {
    padding: 0.75rem 1rem;
}

.reports-widget-compact .card-title {
    font-size: 1rem;
    margin-bottom: 0.1rem;
}

.reports-widget-compact .card-header small {
    font-size: 0.75rem;
}

.reports-widget-compact .table {
    font-size: 0.85rem;
    margin-bottom: 0;
}

.reports-widget-compact .table th,
.reports-widget-compact .table td {
    padding: 0.35rem 0.5rem;
    vertical-align: middle;
    line-height: 1.2;
}

.reports-widget-compact .table th {
    font-size: 0.8rem;
    font-weight: 700;
    line-height: 1.2;
    padding: 0.3rem 0.4rem;
    color: #343a40;
}

.reports-widget-compact .table small {
    font-size: 0.72rem;
    line-height: 1.1;
    display: inline;
    margin-left: 4px;
    color: #6c757d;
    font-weight: 500;
}

.reports-widget-compact .table th small {
    color: #495057;
    font-weight: 600;
    display: block;
    margin-left: 0;
    margin-top: 2px;
}

/* Wyróżnienie głównych liczb w komórkach */
.reports-widget-compact .table td {
    font-weight: 600;
    color: #212529;
}

/* Pierwsza kolumna - nazwy odpowiedzi */
.reports-widget-compact .table td:first-child,
.reports-widget-compact .table th:first-child {
    font-weight: 700 !important;
    background-color: #dee2e6 !important;
    border-right: 2px solid #ced4da !important;
}

/* Dodatkowa specyficzność dla pierwszej kolumny */
.card.reports-widget-compact .table td:first-child,
.card.reports-widget-compact .table th:first-child {
    background-color: #dee2e6 !important;
    border-right: 2px solid #ced4da !important;
}

/* Bardzo specyficzny selektor dla pierwszej kolumny */
.reports-widget.reports-widget-compact .card-body .table-responsive .table.table-sm td:first-child,
.reports-widget.reports-widget-compact .card-body .table-responsive .table.table-sm th:first-child {
    background-color: #dee2e6 !important;
    border-right: 2px solid #ced4da !important;
    font-weight: 700 !important;
}

/* Nadrzędny selektor dla pierwszej kolumny - nadpisuje globalne style tabeli */
.reports-widget-compact .table.table-sm thead th:first-child,
.reports-widget-compact .table-striped.table-sm thead th:first-child,
.reports-widget-compact .table-bordered.table-sm thead th:first-child,
.reports-widget-compact .table-striped.table-bordered.table-sm thead th:first-child {
    background-color: #dee2e6 !important;
    color: #343a40 !important;
    border-right: 2px solid #ced4da !important;
    font-weight: 700 !important;
}

.reports-widget-compact .table.table-sm tbody td:first-child,
.reports-widget-compact .table-striped.table-sm tbody td:first-child,
.reports-widget-compact .table-bordered.table-sm tbody td:first-child,
.reports-widget-compact .table-striped.table-bordered.table-sm tbody td:first-child {
    background-color: #dee2e6 !important;
    color: #212529 !important;
    border-right: 2px solid #ced4da !important;
    font-weight: 700 !important;
}

/* Kolumna "Razem" - bardziej wyróżniona */
.reports-widget-compact .table td:last-child,
.reports-widget-compact .table th:last-child {
    font-weight: 700;
    background-color: #e9ecef;
    border-left: 2px solid #dee2e6;
}

/* Kompaktowe wykresy - ukryj zbędne elementy */
.reports-widget-compact .chart-item div[id*="chart"] {
    overflow: hidden;
}

/* Wykresy w nagłówkach tabeli */
.reports-widget-compact .charts-row {
    background: #f8f9fa;
    border-bottom: 2px solid #dee2e6;
}

.reports-widget-compact .chart-cell {
    padding: 1rem 0.3rem;
    vertical-align: middle;
    border-bottom: none;
    height: 240px;
}

.reports-widget-compact .chart-cell div[id*="chart"] {
    overflow: hidden;
    border-radius: 4px;
}

/* Tooltips dla małych wykresów */
.reports-widget-compact .am5-tooltip-container {
    font-size: 10px !important;
}

/* Lepsza legenda dla małych wykresów */
.reports-widget-compact .am5-legend-label {
    font-size: 8px !important;
    line-height: 1.2 !important;
}

.reports-widget-compact .am5-legend-marker {
    margin-right: 3px !important;
}

.reports-chart-comparison {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
    justify-content: space-between;
    align-items: flex-start;
}

.reports-chart-comparison .chart-item {
    flex: 1;
    min-width: 0;
    max-width: 140px;
    text-align: center;
}

/* Nowe style dla kompaktowego układu */
.chart-date-header {
    text-align: center;
    margin-bottom: 0.5rem;
    color: white;
    font-weight: 600;
    font-size: 0.8rem;
    padding: 0.4rem 0.6rem;
    background: linear-gradient(135deg, var(--bizai-primary), var(--bizai-secondary));
    border-radius: 6px;
    box-shadow: 0 1px 2px rgba(0,0,0,0.1);
    text-shadow: 0 1px 1px rgba(0,0,0,0.2);
}

.chart-summary {
    text-align: center;
    margin-top: 0.3rem;
    font-weight: 500;
    font-size: 0.7rem;
    color: var(--bizai-secondary);
}

/* Responsive chart comparison */
@media (max-width: 1200px) {
    .reports-chart-comparison {
        flex-wrap: wrap;
        gap: 0.75rem;
    }
    
    .reports-chart-comparison .chart-item {
        flex: 0 1 calc(50% - 0.375rem);
        max-width: none;
        margin-bottom: 0.5rem;
    }
}

@media (max-width: 992px) {
    .reports-chart-comparison {
        gap: 1rem;
    }
    
    .reports-chart-comparison .chart-item {
        flex: 0 1 calc(50% - 0.5rem);
        max-width: none;
    }
}

@media (max-width: 768px) {
    .reports-chart-comparison {
        flex-direction: column;
        gap: 0.5rem;
        align-items: center;
    }
    
    .reports-chart-comparison .chart-item {
        max-width: 250px;
        width: 100%;
    }
    
    .reports-chart-comparison .chart-item h6 {
        font-size: 0.85rem;
        margin-bottom: 0.5rem;
        padding: 0.3rem 0.5rem;
    }
}

.provider-management-buttons .btn {
    white-space: nowrap;
}

/* ========================================
   MEASURES TABLES STYLING (Widget #3 & #4)
   ======================================== */

/* Base measures table styling */
.measures-table {
  font-size: 0.9rem !important;
  border-collapse: separate !important;
  border-spacing: 0 !important;
}

.measures-table th {
  background: linear-gradient(135deg, #495057 0%, #6c757d 100%) !important;
  color: white !important;
  font-weight: 600 !important;
  padding: 0.7rem 1rem !important;
  border: none !important;
  text-align: center !important;
  font-size: 0.85rem !important;
  text-transform: uppercase !important;
  letter-spacing: 0.5px !important;
}

.measures-table td {
  padding: 0.5rem 1rem !important;
  vertical-align: middle !important;
  border: none !important;
  border-bottom: 1px solid #f1f3f4 !important;
}

/* Date column - first column */
.measures-table .date-cell {
  background: linear-gradient(135deg, #e3f2fd 0%, #f8f9fa 100%) !important;
  font-weight: 700 !important;
  color: #1565c0 !important;
  border-right: 3px solid #2196f3 !important;
  width: 130px !important;
  vertical-align: top !important;
  text-align: center !important;
  font-size: 0.85rem !important;
}

/* Measure name column */
.measures-table .measure-cell {
  background-color: #ffffff !important;
  padding-left: 2rem !important;
  font-weight: 500 !important;
  color: #495057 !important;
  border-right: 1px solid #f1f3f4 !important;
  position: relative !important;
}

.measures-table .measure-cell::before {
  content: "▸" !important;
  position: absolute !important;
  left: 1rem !important;
  color: #6c757d !important;
  font-size: 0.8rem !important;
}

/* Value column */
.measures-table .value-cell {
  background-color: #ffffff !important;
  text-align: center !important;
  font-weight: 600 !important;
  color: #212529 !important;
  min-width: 100px !important;
  font-size: 0.95rem !important;
}

/* Daily sum rows - blue theme */
.measures-table .daily-sum-row td {
  background: linear-gradient(135deg, #e1f5fe 0%, #e3f2fd 100%) !important;
  font-weight: 700 !important;
  color: #0d47a1 !important;
  border-top: 2px solid #2196f3 !important;
  border-bottom: 2px solid #2196f3 !important;
}

.measures-table .daily-sum-row .date-cell {
  background: linear-gradient(135deg, #bbdefb 0%, #e1f5fe 100%) !important;
  color: #0d47a1 !important;
}

.measures-table .daily-sum-row .measure-cell {
  background: linear-gradient(135deg, #e1f5fe 0%, #e3f2fd 100%) !important;
  font-style: italic !important;
  color: #0d47a1 !important;
}

.measures-table .daily-sum-row .measure-cell::before {
  content: "Σ" !important;
  color: #1976d2 !important;
  font-weight: 700 !important;
}

/* Grand total rows - green theme */
.measures-table .grand-total-row td {
  background: linear-gradient(135deg, #e8f5e8 0%, #f1f8e9 100%) !important;
  font-weight: 700 !important;
  color: #1b5e20 !important;
  border-top: 2px solid #4caf50 !important;
  border-bottom: 1px solid #4caf50 !important;
}

.measures-table .grand-total-row .date-cell {
  background: linear-gradient(135deg, #c8e6c9 0%, #e8f5e8 100%) !important;
  color: #1b5e20 !important;
}

.measures-table .grand-total-row .measure-cell {
  background: linear-gradient(135deg, #e8f5e8 0%, #f1f8e9 100%) !important;
  color: #1b5e20 !important;
}

.measures-table .grand-total-row .measure-cell::before {
  content: "∑" !important;
  color: #2e7d32 !important;
  font-weight: 700 !important;
}

/* Final total row - orange theme */
.measures-table .final-total-row td {
  background: linear-gradient(135deg, #fff3e0 0%, #ffe0b2 100%) !important;
  font-weight: 800 !important;
  color: #e65100 !important;
  border-top: 3px solid #ff9800 !important;
  border-bottom: 3px solid #ff9800 !important;
  font-size: 1rem !important;
}

.measures-table .final-total-row .date-cell {
  background: linear-gradient(135deg, #ffcc02 0%, #fff3e0 100%) !important;
  color: #e65100 !important;
}

.measures-table .final-total-row .measure-cell {
  background: linear-gradient(135deg, #fff3e0 0%, #ffe0b2 100%) !important;
  color: #e65100 !important;
}

.measures-table .final-total-row .measure-cell::before {
  content: "★" !important;
  color: #ff6f00 !important;
  font-weight: 700 !important;
}

/* Separators */
.measures-table .day-separator {
  height: 8px !important;
  background: linear-gradient(90deg, transparent 0%, #e9ecef 50%, transparent 100%) !important;
  border: none !important;
}

.measures-table .section-separator {
  height: 16px !important;
  background: linear-gradient(90deg, transparent 0%, #dee2e6 50%, transparent 100%) !important;
  border: none !important;
}

/* ===== MODAL STYLING FOR REPORTS CONFIGURATION ===== */

/* Modal header styling */
.modal-header {
    background: linear-gradient(135deg, var(--bizai-primary) 0%, var(--bizai-secondary) 100%);
    border-bottom: none;
    color: white;
    padding: 1.25rem 1.5rem;
}

.modal-header .modal-title {
    color: white !important;
    font-weight: 600;
    font-size: 1.1rem;
}

.modal-header .btn-close {
    filter: invert(1) grayscale(100%) brightness(200%);
    opacity: 1 !important;
    width: 2rem !important;
    height: 2rem !important;
    background-size: 1.2rem !important;
    border: 1px solid rgba(255, 255, 255, 0.3) !important;
    padding: 0 !important;
    margin: 0 !important;
    border-radius: 4px !important;
    background-color: rgba(255, 255, 255, 0.1) !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
}

.modal-header .btn-close:hover {
    opacity: 1 !important;
    background-color: rgba(255, 255, 255, 0.2) !important;
    border-color: rgba(255, 255, 255, 0.5) !important;
    transform: scale(1.05);
}

.modal-header .btn-close:focus {
    box-shadow: 0 0 0 0.25rem rgba(255, 255, 255, 0.25) !important;
}

/* Modal body styling */
.modal-body {
    padding: 1.5rem;
    background-color: #f8f9fa;
    max-height: 70vh; /* Ograniczenie wysokości do 70% wysokości ekranu */
    overflow-y: auto; /* Dodanie scroll pionowego gdy potrzebne */
}

/* Stylowanie scrollbara w modal-body */
.modal-body::-webkit-scrollbar {
    width: 8px;
}

.modal-body::-webkit-scrollbar-track {
    background: #e9ecef;
    border-radius: 4px;
}

.modal-body::-webkit-scrollbar-thumb {
    background: var(--bizai-primary);
    border-radius: 4px;
}

.modal-body::-webkit-scrollbar-thumb:hover {
    background: var(--bizai-hover);
}

.modal-body h6.fw-bold {
    color: var(--bizai-primary);
    font-size: 1rem;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--bizai-light);
}

/* Form styling in modals */
.modal-body .form-label {
    font-weight: 600;
    color: var(--bizai-secondary);
    margin-bottom: 0.5rem;
}

.modal-body .form-control,
.modal-body .form-select {
    border: 1px solid #dee2e6;
    border-radius: 6px;
    padding: 0.75rem;
    transition: all 0.2s ease;
}

.modal-body .form-control:focus,
.modal-body .form-select:focus {
    border-color: var(--bizai-accent);
    box-shadow: 0 0 0 0.2rem rgba(57, 73, 171, 0.25);
}

/* Widget list styling */
#existing-widgets-list {
    background: white;
    border-radius: 8px;
    padding: 1rem;
    border: 1px solid #e9ecef;
    max-height: 300px;
    overflow-y: auto;
}

.widget-item {
    background: white;
    border: 1px solid #e9ecef;
    border-radius: 6px;
    padding: 1rem;
    margin-bottom: 0.75rem;
    transition: all 0.2s ease;
}

.widget-item:hover {
    border-color: var(--bizai-accent);
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.widget-item:last-child {
    margin-bottom: 0;
}

/* Modal footer styling */
.modal-footer {
    background-color: #ffffff;
    border-top: 1px solid #e9ecef;
    padding: 1rem 1.5rem;
}

.modal-footer .btn {
    padding: 0.5rem 1.5rem;
    font-weight: 500;
}

/* Empty state styling */
.text-muted.text-center {
    background: white;
    border: 2px dashed #dee2e6;
    border-radius: 8px;
    padding: 2rem;
    color: #6c757d !important;
}

/* Button improvements in modals */
.modal-body .btn-primary {
    background: linear-gradient(135deg, var(--bizai-primary) 0%, var(--bizai-secondary) 100%);
    border: none;
    padding: 0.75rem 1.5rem;
    font-weight: 500;
    transition: all 0.2s ease;
}

.modal-body .btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(26, 35, 126, 0.3);
}

/* Wymuś pionowy layout dla wszystkich pól w modalach */
.modal-body .form-label {
    display: block !important;
    width: 100% !important;
    margin-bottom: 0.5rem !important;
    font-weight: 600;
    color: var(--bizai-secondary);
}

.modal-body .form-control,
.modal-body .form-select {
    display: block !important;
    width: 100% !important;
    margin-top: 0 !important;
}

.modal-body .mb-3 {
    margin-bottom: 1rem !important;
    display: block !important;
    width: 100% !important;
}

/* Specjalne style dla checkboxów aby były pod etykietami */
.modal-body .form-check {
    margin-top: 0.5rem !important;
    padding-left: 0 !important;
    display: flex !important;
    align-items: center !important;
    gap: 0.5rem !important;
}

.modal-body .form-check-input {
    margin: 0 !important;
    flex-shrink: 0 !important;
}

.modal-body .form-check-label {
    display: inline !important;
    width: auto !important;
    margin: 0 !important;
    font-weight: normal !important;
    line-height: 1.4 !important;
}

/* ===== TIME SERIES WIDGET TABLE STYLING ===== */

/* Tabela pod wykresami szeregów czasowych */
.time-series-widget table,
.reports-widget table:not(.measures-table) {
    background: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    border: 1px solid #e9ecef;
    margin-top: 1rem;
}

/* Nagłówek tabeli - białe tło z czarną czcionką */
.time-series-widget thead th,
.reports-widget thead th:not(.measures-table thead th),
.reports-widget .table-dark th {
    background: white !important;
    color: #333333 !important;
    font-weight: 600;
    font-size: 0.9rem;
    padding: 0.75rem 0.5rem;
    border: none !important;
    text-align: center;
    vertical-align: middle;
    border-bottom: 2px solid var(--bizai-table-border) !important;
}

/* Komórki tabeli - jednolity ciemnoszary kolor czcionki */
.time-series-widget tbody td,
.reports-widget tbody td:not(.measures-table tbody td),
.reports-widget .table tbody td {
    padding: 0.25rem 0.5rem;
    vertical-align: middle;
    border-top: 1px solid var(--bizai-table-border);
    text-align: center;
    font-size: 0.9rem;
    color: #495057 !important;
    background-color: white;
    transition: all 0.2s ease;
}

/* Pierwsza kolumna (daty) - spójny styl */
.time-series-widget tbody td:first-child,
.reports-widget tbody td:first-child:not(.measures-table tbody td:first-child) {
    background-color: #f8f9fa !important;
    font-weight: 600;
    color: #495057 !important;
    text-align: center;
    padding: 0.25rem 0.5rem;
    border-right: 1px solid #dee2e6;
}

/* Kolumny z liczbami - jednolity styl */
.time-series-widget tbody td:nth-child(2),
.time-series-widget tbody td:nth-child(3),
.time-series-widget tbody td:nth-child(4),
.time-series-widget tbody td:nth-child(5) {
    font-weight: 600;
    color: #495057 !important;
    background-color: inherit !important;
}

/* Hover efekty dla wierszy */
.time-series-widget tbody tr:hover td,
.reports-widget tbody tr:hover td:not(.measures-table tbody tr:hover td) {
    background-color: rgba(57, 73, 171, 0.08) !important;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

/* Wiersz RAZEM - spójny z resztą tabeli */
.time-series-widget tbody tr:last-child td,
.reports-widget tbody tr:last-child td:not(.measures-table tbody tr:last-child td),
.time-series-widget tfoot td,
.reports-widget tfoot td,
.reports-widget .table-info td,
.reports-widget tfoot .text-success,
.reports-widget tfoot .text-danger,
.reports-widget tfoot .text-primary {
    background-color: #f8f9fa !important;
    font-weight: 700 !important;
    color: #495057 !important;
    border-top: 2px solid #dee2e6 !important;
    font-size: 0.9rem;
    padding: 0.25rem 0.5rem !important;
    text-align: center;
}

.time-series-widget tbody tr:last-child td:first-child,
.time-series-widget tfoot td:first-child,
.reports-widget tfoot td:first-child {
    background-color: #f8f9fa !important;
    color: #495057 !important;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 0.25rem 0.5rem !important;
    font-weight: 700 !important;
    text-align: center;
}

/* Responsywność tabeli */
.time-series-widget .table-responsive,
.reports-widget .table-responsive {
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

/* Naprzemienne tło wierszy - delikatny szary + biały */
.time-series-widget tbody tr:nth-child(even) td,
.reports-widget tbody tr:nth-child(even) td:not(.measures-table tbody tr td) {
    background-color: #f8f9fa !important;
}

.time-series-widget tbody tr:nth-child(odd) td,
.reports-widget tbody tr:nth-child(odd) td:not(.measures-table tbody tr td) {
    background-color: white !important;
}

/* Pierwsza kolumna zawsze szara */
.time-series-widget tbody tr td:first-child,
.reports-widget tbody tr td:first-child:not(.measures-table tbody tr td:first-child) {
    background-color: #f8f9fa !important;
}

/* Nadpisanie klas Bootstrap w tfoot */
.reports-widget .table tfoot tr,
.reports-widget .table-info,
.reports-widget tfoot.table-info {
    background-color: #f8f9fa !important;
}

.reports-widget tfoot td.text-success,
.reports-widget tfoot td.text-danger,
.reports-widget tfoot td.text-primary,
.reports-widget tfoot .fw-bold td {
    color: #495057 !important;
    background-color: #f8f9fa !important;
}

/* ===== WIDGET CHARTS CENTERING ===== */

/* Wyśrodkowanie wykresów w Widget #1 */
.reports-widget .row.justify-content-center {
    display: flex !important;
    justify-content: center !important;
    align-items: flex-start !important;
}

.reports-widget .row.justify-content-center > div {
    display: flex !important;
    justify-content: center !important;
}

/* ===== WIDGET INFO MODAL STYLING ===== */

/* Karty informacyjne o widgetach */
.widget-info-card {
    background: white;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    padding: 1.25rem;
    transition: all 0.2s ease;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}

.widget-info-card:hover {
    border-color: var(--bizai-accent);
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    transform: translateY(-2px);
}

.widget-info-icon {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(57, 73, 171, 0.1);
    border-radius: 50%;
    flex-shrink: 0;
}

.widget-info-icon i {
    font-size: 1.2rem;
}

.widget-info-card h6 {
    font-size: 1rem;
    margin-bottom: 0.75rem;
}

.widget-info-card p {
    font-size: 0.9rem;
    line-height: 1.5;
    color: #6c757d;
}

.widget-info-card .small {
    font-size: 0.85rem;
    color: var(--bizai-secondary);
    background: rgba(57, 73, 171, 0.05);
    padding: 0.5rem;
    border-radius: 4px;
    border-left: 3px solid var(--bizai-accent);
}

/* Przycisk info w nagłówku */
#widget-info-btn {
    color: var(--bizai-info) !important;
    text-decoration: none !important;
    transition: all 0.2s ease;
}

#widget-info-btn:hover {
    color: var(--bizai-info-hover) !important;
    transform: scale(1.1);
}

#widget-info-btn i {
    font-size: 1.1rem;
}

/* Styling dla elementów listy widgetów w modalu */
.widget-item {
    background: white;
    border: 1px solid #e9ecef;
    border-radius: 6px;
    padding: 0.25rem 1rem;
    margin-bottom: 0.75rem;
    transition: all 0.2s ease;
}

.widget-item:hover {
    border-color: var(--bizai-primary);
    box-shadow: 0 2px 8px rgba(26, 35, 126, 0.1);
}

/* Hover effects */
.measures-table tbody tr:not(.daily-sum-row):not(.grand-total-row):not(.final-total-row):hover td {
  background-color: #f8f9fa !important;
  transform: scale(1.01) !important;
  transition: all 0.2s ease !important;
}

.measures-table .daily-sum-row:hover td {
  background: linear-gradient(135deg, #bbdefb 0%, #e1f5fe 100%) !important;
}

.measures-table .grand-total-row:hover td {
  background: linear-gradient(135deg, #c8e6c9 0%, #e8f5e8 100%) !important;
}

.measures-table .final-total-row:hover td {
  background: linear-gradient(135deg, #ffcc02 0%, #fff3e0 100%) !important;
}