/* === Visually Hidden (screen reader only) === */
.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* === Pelican Dashboard === */
/* Scoped under .pelican-dashboard to avoid conflicts with site.css */

.pelican-dashboard {
    display: grid;
    grid-template-columns: 310px 1fr;
    grid-template-rows: 1fr 1fr;
    width: 100%;
    height: calc(100vh - 200px);
    min-height: 600px;
    border: 1px solid #b0b0b0;
    background: #f5f5f5;
    font-family: 'Benton Sans', Arial, Helvetica, sans-serif;
    font-size: 12px;
    color: #333;
}

/* === Sidebar === */
.pelican-dashboard .sidebar {
    grid-row: 1 / 3;
    grid-column: 1;
    background: #fff;
    border-right: 2px solid #c0c0c0;
    overflow-y: auto;
    padding: 0;
    display: flex;
    flex-direction: column;
}

.pelican-dashboard .step-section {
    padding: 10px 20px;
    border-bottom: 1px solid #d4d4d4;
}

.pelican-dashboard .step-title {
    text-align: center;
    font-size: 26px;
    font-weight: 400;
    color: #e15759;
    margin-bottom: 2px;
}

.pelican-dashboard .step-subtitle {
    text-align: center;
    font-size: 20px;
    font-weight: 400;
    color: #e15759;
    margin: 0 0 6px 0;
}

.pelican-dashboard .filter-group {
    margin-bottom: 6px;
}

.pelican-dashboard .filter-label {
    display: block;
    font-size: 12px;
    font-weight: 600;
    color: #333;
    margin-bottom: 4px;
}

.pelican-dashboard .filter-select,
.pelican-dashboard .filter-input {
    width: 100%;
    padding: 6px 8px;
    font-size: 12px;
    border: 1px solid #767676;
    border-radius: 0;
    background: #fff;
    color: #333;
    font-family: inherit;
}

.pelican-dashboard .filter-input {
    padding: 7px 8px;
}

/* === Multi-Select Dropdown === */
.pelican-dashboard .multi-select {
    position: relative;
}

.pelican-dashboard .ms-trigger {
    display: block;
    width: 100%;
    padding: 6px 24px 6px 8px;
    font-size: 12px;
    border: 1px solid #767676;
    border-radius: 0;
    background: #fff;
    color: #333;
    cursor: pointer;
    text-align: left;
    font-family: inherit;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    appearance: none;
    position: relative;
    min-height: 24px;
    line-height: normal;
}

.pelican-dashboard .ms-trigger::after {
    content: '\25BC';
    position: absolute;
    right: 6px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 9px;
    color: #555;
    pointer-events: none;
}

.pelican-dashboard .ms-panel {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    width: 100%;
    max-height: 350px;
    background: #fff;
    border: 1px solid #767676;
    box-shadow: 2px 2px 6px rgba(0,0,0,0.2);
    z-index: 1000;
    flex-direction: column;
}

.pelican-dashboard .ms-panel.open {
    display: flex;
}

.pelican-dashboard .ms-search {
    padding: 6px;
    border-bottom: 1px solid #ddd;
}

.pelican-dashboard .ms-search input {
    width: 100%;
    padding: 4px 6px;
    font-size: 12px;
    border: 1px solid #bbb;
    font-family: inherit;
}

.pelican-dashboard .ms-list {
    flex: 1;
    overflow-y: auto;
    max-height: 250px;
    padding: 4px 0;
}

.pelican-dashboard .ms-item {
    display: flex;
    align-items: center;
    padding: 5px 8px;
    cursor: pointer;
    font-size: 12px;
    border-bottom: 1px solid #eee;
}

.pelican-dashboard .ms-item:hover {
    background: #e8f0fe;
}

.pelican-dashboard .ms-item input[type="checkbox"] {
    margin-right: 6px;
    cursor: pointer;
}

.pelican-dashboard .ms-item label {
    cursor: pointer;
    user-select: none;
    flex: 1;
}

.pelican-dashboard .ms-item.all-item {
    border-bottom: 1px solid #eee;
    padding-bottom: 4px;
    margin-bottom: 2px;
}

.pelican-dashboard .ms-buttons {
    display: flex;
    border-top: 1px solid #ddd;
    background: #f8f8f8;
}

.pelican-dashboard .ms-buttons button {
    flex: 1;
    padding: 6px;
    font-size: 12px;
    cursor: pointer;
    border: none;
    background: #f8f8f8;
    font-family: inherit;
    color: #333;
}

.pelican-dashboard .ms-buttons button:first-child {
    border-right: 1px solid #ddd;
}

.pelican-dashboard .ms-buttons button:hover {
    background: #e0e0e0;
}

