﻿/* ============================================
   PURCHASE ORDERS LIST - COMPLETE FIXED STYLESHEET
   All Custom Classes - Perfect Alignment
   ============================================ */

/* ====== CSS VARIABLES ====== */
:root {
    /* Primary Colors - Teal */
    --po-primary: 15, 105, 115;
    --po-primary-hover: 15, 85, 95;
    --po-primary-light: 229, 240, 240;
    --po-primary-lighter: 242, 248, 248;
    /* Status Colors */
    --po-success: 22, 163, 74;
    --po-success-light: 220, 252, 231;
    --po-success-dark: 21, 128, 61;
    --po-danger: 220, 38, 38;
    --po-danger-light: 254, 226, 226;
    --po-warning: 217, 119, 6;
    --po-warning-light: 254, 243, 199;
    --po-info: 59, 130, 246;
    --po-info-light: 219, 234, 254;
    /* Neutral Colors */
    --po-white: 255, 255, 255;
    --po-gray-50: 249, 250, 251;
    --po-gray-100: 243, 244, 246;
    --po-gray-200: 229, 231, 235;
    --po-gray-300: 209, 213, 219;
    --po-gray-400: 156, 163, 175;
    --po-gray-500: 107, 114, 128;
    --po-gray-600: 75, 85, 99;
    --po-gray-700: 55, 65, 81;
    --po-gray-800: 31, 41, 55;
    --po-gray-900: 17, 24, 39;
    /* Spacing */
    --po-space-1: 0.25rem;
    --po-space-2: 0.5rem;
    --po-space-3: 0.75rem;
    --po-space-4: 1rem;
    --po-space-5: 1.25rem;
    --po-space-6: 1.5rem;
    /* Border Radius */
    --po-radius-sm: 0.375rem;
    --po-radius-md: 0.5rem;
    --po-radius-lg: 0.75rem;
    --po-radius-full: 9999px;
    /* Shadows */
    --po-shadow-xs: 0 1px 2px 0 rgba(0, 0, 0, 0.03);
    --po-shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --po-shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --po-shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --po-shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    /* Transitions */
    --po-transition: 150ms cubic-bezier(0.4, 0, 0.2, 1);
    --po-transition-slow: 300ms cubic-bezier(0.4, 0, 0.2, 1);
    /* Typography */
    --po-font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
    --po-font-mono: 'SF Mono', Monaco, 'Cascadia Code', monospace;
}

/* ====== RESET & BASE ====== */
* {
    box-sizing: border-box;
}

.po-page {
    min-height: 100vh;
    background: rgb(var(--po-gray-50));
    font-family: var(--po-font-sans);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

.po-container {
    max-width: 100%;
    margin: 0 auto;
    padding: var(--po-space-4);
}

/* ====== BREADCRUMB NAVIGATION ====== */
.po-breadcrumb {
    display: flex;
    align-items: center;
    gap: var(--po-space-2);
    margin-bottom: var(--po-space-4);
    font-size: 0.875rem;
    padding: var(--po-space-2) 0;
    animation: slideInDown 0.3s ease-out;
}

@keyframes slideInDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.po-breadcrumb-item {
    display: flex;
    align-items: center;
    gap: var(--po-space-2);
    color: rgb(var(--po-gray-600));
    text-decoration: none;
    transition: color var(--po-transition);
    padding: var(--po-space-1) var(--po-space-2);
    border-radius: var(--po-radius-md);
}

a.po-breadcrumb-item:hover {
    color: rgb(var(--po-primary));
    background: rgb(var(--po-gray-100));
}

.po-breadcrumb-current {
    color: rgb(var(--po-gray-900));
    font-weight: 500;
}

.po-breadcrumb-separator {
    color: rgb(var(--po-gray-400));
    font-size: 0.75rem;
}

/* ====== HEADER ====== */
.po-header {
    background: rgb(var(--po-white));
    border: 1px solid rgb(var(--po-gray-200));
    border-radius: var(--po-radius-lg);
    box-shadow: var(--po-shadow-sm);
    margin-bottom: var(--po-space-4);
    padding: var(--po-space-4);
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: var(--po-space-4);
    animation: slideInDown 0.4s ease-out;
    flex-wrap: wrap;
}

.po-header-left {
    display: flex;
    align-items: center;
    gap: var(--po-space-3);
    flex: 1;
    min-width: 0;
}

.po-header-icon {
    width: 2.75rem;
    height: 2.75rem;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, rgb(var(--po-primary)), rgb(var(--po-primary-hover)));
    border-radius: var(--po-radius-lg);
    color: white;
    font-size: 1.25rem;
    flex-shrink: 0;
    box-shadow: var(--po-shadow-md);
}

.po-header-text {
    min-width: 0;
}

.po-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: rgb(var(--po-gray-900));
    margin: 0 0 0.125rem 0;
    letter-spacing: -0.02em;
}

.po-subtitle {
    font-size: 0.875rem;
    color: rgb(var(--po-gray-600));
    margin: 0;
    line-height: 1.4;
}

.po-header-actions {
    display: flex;
    gap: var(--po-space-2);
    flex-shrink: 0;
    flex-wrap: wrap;
    align-items: center;
}

