/* Common styles */
html, body {
    height: 100%;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

.page {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

main {
    flex: 1;
    padding-bottom: 2rem;
}

/* Table responsive styles */
.table-responsive {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

@media (max-width: 768px) {
    .table th, .table td {
        padding: 0.5rem 0.25rem;
        font-size: 0.875rem;
    }
}

/* Card styles */
.card {
    border-radius: 0.5rem;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

.card-header {
    border-top-left-radius: 0.5rem !important;
    border-top-right-radius: 0.5rem !important;
}

/* Loading spinner */
.spinner-border {
    width: 3rem;
    height: 3rem;
}

/* Tooltip and badge styles */
.status-badge-wrapper {
    position: relative;
    display: inline-block;
    cursor: pointer;
}

.custom-tooltip-fixed {
    position: fixed;
    z-index: 9999;
    background: #fff;
    color: #333;
    text-align: left;
    border-radius: 0.5rem;
    border: 1px solid #bbb;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    padding: 0.75rem 1rem;
    font-size: 0.95rem;
    white-space: pre-line;
    pointer-events: auto;
    max-width: 320px;
    min-width: 180px;
    max-height: 220px;
    overflow-y: auto;
    overflow-x: hidden;
    word-break: break-word;
}

/* Modal styles */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0,0,0,0.5);
    z-index: 1050;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-centered {
    background: #fff;
    border-radius: 0.75rem;
    box-shadow: 0 4px 32px rgba(0,0,0,0.18);
    width: 66vw;
    max-width: 900px;
    min-width: 320px;
    max-height: 80vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.modal-header {
    padding: 1rem 1.5rem 1rem 1.5rem;
    border-bottom: 1px solid #eee;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #f8f9fa;
}

.modal-body {
    padding: 1.5rem;
    overflow-y: auto;
    font-size: 1.05rem;
    word-break: break-word;
    white-space: pre-line;
}

.modal-close-btn {
    background: none;
    border: none;
    font-size: 1.5rem;
    color: #888;
    cursor: pointer;
    line-height: 1;
}

.card-header.bg-primary {
    background-color: #19345c !important;
    color: #fff !important;
}

.group-heading, h5.bg-light {
    background: #19345c !important;
    color: #fff !important;
    border-color: #444 !important;
}

/* Dark mode styles */
.dark-mode {
    background: #181a1b !important;
    color: #e0e0e0 !important;
}
.dark-mode .custom-tooltip-fixed {
    background: #23272b !important;
    color: #e0e0e0 !important;
    border: 1px solid #444 !important;
}
.dark-mode .modal-overlay {
    background: rgba(0,0,0,0.7) !important;
}
.dark-mode .group-heading, .dark-mode h5.bg-light {
    background: #19345c !important;
    color: #fff !important;
    border-color: #444 !important;
}
.dark-mode .btn-outline-danger i.bi-trash {
    color: #dc3545 !important;
}
.dark-mode .btn-outline-danger:hover i.bi-trash,
.dark-mode .btn-outline-danger:focus i.bi-trash {
    color: #fff !important;
}
.dark-mode .modal-centered {
    background: #23272b !important;
    color: #e0e0e0 !important;
    box-shadow: 0 4px 32px rgba(0,0,0,0.45);
}
.dark-mode .modal-header {
    background: #23272b !important;
    color: #e0e0e0 !important;
    border-bottom: 1px solid #333 !important;
}
.dark-mode .modal-body {
    background: #23272b !important;
    color: #e0e0e0 !important;
}
.dark-mode .modal-close-btn {
    color: #bbb !important;
}
.dark-mode .modal-close-btn:hover, .dark-mode .modal-close-btn:focus {
    color: #fff !important;
}
.dark-mode .card-header.bg-primary {
    background-color: #19345c !important;
    color: #fff !important;
}