/* === Vendor Section === */
.pelican-dashboard .vendor-section {
    padding: 12px 20px;
}

.pelican-dashboard .vendor-title {
    text-align: center;
    font-size: 20px;
    font-weight: 400;
    color: #e15759;
    margin: 0 0 4px 0;
}

/* === Vendor Typeahead === */
.pelican-dashboard .vendor-typeahead {
    position: relative;
}

.pelican-dashboard .typeahead-dropdown {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    width: 100%;
    max-height: 300px;
    overflow-y: auto;
    background: #fff;
    border: 1px solid #767676;
    border-top: none;
    box-shadow: 2px 2px 6px rgba(0,0,0,0.2);
    z-index: 1000;
}

.pelican-dashboard .typeahead-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 10px;
    cursor: pointer;
    font-size: 12px;
    border-bottom: 1px solid #eee;
}

.pelican-dashboard .typeahead-item:last-child {
    border-bottom: none;
}

.pelican-dashboard .typeahead-item:hover,
.pelican-dashboard .typeahead-item.active {
    background: #e8f0fe;
}

.pelican-dashboard .typeahead-name {
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    margin-right: 10px;
}

.pelican-dashboard .typeahead-amount {
    flex-shrink: 0;
    font-weight: 600;
    color: #555;
    font-size: 11px;
}

.pelican-dashboard .typeahead-empty {
    padding: 12px 10px;
    color: #999;
    font-size: 12px;
    text-align: center;
    font-style: italic;
}

/* === Reset Section === */
.pelican-dashboard .reset-section {
    padding: 12px 20px;
    border-bottom: none;
}

.pelican-dashboard .reset-button {
    display: block;
    width: 100%;
    padding: 10px;
    font-size: 14px;
    font-weight: 700;
    color: #fff;
    background: #4db8b5;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-family: inherit;
}

.pelican-dashboard .reset-button:hover {
    background: #3fa8a5;
}

/* === Chart Area === */
.pelican-dashboard .chart-area {
    grid-row: 1;
    grid-column: 2;
    background: #f0f0f0;
    padding: 10px 15px 5px 15px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    border: 2px solid #a8c4d8;
    border-bottom: 1px solid #a8c4d8;
}

.pelican-dashboard .chart-scroll-wrapper {
    flex: 1;
    overflow-y: auto;
    min-height: 0;
}

.pelican-dashboard .chart-title {
    text-align: center;
    font-size: 18px;
    font-weight: 600;
    color: #333;
    margin: 0 0 2px 0;
}

.pelican-dashboard .chart-subtitle {
    text-align: center;
    font-size: 11px;
    font-style: italic;
    color: #2b7a78;
    margin-bottom: 4px;
}

/* === Chart Pagination === */
.pelican-dashboard .chart-pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    padding: 4px 0;
    flex-shrink: 0;
}

.pelican-dashboard .chart-pagination button {
    padding: 3px 10px;
    font-size: 12px;
    border: 1px solid #bbb;
    background: #fff;
    cursor: pointer;
    font-family: inherit;
    color: #333;
}

.pelican-dashboard .chart-pagination button:hover:not(:disabled) {
    background: #e0e0e0;
}

.pelican-dashboard .chart-pagination button:disabled {
    color: #aaa;
    cursor: default;
}

.pelican-dashboard .chart-page-info {
    font-size: 11px;
    color: #555;
}

/* === Table Area === */
.pelican-dashboard .table-area {
    grid-row: 2;
    grid-column: 2;
    background: #fff;
    padding: 10px 15px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    border: 2px solid #a8c4d8;
    border-top: 1px solid #a8c4d8;
}

.pelican-dashboard .table-title {
    text-align: center;
    font-size: 18px;
    font-weight: 600;
    color: #666;
    margin: 0 0 8px 0;
}

.pelican-dashboard .table-wrapper {
    flex: 1;
    overflow-y: auto;
}

.pelican-dashboard #dataTable {
    width: 100%;
    border-collapse: collapse;
    font-size: 12px;
}

.pelican-dashboard #dataTable thead th {
    position: sticky;
    top: 0;
    background: #fff;
    border-bottom: 2px solid #aaa;
    padding: 6px 8px;
    text-align: left;
    font-weight: 700;
    color: #333;
    white-space: nowrap;
}

.pelican-dashboard #dataTable th.col-amount,
.pelican-dashboard #dataTable td.col-amount {
    text-align: right;
}

.pelican-dashboard #dataTable tbody tr:nth-child(even) {
    background: #f7f7f7;
}

.pelican-dashboard #dataTable tbody tr:nth-child(odd) {
    background: #fff;
}

.pelican-dashboard #dataTable tbody td {
    padding: 5px 8px;
    border-bottom: 1px solid #e0e0e0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 250px;
}