/* ====== COMPANY FILTER DROPDOWN ====== */
.po-company-filter {
    min-width: 200px;
    padding: 0.5rem 2.5rem 0.5rem 1rem;
    border: 1px solid rgb(var(--po-gray-300));
    border-radius: var(--po-radius-md);
    font-size: 0.875rem;
    font-weight: 500;
    font-family: var(--po-font-sans);
    color: rgb(var(--po-gray-900));
    background-color: rgb(var(--po-white));
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20' fill='none'%3E%3Cpath d='M7 7l3 3 3-3' stroke='%236B7280' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.75rem center;
    background-size: 1.25rem;
    cursor: pointer;
    transition: all var(--po-transition);
    appearance: none;
    line-height: 1.2;
    box-shadow: var(--po-shadow-xs);
}

    .po-company-filter:hover {
        border-color: rgb(var(--po-gray-400));
        background-color: rgb(var(--po-gray-50));
    }

    .po-company-filter:focus {
        outline: none;
        border-color: rgb(var(--po-primary));
        box-shadow: 0 0 0 3px rgba(var(--po-primary), 0.1);
    }

/* ====== BUTTONS ====== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--po-space-2);
    padding: 0.5rem var(--po-space-4);
    border-radius: var(--po-radius-md);
    font-size: 0.875rem;
    font-weight: 500;
    font-family: var(--po-font-sans);
    border: 1px solid transparent;
    cursor: pointer;
    transition: all var(--po-transition);
    text-decoration: none;
    white-space: nowrap;
    line-height: 1.2;
    box-shadow: var(--po-shadow-xs);
}

    .btn:focus {
        outline: 2px solid rgba(var(--po-primary), 0.2);
        outline-offset: 2px;
    }

    .btn:disabled {
        opacity: 0.5;
        cursor: not-allowed;
        transform: none !important;
    }

    .btn i {
        font-size: 0.875rem;
    }

.btn-compact {
    padding: 0.375rem 0.75rem;
    font-size: 0.8125rem;
}

.btn-sm {
    padding: 0.25rem 0.5rem;
    font-size: 0.75rem;
}

.btn-primary {
    background: linear-gradient(135deg, rgb(var(--po-primary)), rgb(var(--po-primary-hover)));
    color: white;
    border-color: rgb(var(--po-primary));
}

    .btn-primary:hover:not(:disabled) {
        background: linear-gradient(135deg, rgb(var(--po-primary-hover)), rgb(var(--po-primary)));
        transform: translateY(-1px);
        box-shadow: var(--po-shadow-md);
    }

.btn-secondary {
    background: rgb(var(--po-gray-100));
    color: rgb(var(--po-gray-700));
    border-color: rgb(var(--po-gray-200));
}

    .btn-secondary:hover:not(:disabled) {
        background: rgb(var(--po-gray-200));
        border-color: rgb(var(--po-gray-300));
        transform: translateY(-1px);
    }

.btn-ghost {
    background: transparent;
    color: rgb(var(--po-gray-600));
    border-color: transparent;
    box-shadow: none;
}

    .btn-ghost:hover:not(:disabled) {
        background: rgb(var(--po-gray-100));
        color: rgb(var(--po-gray-900));
    }

.btn-success {
    background: linear-gradient(135deg, rgb(var(--po-success)), rgb(var(--po-success-dark)));
    color: white;
    border-color: rgb(var(--po-success));
}

    .btn-success:hover:not(:disabled) {
        background: linear-gradient(135deg, rgb(var(--po-success-dark)), rgb(var(--po-success)));
        transform: translateY(-1px);
        box-shadow: var(--po-shadow-md);
    }

.btn-icon {
    width: 1.75rem;
    height: 1.75rem;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    border: none;
    background: transparent;
    color: rgb(var(--po-gray-400));
    cursor: pointer;
    border-radius: var(--po-radius-md);
    transition: all var(--po-transition);
    box-shadow: none;
}

    .btn-icon:hover {
        background: rgb(var(--po-gray-100));
        color: rgb(var(--po-gray-600));
    }

/* ====== CLICKABLE STATS BAR ====== */
.po-stats-bar {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: var(--po-space-3);
    margin-bottom: var(--po-space-4);
}

.po-stat-item {
    background: rgb(var(--po-white));
    border: 1px solid rgb(var(--po-gray-200));
    border-radius: var(--po-radius-md);
    padding: var(--po-space-3);
    display: flex;
    align-items: center;
    gap: var(--po-space-3);
    transition: all var(--po-transition);
    position: relative;
    overflow: hidden;
    cursor: pointer;
}

    .po-stat-item::before {
        content: '';
        position: absolute;
        top: 0;
        left: 0;
        width: 3px;
        height: 100%;
        transition: width var(--po-transition);
    }

    .po-stat-item:hover {
        box-shadow: var(--po-shadow-md);
        transform: translateY(-2px);
    }

        .po-stat-item:hover::before {
            width: 5px;
        }

    .po-stat-item.active {
        background: rgb(var(--po-primary-lighter));
        border-color: currentColor;
        box-shadow: var(--po-shadow-md);
    }

        .po-stat-item.active::before {
            width: 100%;
            opacity: 0.1;
        }

.po-stat-primary::before {
    background: rgb(var(--po-primary));
}

.po-stat-warning::before {
    background: rgb(var(--po-warning));
}

.po-stat-info::before {
    background: rgb(var(--po-info));
}

.po-stat-success::before {
    background: rgb(var(--po-success));
}

.po-stat-neutral::before {
    background: rgb(var(--po-gray-500));
}

.po-stat-primary.active {
    border-color: rgb(var(--po-primary));
}

.po-stat-warning.active {
    border-color: rgb(var(--po-warning));
    background: rgb(var(--po-warning-light));
}

.po-stat-info.active {
    border-color: rgb(var(--po-info));
    background: rgb(var(--po-info-light));
}

.po-stat-success.active {
    border-color: rgb(var(--po-success));
    background: rgb(var(--po-success-light));
}

.po-stat-neutral.active {
    border-color: rgb(var(--po-gray-500));
    background: rgb(var(--po-gray-100));
}

