/* ========================================
   Database Page Styles
   ======================================== */

.database-page {
    width: 100%;
}

// Status badge
.db-status-badge {
    display: inline-block;
    padding: 0.35rem 0.75rem;
    border-radius: 0.375rem;
    font-weight: 500;
    font-size: 0.8125rem;
}

.db-status-connected {
    background-color: #d1e7dd;
    color: #0f5132;
}

.db-status-disconnected {
    background-color: #f8d7da;
    color: #842029;
}

// Statistics section
.db-stats-section {
    margin-bottom: 1.25rem;

    // Принудительно все карточки в одну строку на десктопе
    .stats-cards[data-fixed-width="true"] .row {
        display: flex;
        flex-wrap: nowrap;

        @media (min-width: 768px) {
            > [class*="col-md"] {
                flex: 1 1 0%;
                min-width: 0;
            }
        }

        @media (max-width: 767.98px) {
            flex-wrap: wrap;

            > [class*="col-md"] {
                flex: 0 0 100% !important;
                max-width: 100% !important;
            }
        }
    }
}

// Tables section
.db-tables-table {
    background: #fff;
    border: 1px solid #dee2e6;
    border-radius: 0.5rem;
    overflow: hidden;

    table {
        margin: 0;
        width: 100%;
        font-size: 0.875rem;
    }

    th {
        background-color: #f8f9fa;
        font-weight: 600;
        padding: 0.5rem 0.75rem;
        text-align: left;
        border-bottom: 2px solid #dee2e6;
        font-size: 0.8125rem;
    }

    td {
        padding: 0.5rem 0.75rem;
        border-bottom: 1px solid #dee2e6;
        vertical-align: middle;
    }

    tr:last-child td {
        border-bottom: none;
    }

    .btn-group-sm .btn {
        padding: 0.25rem 0.5rem;
        font-size: 0.75rem;
    }
}

// No connection state
.db-no-connection {
    text-align: center;
    padding: 2rem 1rem;
    background: #fff;
    border: 1px solid #dee2e6;
    border-radius: 0.5rem;
}

.db-no-connection-icon {
    font-size: 3rem;
    color: #6c757d;
    margin-bottom: 0.75rem;
}

.db-no-connection-title {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 0.375rem;
    color: #212529;
}

.db-no-connection-text {
    color: #6c757d;
    margin-bottom: 1rem;
    font-size: 0.875rem;
}

// Compact card styles
.database-page {
    .card-header {
        padding: 0.75rem 1rem;

        h5 {
            font-size: 1rem;
            margin: 0;
        }
    }

    .card-body {
        padding: 0.75rem 1rem;
    }
}