.pelican-dashboard .col-id { width: 110px; }
.pelican-dashboard .col-dept { width: 250px; }
.pelican-dashboard .col-vendor { width: 250px; }
.pelican-dashboard .col-ref { width: 150px; }
.pelican-dashboard .col-amount { width: 120px; }

/* === Pagination === */
.pelican-dashboard .pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 4px;
    padding: 8px 0 4px 0;
    flex-shrink: 0;
}

.pelican-dashboard .pagination button {
    padding: 4px 10px;
    font-size: 12px;
    border: 1px solid #bbb;
    background: #fff;
    cursor: pointer;
    font-family: inherit;
    color: #333;
}

.pelican-dashboard .pagination button:hover:not(:disabled) {
    background: #e0e0e0;
}

.pelican-dashboard .pagination button:disabled {
    color: #aaa;
    cursor: default;
}

.pelican-dashboard .pagination button.active {
    background: #4e79a7;
    color: #fff;
    border-color: #4e79a7;
}

.pelican-dashboard .pagination .page-info {
    font-size: 12px;
    color: #555;
    margin: 0 8px;
}

/* === Mobile Cards === */
.pelican-dashboard .mobile-card {
    padding: 10px 12px;
    border-bottom: 1px solid #e0e0e0;
    font-size: 13px;
}

.pelican-dashboard .mobile-card.alt {
    background: #f7f7f7;
}

.pelican-dashboard .mc-row {
    margin-bottom: 3px;
    line-height: 1.4;
    word-wrap: break-word;
}

.pelican-dashboard .mc-header-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 6px;
}

.pelican-dashboard .mc-id {
    font-weight: 700;
    color: #4e79a7;
    font-size: 12px;
}

.pelican-dashboard .mc-amount {
    font-weight: 700;
    font-size: 15px;
    color: #333;
}

.pelican-dashboard .mc-label {
    font-weight: 600;
    color: #666;
    font-size: 11px;
}

/* === Mobile filter toggle (hidden on desktop) === */
.pelican-dashboard .mobile-filter-toggle {
    display: none;
}

/* === Mobile / Responsive === */
@media (max-width: 900px) {
    .pelican-dashboard {
        display: flex;
        flex-direction: column;
        height: auto;
        min-height: 100vh;
    }

    .pelican-dashboard .mobile-filter-toggle {
        display: block;
        width: 100%;
        padding: 12px;
        font-size: 16px;
        font-weight: 700;
        color: #fff;
        background: #4e79a7;
        border: none;
        cursor: pointer;
        text-align: center;
        font-family: inherit;
        order: 0;
        position: sticky;
        top: 0;
        z-index: 900;
    }

    .pelican-dashboard .mobile-filter-toggle:hover {
        background: #3d6892;
    }

    .pelican-dashboard .sidebar {
        grid-row: unset;
        grid-column: unset;
        border-right: none;
        border-bottom: 2px solid #c0c0c0;
        overflow-y: visible;
        max-height: 0;
        overflow: hidden;
        transition: max-height 0.3s ease;
        order: 1;
    }

    .pelican-dashboard .sidebar.open {
        max-height: 2000px;
        overflow-y: auto;
    }

    .pelican-dashboard .chart-area {
        grid-row: unset;
        grid-column: unset;
        min-height: 320px;
        order: 2;
        padding: 8px 6px 5px 6px;
    }

    .pelican-dashboard .chart-scroll-wrapper {
        overflow-y: visible;
    }

    .pelican-dashboard .table-area {
        grid-row: unset;
        grid-column: unset;
        min-height: 300px;
        order: 3;
        padding: 8px 0;
    }

    .pelican-dashboard .table-title {
        padding: 0 10px;
    }

    .pelican-dashboard .ms-panel {
        width: calc(100vw - 44px);
        max-width: 400px;
    }

    .pelican-dashboard .pagination {
        flex-wrap: wrap;
        gap: 3px;
        padding: 8px 6px 4px 6px;
    }

    .pelican-dashboard .pagination button {
        padding: 6px 10px;
        font-size: 13px;
    }
}

@media (max-width: 500px) {
    .pelican-dashboard .step-title { font-size: 22px; }
    .pelican-dashboard .step-subtitle { font-size: 12px; }
    .pelican-dashboard .chart-title { font-size: 15px; }
    .pelican-dashboard .chart-subtitle { font-size: 10px; }
    .pelican-dashboard .table-title { font-size: 15px; }
    .pelican-dashboard .step-section { padding: 10px 14px; }

    .pelican-dashboard .ms-panel {
        width: calc(100vw - 32px);
    }

    .pelican-dashboard .pagination button {
        padding: 5px 8px;
        font-size: 12px;
    }
}