.po-stat-item i {
    width: 2.25rem;
    height: 2.25rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--po-radius-md);
    font-size: 1rem;
    color: white;
    flex-shrink: 0;
    transition: transform var(--po-transition);
}

.po-stat-item:hover i {
    transform: scale(1.1);
}

.po-stat-primary i {
    background: linear-gradient(135deg, rgb(var(--po-primary)), rgb(var(--po-primary-hover)));
}

.po-stat-warning i {
    background: linear-gradient(135deg, rgb(var(--po-warning)), rgba(var(--po-warning), 0.8));
}

.po-stat-info i {
    background: linear-gradient(135deg, rgb(var(--po-info)), rgba(var(--po-info), 0.8));
}

.po-stat-success i {
    background: linear-gradient(135deg, rgb(var(--po-success)), rgb(var(--po-success-dark)));
}

.po-stat-neutral i {
    background: linear-gradient(135deg, rgb(var(--po-gray-500)), rgba(var(--po-gray-500), 0.8));
}

.po-stat-data {
    display: flex;
    flex-direction: column;
    gap: 0.125rem;
    min-width: 0;
}

.po-stat-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: rgb(var(--po-gray-900));
    line-height: 1;
    font-family: var(--po-font-mono);
}

.po-stat-label {
    font-size: 0.75rem;
    color: rgb(var(--po-gray-600));
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.025em;
}

/* ====== PERIOD NOTICE ====== */
.po-period-notice {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--po-space-3);
    padding: var(--po-space-3) var(--po-space-4);
    background: rgb(var(--po-info-light));
    border: 1px solid rgb(var(--po-info));
    border-radius: var(--po-radius-lg);
    margin-bottom: var(--po-space-4);
    animation: slideInDown 0.3s ease-out;
    flex-wrap: wrap;
}

    .po-period-notice i {
        color: rgb(var(--po-info));
        font-size: 1.125rem;
        flex-shrink: 0;
    }

    .po-period-notice span {
        flex: 1;
        font-size: 0.875rem;
        color: rgb(var(--po-gray-900));
        min-width: 200px;
    }

    .po-period-notice strong {
        font-weight: 600;
        color: rgb(var(--po-info));
    }

/* ====== GRID CARD ====== */
.po-grid-card {
    background: rgb(var(--po-white));
    border: 1px solid rgb(var(--po-gray-200));
    border-radius: var(--po-radius-lg);
    box-shadow: var(--po-shadow-sm);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    animation: fadeIn 0.5s ease-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.po-grid-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--po-space-3) var(--po-space-4);
    border-bottom: 1px solid rgb(var(--po-gray-200));
    background: rgb(var(--po-gray-50));
    flex-shrink: 0;
    flex-wrap: wrap;
    gap: var(--po-space-2);
}

.po-grid-header-left {
    display: flex;
    align-items: center;
    gap: var(--po-space-2);
    flex-wrap: wrap;
}

    .po-grid-header-left i {
        color: rgb(var(--po-gray-500));
        font-size: 1rem;
    }

.po-grid-title {
    font-size: 1rem;
    font-weight: 600;
    color: rgb(var(--po-gray-900));
}

.po-grid-count {
    padding: 0.25rem 0.5rem;
    background: rgb(var(--po-primary-lighter));
    color: rgb(var(--po-primary));
    border-radius: var(--po-radius-full);
    font-size: 0.75rem;
    font-weight: 600;
}

.po-grid-header-actions {
    display: flex;
    gap: var(--po-space-2);
    align-items: center;
}

.filter-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 1.25rem;
    height: 1.25rem;
    padding: 0 0.375rem;
    background: rgb(var(--po-danger));
    color: white;
    border-radius: var(--po-radius-full);
    font-size: 0.6875rem;
    font-weight: 700;
    margin-left: var(--po-space-1);
}

/* ====== FILTERS PANEL ====== */
.po-filters-panel {
    padding: var(--po-space-4);
    background: rgb(var(--po-gray-50));
    border-bottom: 1px solid rgb(var(--po-gray-200));
    flex-shrink: 0;
    animation: slideInDown 0.3s ease-out;
}

.po-filter-section {
    margin-bottom: var(--po-space-4);
}

    .po-filter-section:last-child {
        margin-bottom: 0;
    }

.po-filter-section-label {
    display: flex;
    align-items: center;
    gap: var(--po-space-2);
    font-size: 0.875rem;
    font-weight: 600;
    color: rgb(var(--po-gray-900));
    margin-bottom: var(--po-space-3);
}

    .po-filter-section-label i {
        color: rgb(var(--po-primary));
        font-size: 1rem;
    }

.po-global-search {
    position: relative;
}

.po-search-input {
    width: 100%;
    padding: 0.75rem var(--po-space-4);
    padding-right: 3rem;
    border: 2px solid rgb(var(--po-gray-300));
    border-radius: var(--po-radius-lg);
    font-size: 0.9375rem;
    font-family: var(--po-font-sans);
    color: rgb(var(--po-gray-900));
    background: rgb(var(--po-white));
    transition: all var(--po-transition);
}

    .po-search-input::placeholder {
        color: rgb(var(--po-gray-400));
    }

    .po-search-input:hover {
        border-color: rgb(var(--po-gray-400));
    }

    .po-search-input:focus {
        outline: none;
        border-color: rgb(var(--po-primary));
        box-shadow: 0 0 0 3px rgba(var(--po-primary), 0.1);
    }

