﻿/* ===== GLOBAL RESET ===== */
html, body {
    height: 100%;
    margin: 0;
    padding: 0;
    overflow: hidden;
}

/* ===== PAGE LAYOUT - FULL HEIGHT ===== */
.p-grid-page {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

/* ===== CONTAINER - FILLS ALL SPACE ===== */
.p-grid-container {
    flex: 1 1 auto;
    display: flex;
    flex-direction: column;
    padding: 15px;
    min-height: 0;
    overflow: hidden;
}

/* ===== HEADER ===== */
.p-grid-title {
    margin: 0 0 12px 0;
    font-weight: 600;
    font-size: 20px;
    color: #1f2937;
    flex-shrink: 0;
}

/* ===== CARD - EXPANDS TO FILL ===== */
.p-grid-card {
    flex: 1 1 auto;
    display: flex;
    flex-direction: column;
    min-height: 0;
    background: #ffffff;
    border-radius: 12px;
    padding: 16px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.08);
    border: 1px solid #e5e7eb;
    overflow: hidden;
}

/* ===== GRID - FORCE FULL HEIGHT ===== */
.p-grid .dxbs-gridview > div > .dxbs-grid-vsd {
    flex: 1 1 auto;
    display: flex;
    flex-direction: column;
    min-height: 0;
    height: 100% !important;
    height: calc(6vh) !important;
    border: 1px solid red;
}


/* ===== TOOLBAR ===== */
.p-grid-toolbar {
    padding: 8px 0;
    margin-bottom: 8px;
    flex-shrink: 0;
}

    .p-grid-toolbar ::deep .dx-toolbar-items-container {
        display: flex;
        justify-content: space-between;
        align-items: center;
    }

/* ===== STATUS BADGES ===== */
.p-badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.025em;
}

    .p-badge.valid {
        background: #d1fae5;
        color: #065f46;
    }

    .p-badge.expired {
        background: #fee2e2;
        color: #991b1b;
        border: 1px solid #fecaca;
        animation: pulse-attention 2s infinite;
    }

    .p-badge.warning {
        background: #fef3c7;
        color: #92400e;
    }

    .p-badge.neutral {
        background: #f3f4f6;
        color: #4b5563;
    }

@keyframes pulse-attention {
    0%, 100% {
        box-shadow: 0 0 0 0 rgba(153, 27, 27, 0.4);
    }

    50% {
        box-shadow: 0 0 0 4px rgba(153, 27, 27, 0);
    }
}

/* ===== LOADING OVERLAY ===== */
.p-grid-overlay {
    position: fixed;
    inset: 0;
    background: rgba(255,255,255,0.9);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 16px;
    z-index: 9999;
}

.p-grid-spinner {
    width: 48px;
    height: 48px;
    border: 4px solid #e5e7eb;
    border-top: 4px solid #2563eb;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

.p-grid-overlay span {
    color: #374151;
    font-size: 14px;
    font-weight: 500;
}

@keyframes spin {
    from {
        transform: rotate(0deg);
    }

    to {
        transform: rotate(360deg);
    }
}

/* ===== ERROR TEXT ===== */
.text-danger {
    color: #dc2626;
    font-size: 13px;
    margin: 0 0 12px 0;
    flex-shrink: 0;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
    .p-grid-container {
        padding: 8px;
    }

    .p-grid-card {
        padding: 12px;
        border-radius: 8px;
    }
}