.po-search-clear {
    position: absolute;
    right: 0.75rem;
    top: 50%;
    transform: translateY(-50%);
    width: 1.75rem;
    height: 1.75rem;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgb(var(--po-gray-200));
    border: none;
    border-radius: var(--po-radius-full);
    color: rgb(var(--po-gray-600));
    cursor: pointer;
    transition: all var(--po-transition);
    font-size: 0.875rem;
}

    .po-search-clear:hover {
        background: rgb(var(--po-danger));
        color: white;
        transform: translateY(-50%) scale(1.1);
    }

/* ====== ADVANCED FILTERS ====== */
.po-filter-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: var(--po-space-3);
}

.po-filter-item {
    display: flex;
    flex-direction: column;
    gap: var(--po-space-1);
}

    .po-filter-item label {
        display: flex;
        align-items: center;
        gap: var(--po-space-1);
        font-size: 0.8125rem;
        font-weight: 500;
        color: rgb(var(--po-gray-700));
    }

        .po-filter-item label i {
            color: rgb(var(--po-gray-400));
            font-size: 0.75rem;
        }

.po-filter-input {
    width: 100%;
    padding: 0.5rem 0.75rem;
    border: 1px solid rgb(var(--po-gray-300));
    border-radius: var(--po-radius-md);
    font-size: 0.875rem;
    font-family: var(--po-font-sans);
    color: rgb(var(--po-gray-900));
    background: rgb(var(--po-white));
    transition: all var(--po-transition);
    line-height: 1.2;
}

    .po-filter-input:hover {
        border-color: rgb(var(--po-gray-400));
    }

    .po-filter-input:focus {
        outline: none;
        border-color: rgb(var(--po-primary));
        box-shadow: 0 0 0 3px rgba(var(--po-primary), 0.1);
    }

    .po-filter-input::placeholder {
        color: rgb(var(--po-gray-400));
    }

select.po-filter-input {
    cursor: pointer;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20' fill='none'%3E%3Cpath d='M7 7l3 3 3-3' stroke='%236B7280' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.5rem center;
    background-size: 1.25rem;
    padding-right: 2rem;
    appearance: none;
}

.po-filter-actions {
    display: flex;
    gap: var(--po-space-2);
    margin-top: var(--po-space-4);
    padding-top: var(--po-space-4);
    border-top: 1px solid rgb(var(--po-gray-200));
    flex-wrap: wrap;
}

/* ====== GRID BODY ====== */
.po-grid-body {
    flex: 1;
    overflow: hidden;
    position: relative;
}

    /* COMPLETE SYNCFUSION GRID OVERRIDE */
    .po-grid-body .e-grid {
        border: none !important;
        font-family: var(--po-font-sans) !important;
    }

        /* Grid Header Container */
        .po-grid-body .e-grid .e-gridheader {
            border: none !important;
            border-bottom: 2px solid rgb(var(--po-gray-200)) !important;
            background: rgb(var(--po-gray-50)) !important;
        }

        .po-grid-body .e-grid .e-headercell {
            background: rgb(var(--po-gray-50)) !important;
            border: none !important;
            border-right: 1px solid rgb(var(--po-gray-200)) !important;
            border-bottom: none !important;
            font-weight: 600 !important;
            font-size: 0.8125rem !important;
            color: rgb(var(--po-gray-700)) !important;
            padding: 0.75rem 0.75rem !important;
            text-transform: uppercase;
            letter-spacing: 0.025em;
            vertical-align: middle !important;
            text-align: left !important;
        }

            .po-grid-body .e-grid .e-headercell:last-child {
                border-right: none !important;
            }

        .po-grid-body .e-grid .e-headertext {
            font-weight: 600 !important;
            color: rgb(var(--po-gray-700)) !important;
            display: block !important;
        }

        /* Grid Content */
        .po-grid-body .e-grid .e-gridcontent {
            border: none !important;
            background: rgb(var(--po-white)) !important;
        }

        .po-grid-body .e-grid .e-content {
            border: none !important;
        }

        /* Table */
        .po-grid-body .e-grid .e-table {
            border-collapse: collapse !important;
            width: 100% !important;
            table-layout: fixed !important;
        }

        /* Rows */
        .po-grid-body .e-grid .e-row,
        .po-grid-body .e-grid .e-altrow {
            border: none !important;
            border-bottom: 1px solid rgb(var(--po-gray-100)) !important;
        }

        .po-grid-body .e-grid .e-rowcell {
            background: rgb(var(--po-white)) !important;
            border: none !important;
            border-right: 1px solid rgb(var(--po-gray-100)) !important;
            padding: 0.75rem 0.75rem !important;
            font-size: 0.875rem !important;
            color: rgb(var(--po-gray-900)) !important;
            vertical-align: middle !important;
            text-align: left !important;
            overflow: hidden !important;
            text-overflow: ellipsis !important;
        }

            .po-grid-body .e-grid .e-rowcell:last-child {
                border-right: none !important;
            }

        .po-grid-body .e-grid .e-altrow .e-rowcell {
            background: rgb(var(--po-gray-50)) !important;
        }

        .po-grid-body .e-grid .e-row:hover .e-rowcell,
        .po-grid-body .e-grid .e-altrow:hover .e-rowcell {
            background: rgb(var(--po-primary-lighter)) !important;
            transition: background var(--po-transition);
        }

        /* Selected Row */
        .po-grid-body .e-grid .e-selectionbackground {
            background: rgb(var(--po-primary-light)) !important;
        }

        /* Grid Pager */
        .po-grid-body .e-grid .e-gridpager {
            background: rgb(var(--po-white)) !important;
            border-top: 2px solid rgb(var(--po-gray-200)) !important;
            border-bottom: none !important;
            padding: 0.75rem !important;
        }

        .po-grid-body .e-grid .e-pagercontainer {
            border: none !important;
        }

        /* Pager Elements */

.e-input-group:not(.e-success):not(.e-warning):not(.e-error), .e-input-group.e-control-wrapper:not(.e-success):not(.e-warning):not(.e-error) {
    border: 1px solid rgb(var(--po-gray-300)) !important;
    border-radius: var(--po-radius-md) !important;
    background: rgb(var(--po-white)) !important;
    color: rgb(var(--po-gray-700)) !important;

    margin-top: 2px;
    min-width: 2rem !important;

    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
}

        .po-grid-body .e-grid .e-pager .e-numericcontainer .e-numericitem,
        .po-grid-body .e-grid .e-pager .e-prevpagediv,
        .po-grid-body .e-grid .e-pager .e-nextpagediv,
        .po-grid-body .e-grid .e-pager .e-firstpagediv,
        .po-grid-body .e-grid .e-pager .e-lastpagediv {
            border: 1px solid rgb(var(--po-gray-300)) !important;
            border-radius: var(--po-radius-md) !important;
            background: rgb(var(--po-white)) !important;
            color: rgb(var(--po-gray-700)) !important;
            margin: 0 0.125rem !important;
            padding: 0.375rem 0.625rem !important;
            min-width: 2rem !important;
            height: 2rem !important;
            display: inline-flex !important;
            align-items: center !important;
            justify-content: center !important;
        }

            .po-grid-body .e-grid .e-pager .e-numericitem:hover,
            .po-grid-body .e-grid .e-pager .e-prevpagediv:hover,
            .po-grid-body .e-grid .e-pager .e-nextpagediv:hover,
            .po-grid-body .e-grid .e-pager .e-firstpagediv:hover,
            .po-grid-body .e-grid .e-pager .e-lastpagediv:hover {
                background: rgb(var(--po-gray-100)) !important;
                border-color: rgb(var(--po-gray-400)) !important;
            }

        .po-grid-body .e-grid .e-pager .e-currentitem {
            background: rgb(var(--po-primary)) !important;
            border-color: rgb(var(--po-primary)) !important;
            color: white !important;
            font-weight: 600 !important;
        }

        .po-grid-body .e-grid .e-pager .e-disable,
        .po-grid-body .e-grid .e-pager .e-disable:hover {
            opacity: 0.4 !important;
            cursor: not-allowed !important;
            background: rgb(var(--po-gray-50)) !important;
        }

        /* Column Resizer */
        .po-grid-body .e-grid .e-rhandler {
            background: rgb(var(--po-gray-300)) !important;
            width: 2px !important;
        }

            .po-grid-body .e-grid .e-rhandler:hover {
                background: rgb(var(--po-primary)) !important;
            }

        /* Filter Bar */
        .po-grid-body .e-grid .e-filterbar {
            background: rgb(var(--po-gray-50)) !important;
        }

            .po-grid-body .e-grid .e-filterbar .e-filterbarcell {
                border-color: rgb(var(--po-gray-200)) !important;
                padding: 0.5rem 0.75rem !important;
            }

            .po-grid-body .e-grid .e-filterbar .e-input {
                border: 1px solid rgb(var(--po-gray-300)) !important;
                border-radius: var(--po-radius-md) !important;
                padding: 0.375rem 0.5rem !important;
                font-size: 0.8125rem !important;
            }

                .po-grid-body .e-grid .e-filterbar .e-input:focus {
                    border-color: rgb(var(--po-primary)) !important;
                    box-shadow: 0 0 0 3px rgba(var(--po-primary), 0.1) !important;
                }

/* ====== GRID CELL STYLES ====== */
.po-cell-orders {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.po-cell-text {
    display: flex;
    align-items: center;
    gap: var(--po-space-2);
    color: rgb(var(--po-gray-900));
}

    .po-cell-text i {
        color: rgb(var(--po-gray-400));
        font-size: 0.75rem;
        flex-shrink: 0;
    }

.po-cell-stacked {
    display: flex;
    flex-direction: column;
    gap: 0.125rem;
}

.po-cell-primary {
    font-weight: 500;
    color: rgb(var(--po-gray-900));
}

.po-cell-secondary {
    font-size: 0.75rem;
    color: rgb(var(--po-gray-500));
}

.po-cell-mono {
    font-family: var(--po-font-mono);
    font-weight: 600;
    color: rgb(var(--po-gray-900));
    font-size: 0.8125rem;
}

.po-cell-amount {
    font-family: var(--po-font-mono);
    font-weight: 600;
    color: rgb(var(--po-gray-900));
}

.po-cell-muted {
    color: rgb(var(--po-gray-400));
    font-style: italic;
}

/* ====== BADGES ====== */
.po-badge {
    display: inline-flex;
    align-items: center;
    padding: 0.25rem 0.5rem;
    border-radius: var(--po-radius-sm);
    font-size: 0.75rem;
    font-weight: 600;
    font-family: var(--po-font-mono);
    line-height: 1;
}

.po-badge-rq {
    background: rgb(var(--po-primary-light));
    color: rgb(var(--po-primary));
}

.po-badge-po {
    background: rgb(var(--po-success-light));
    color: rgb(var(--po-success));
}

.po-badge-internal {
    background: rgb(var(--po-gray-100));
    color: rgb(var(--po-gray-600));
}

.po-badge-grn {
    background: rgb(var(--po-info-light));
    color: rgb(var(--po-info));
}

/* ====== STATUS BADGES ====== */
.po-status-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.375rem 0.625rem;
    border-radius: var(--po-radius-full);
    font-size: 0.75rem;
    font-weight: 600;
    white-space: nowrap;
    color: white;
    box-shadow: var(--po-shadow-xs);
}

    .po-status-badge i {
        font-size: 0.6875rem;
    }

/* ====== GRID ACTIONS ====== */
.po-grid-actions {
    display: flex;
    gap: var(--po-space-1);
    justify-content: center;
    align-items: center;
}

.po-action-btn {
    width: 1.75rem;
    height: 1.75rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid rgb(var(--po-gray-300));
    background: rgb(var(--po-white));
    border-radius: var(--po-radius-md);
    cursor: pointer;
    transition: all var(--po-transition);
    color: rgb(var(--po-gray-600));
    font-size: 0.8125rem;
    flex-shrink: 0;
}

    .po-action-btn:hover:not(:disabled) {
        transform: translateY(-1px);
        box-shadow: var(--po-shadow-sm);
    }

    .po-action-btn:disabled {
        opacity: 0.5;
        cursor: not-allowed;
    }

.po-action-view:hover:not(:disabled) {
    border-color: rgb(var(--po-info));
    background: rgb(var(--po-info-light));
    color: rgb(var(--po-info));
}

.po-action-edit:hover:not(:disabled) {
    border-color: rgb(var(--po-primary));
    background: rgb(var(--po-primary-light));
    color: rgb(var(--po-primary));
}

.po-action-download:hover:not(:disabled) {
    border-color: rgb(var(--po-danger));
    background: rgb(var(--po-danger-light));
    color: rgb(var(--po-danger));
}

.po-action-info:hover:not(:disabled) {
    border-color: rgb(var(--po-warning));
    background: rgb(var(--po-warning-light));
    color: rgb(var(--po-warning));
}

/* ====== GRID FOOTER ====== */
.po-grid-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--po-space-3) var(--po-space-4);
    background: rgb(var(--po-gray-50));
    border-top: 1px solid rgb(var(--po-gray-200));
    flex-shrink: 0;
    flex-wrap: wrap;
    gap: var(--po-space-2);
}

.po-footer-info {
    display: flex;
    align-items: center;
    gap: var(--po-space-2);
    font-size: 0.875rem;
}

.po-footer-label {
    color: rgb(var(--po-gray-600));
    font-weight: 500;
}

.po-footer-value {
    color: rgb(var(--po-gray-900));
    font-weight: 700;
    font-family: var(--po-font-mono);
}

/* ====== LOADING & EMPTY STATES ====== */
.po-loading,
.po-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: var(--po-space-6);
    min-height: 300px;
}

    .po-loading > i,
    .po-empty > i {
        font-size: 2.5rem;
        color: rgb(var(--po-gray-300));
        margin-bottom: var(--po-space-3);
    }

    .po-loading i {
        color: rgb(var(--po-primary));
        animation: spin 1s linear infinite;
    }

@keyframes spin {
    from {
        transform: rotate(0deg);
    }

    to {
        transform: rotate(360deg);
    }
}

.po-loading p,
.po-empty p {
    color: rgb(var(--po-gray-600));
    font-size: 0.875rem;
    margin: 0 0 var(--po-space-3) 0;
}

/* ====== MODAL ====== */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: var(--po-space-4);
    animation: modalFadeIn 0.2s ease-out;
}

@keyframes modalFadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

.modal-dialog {
    background: rgb(var(--po-white));
    border-radius: var(--po-radius-lg);
    box-shadow: var(--po-shadow-xl);
    width: 100%;
    max-width: 500px;
    max-height: 90vh;
    overflow-y: auto;
    animation: modalSlideUp 0.3s ease-out;
}

@keyframes modalSlideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--po-space-4);
    border-bottom: 1px solid rgb(var(--po-gray-200));
}

    .modal-header h2 {
        display: flex;
        align-items: center;
        gap: var(--po-space-2);
        font-size: 1.125rem;
        font-weight: 600;
        color: rgb(var(--po-gray-900));
        margin: 0;
    }

        .modal-header h2 i {
            color: rgb(var(--po-danger));
            font-size: 1.125rem;
        }

.modal-body {
    padding: var(--po-space-4);
}

.modal-field-group {
    display: flex;
    flex-direction: column;
    gap: var(--po-space-4);
}

.modal-field {
    display: flex;
    flex-direction: column;
    gap: var(--po-space-2);
}

    .modal-field label {
        display: flex;
        align-items: center;
        gap: var(--po-space-2);
        font-size: 0.8125rem;
        font-weight: 600;
        color: rgb(var(--po-gray-700));
    }

        .modal-field label i {
            color: rgb(var(--po-gray-400));
            font-size: 0.875rem;
        }

.modal-value {
    font-size: 0.875rem;
    color: rgb(var(--po-gray-900));
    padding: var(--po-space-3);
    background: rgb(var(--po-gray-50));
    border-radius: var(--po-radius-md);
    border: 1px solid rgb(var(--po-gray-200));
}

.modal-reason {
    font-size: 0.875rem;
    color: rgb(var(--po-gray-900));
    padding: var(--po-space-3);
    background: rgb(var(--po-danger-light));
    border: 1px solid rgb(var(--po-danger));
    border-radius: var(--po-radius-md);
    line-height: 1.5;
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: var(--po-space-2);
    padding: var(--po-space-4);
    border-top: 1px solid rgb(var(--po-gray-200));
}

/* ====== SCROLLBAR STYLING ====== */
.po-grid-body::-webkit-scrollbar,
.modal-dialog::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

.po-grid-body::-webkit-scrollbar-track,
.modal-dialog::-webkit-scrollbar-track {
    background: rgb(var(--po-gray-100));
    border-radius: var(--po-radius-md);
}

.po-grid-body::-webkit-scrollbar-thumb,
.modal-dialog::-webkit-scrollbar-thumb {
    background: rgb(var(--po-gray-400));
    border-radius: var(--po-radius-md);
}

    .po-grid-body::-webkit-scrollbar-thumb:hover,
    .modal-dialog::-webkit-scrollbar-thumb:hover {
        background: rgb(var(--po-gray-500));
    }

/* ====== RESPONSIVE DESIGN ====== */
@media (max-width: 1200px) {
    .po-filter-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 992px) {
    .po-stats-bar {
        grid-template-columns: repeat(3, 1fr);
    }

    .po-filter-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .po-container {
        padding: var(--po-space-3);
    }

    .po-header {
        flex-direction: column;
        align-items: stretch;
    }

    .po-header-actions {
        width: 100%;
        justify-content: flex-start;
    }

    .po-company-filter {
        width: 100%;
    }

    .po-stats-bar {
        grid-template-columns: repeat(2, 1fr);
    }

    .po-filter-grid {
        grid-template-columns: 1fr;
    }

    .po-grid-header {
        flex-direction: column;
        align-items: stretch;
    }

    .po-period-notice {
        flex-direction: column;
        text-align: center;
    }
}

@media (max-width: 480px) {
    .po-title {
        font-size: 1.25rem;
    }

    .po-stats-bar {
        grid-template-columns: 1fr;
    }

    .po-filter-actions {
        flex-direction: column;
    }

        .po-filter-actions .btn {
            width: 100%;
        }
}

/* ====== ACCESSIBILITY ====== */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        transition-duration: 0.01ms !important;
    }
}

.btn:focus-visible,
.po-filter-input:focus-visible,
.po-action-btn:focus-visible,
.po-breadcrumb-item:focus-visible,
.po-stat-item:focus-visible,
.po-search-input:focus-visible,
.po-company-filter:focus-visible {
    outline: 3px solid rgb(var(--po-primary));
    outline-offset: 2px;
}

/* ====== PRINT STYLES ====== */
@media print {
    .po-header-actions,
    .po-filters-panel,
    .po-grid-actions,
    .po-breadcrumb,
    .po-stats-bar {
        display: none !important;
    }

    .po-grid-card {
        box-shadow: none;
        border: 1px solid #000;
    }

    .po-page {
        background: white;
    }

    .po-container {
        padding: 0;
    }
}

/* ============================================
   PURCHASE ORDERS LIST - HEADER ACTIONS FIX
   Add these styles to the END of purchase-orders-list.css
   ============================================ */

/* ====== HEADER ACTIONS LAYOUT FIX ====== */
.po-header-actions {
    display: flex;
    gap: var(--po-space-3);
    flex-shrink: 0;
    flex-wrap: wrap;
    align-items: center;
    justify-content: flex-end;
}

    /* Global Search in PO List Header */
    .po-header-actions .global-po-search {
        flex: 1 1 auto;
        min-width: 300px;
        max-width: 500px;
        order: 1;
    }

    /* Company Filter */
    .po-header-actions .po-company-filter {
        order: 2;
        flex-shrink: 0;
    }

    /* Buttons */
    .po-header-actions .btn {
        order: 3;
        flex-shrink: 0;
    }

/* ====== GLOBAL SEARCH INTEGRATION ====== */
.po-header .global-po-search {
    box-shadow: var(--po-shadow-sm);
}

.po-header .global-po-search-input {
    height: 2.375rem;
    border-color: rgb(var(--po-gray-300));
    background: rgb(var(--po-white));
    font-size: 0.875rem;
}

    .po-header .global-po-search-input:hover {
        border-color: rgb(var(--po-gray-400));
        background: rgb(var(--po-gray-50));
    }

    .po-header .global-po-search-input:focus {
        border-color: rgb(var(--po-primary));
        background: rgb(var(--po-white));
        box-shadow: 0 0 0 3px rgba(var(--po-primary), 0.1);
    }

.po-header .global-po-search-icon {
    color: rgb(var(--po-gray-400));
}

.po-header .global-po-search-input:focus ~ .global-po-search-icon {
    color: rgb(var(--po-primary));
}

.po-header .global-po-search-clear {
    background: rgb(var(--po-gray-200));
    color: rgb(var(--po-gray-600));
}

    .po-header .global-po-search-clear:hover {
        background: rgb(var(--po-gray-800));
        color: white;
    }

/* ====== BUTTON CONSISTENCY ====== */
.po-header-actions .btn {
    height: 2.375rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

    .po-header-actions .btn i {
        font-size: 0.875rem;
    }

.po-header-actions .btn-compact {
    padding: 0.5rem 1rem;
}

/* ====== RESPONSIVE LAYOUT ====== */
@media (max-width: 1600px) {
    .po-header-actions .global-po-search {
        max-width: 400px;
    }
}

@media (max-width: 1400px) {
    .po-header {
        flex-direction: column;
        gap: var(--po-space-4);
        align-items: stretch;
    }

    .po-header-left {
        width: 100%;
    }

    .po-header-actions {
        width: 100%;
        justify-content: flex-start;
    }

        .po-header-actions .global-po-search {
            order: -1;
            max-width: 100%;
            width: 100%;
        }
}

@media (max-width: 1200px) {
    .po-header-actions {
        gap: var(--po-space-2);
    }
}

@media (max-width: 992px) {
    .po-header-actions .global-po-search {
        min-width: unset;
    }

    .po-header-actions .po-company-filter {
        flex: 1;
        min-width: 200px;
    }
}

@media (max-width: 768px) {
    .po-container {
        padding: var(--po-space-3);
    }

    .po-header {
        padding: var(--po-space-3);
    }

    .po-header-actions {
        flex-direction: column;
        align-items: stretch;
        width: 100%;
    }

        .po-header-actions .global-po-search,
        .po-header-actions .po-company-filter,
        .po-header-actions .btn {
            width: 100%;
            max-width: 100%;
            min-width: unset;
            order: initial;
        }

        .po-header-actions .global-po-search {
            margin-bottom: var(--po-space-2);
        }

        .po-header-actions .btn {
            justify-content: center;
        }
}

@media (max-width: 480px) {
    .po-header {
        padding: var(--po-space-2);
    }

    .po-header-icon {
        width: 2.5rem;
        height: 2.5rem;
        font-size: 1.125rem;
    }

    .po-title {
        font-size: 1.25rem;
    }

    .po-subtitle {
        font-size: 0.8125rem;
    }

    .po-header-actions .btn {
        height: 2.25rem;
        font-size: 0.8125rem;
        padding: 0.375rem 0.75rem;
    }

        .po-header-actions .btn i {
            font-size: 0.8125rem;
        }
}

/* ====== ALIGNMENT FIXES ====== */
.po-header-actions > * {
    flex-shrink: 0;
}

.po-header-actions .global-po-search {
    flex-shrink: 1;
}

/* ====== IMPROVED SPACING ====== */
.po-header-left + .po-header-actions {
    margin-left: auto;
}

@media (max-width: 1400px) {
    .po-header-left + .po-header-actions {
        margin-left: 0;
    }
}

/* ====== BUTTON GROUP VISUAL CONSISTENCY ====== */
.po-header-actions .btn + .btn {
    margin-left: 0;
}

/* ====== LOADING STATE FOR BUTTONS ====== */
.po-header-actions .btn[disabled] {
    opacity: 0.6;
    cursor: not-allowed;
}

    .po-header-actions .btn[disabled] i {
        animation: none;
    }

        .po-header-actions .btn[disabled] i.fa-spinner {
            animation: spin 1s linear infinite;
        }

@keyframes spin {
    from {
        transform: rotate(0deg);
    }

    to {
        transform: rotate(360deg);
    }
}

/* ====== HOVER STATES ====== */
.po-header-actions .btn:not(:disabled):hover {
    transform: translateY(-1px);
}

.po-header-actions .btn:not(:disabled):active {
    transform: translateY(0);
}

/* ====== Z-INDEX MANAGEMENT ====== */
.po-header {
    position: relative;
    z-index: 10;
}

.po-header-actions {
    position: relative;
    z-index: 5;
}

    .po-header-actions .global-po-search {
        position: relative;
        z-index: 10;
    }

    /* ====== FOCUS MANAGEMENT ====== */
    .po-header-actions .btn:focus-visible,
    .po-header-actions .po-company-filter:focus-visible {
        outline: 3px solid rgba(var(--po-primary), 0.3);
        outline-offset: 2px;
    }

/* ====== PRINT STYLES ====== */
@media print {
    .po-header-actions {
        display: none !important;
    }
}

/* ====== ACCESSIBILITY ====== */
@media (prefers-reduced-motion: reduce) {
    .po-header-actions .btn,
    .po-header-actions .global-po-search-input {
        transition-duration: 0.01ms !important;
    }
}

/* ====== HIGH CONTRAST MODE ====== */
@media (prefers-contrast: high) {
    .po-header-actions .btn {
        border-width: 3px;
    }

    .po-header-actions .global-po-search-input {
        border-width: 3px;
    }
}

/* ====== COMPACT MODE FOR SMALLER SCREENS ====== */
@media (max-width: 1200px) and (min-width: 769px) {
    .po-header-actions .btn span {
        display: none;
    }

    .po-header-actions .btn {
        width: 2.375rem;
        padding: 0.5rem;
    }

        .po-header-actions .btn i {
            margin: 0;
        }
}

/* Restore text on larger screens */
@media (min-width: 1201px) {
    .po-header-actions .btn span {
        display: inline;
    }
}

/* ====== VISUAL POLISH ====== */
.po-header-actions .btn {
    box-shadow: var(--po-shadow-xs);
}

    .po-header-actions .btn:hover:not(:disabled) {
        box-shadow: var(--po-shadow-md);
    }

    .po-header-actions .btn:active:not(:disabled) {
        box-shadow: var(--po-shadow-xs);
    }

    /* ====== ICON ANIMATIONS ====== */
    .po-header-actions .btn:hover:not(:disabled) i:not(.fa-spinner) {
        transform: scale(1.1);
        transition: transform var(--po-transition);
    }

/* ====== COMPANY FILTER ALIGNMENT ====== */
.po-header-actions .po-company-filter {
    height: 2.375rem;
    display: flex;
    align-items: center;
}

/* ====== IMPROVED TOUCH TARGETS FOR MOBILE ====== */
@media (max-width: 768px) {
    .po-header-actions .btn {
        min-height: 2.75rem;
        padding: 0.75rem 1rem;
        font-size: 0.9375rem;
    }

    .po-header-actions .po-company-filter {
        min-height: 2.75rem;
        font-size: 0.9375rem;
    }

    .po-header-actions .global-po-search-input {
        height: 2.75rem;
        font-size: 0.9375rem;
    }
}

/* ====== SUBTLE ANIMATIONS ====== */
.po-header-actions > * {
    animation: fadeInUp 0.3s ease-out;
    animation-fill-mode: both;
}

    .po-header-actions > *:nth-child(1) {
        animation-delay: 0.05s;
    }

    .po-header-actions > *:nth-child(2) {
        animation-delay: 0.1s;
    }

    .po-header-actions > *:nth-child(3) {
        animation-delay: 0.15s;
    }

    .po-header-actions > *:nth-child(4) {
        animation-delay: 0.2s;
    }

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@media (prefers-reduced-motion: reduce) {
    .po-header-actions > * {
        animation: none;
    }
}