@import url('open-iconic/font/css/open-iconic-bootstrap.min.css');

html, body {
    font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
    background-color: var(--mud-main-bg, #ffffff);
    margin: 0;
    padding: 0;
}

/* Dark mode body background */
body.dark-mode {
    background-color: #0A0F1A;
}

h1:focus {
    outline: none;
}

/* Remove outlines from all icons */
.mud-icon,
.mud-icon:focus,
.mud-icon-button,
.mud-icon-button:focus,
svg,
svg:focus {
    outline: none !important;
    border: none !important;
}

.mud-icon-button:focus::after {
    outline: none !important;
}

a, .btn-link {
    color: #0071c1;
}

.btn-primary {
    color: #fff;
    background-color: #1b6ec2;
    border-color: #1861ac;
}

.content {
    padding-top: 1.1rem;
}

.valid.modified:not([type=checkbox]) {
    outline: 1px solid #26b050;
}

.invalid {
    outline: 1px solid red;
}

.validation-message {
    color: red;
}

#blazor-error-ui {
    background: lightyellow;
    bottom: 0;
    box-shadow: 0 -1px 2px rgba(0, 0, 0, 0.2);
    display: none;
    left: 0;
    padding: 0.6rem 1.25rem 0.7rem 1.25rem;
    position: fixed;
    width: 100%;
    z-index: 1000;
}

    #blazor-error-ui .dismiss {
        cursor: pointer;
        position: absolute;
        right: 0.75rem;
        top: 0.5rem;
    }

.blazor-error-boundary {
    background: url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNTYiIGhlaWdodD0iNDkiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIG92ZXJmbG93PSJoaWRkZW4iPjxkZWZzPjxjbGlwUGF0aCBpZD0iY2xpcDAiPjxyZWN0IHg9IjIzNSIgeT0iNTEiIHdpZHRoPSI1NiIgaGVpZ2h0PSI0OSIvPjwvY2xpcFBhdGg+PC9kZWZzPjxnIGNsaXAtcGF0aD0idXJsKCNjbGlwMCkiIHRyYW5zZm9ybT0idHJhbnNsYXRlKC0yMzUgLTUxKSI+PHBhdGggZD0iT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YuMTE2IDkzLjUyOTUgMjY3LjM4NyA5Mi4yODM3IDI2Ny4zODcgODkuNzkyMSAyNjcuMzg3IDg3LjMwMDUgMjY2LjExNiA4Ni4wNTQ3IDI2My41NzYgODYuMDU0N1oiIGZpbGw9IiNGRkU1MDAiIGZpbGwtcnVsZT0iZXZlbm9kZCIvPjwvZz48L3N2Zz4=) no-repeat 1rem/1.8rem, #b32121;
    padding: 1rem 1rem 1rem 3.7rem;
    color: white;
}

    .blazor-error-boundary::after {
        content: "An error has occurred."
    }

/* Sidebar Navigation Styling */
.ejk-sidebar-wrapper {
    background-color: #2d3142 !important;
    border-radius: 8px;
    width: 100%;
    height: 100%;
    min-height: 100%;
    margin: 0;
    padding: 0;
}

.ejk-sidebar-wrapper .mud-paper {
    background-color: #2d3142 !important;
}

.ejk-sidebar-nav {
    background-color: #2d3142 !important;
}

.ejk-sidebar-nav .mud-nav-link:not(.active):not(.mud-nav-link-active),
.ejk-sidebar-nav .mud-nav-link:not(.active):not(.mud-nav-link-active) .mud-nav-link-text,
.ejk-sidebar-nav .mud-nav-link:not(.active):not(.mud-nav-link-active) .mud-nav-link-icon {
    color: #E5E7EB !important;
    opacity: 1 !important;
}

.ejk-sidebar-nav .mud-nav-link.active,
.ejk-sidebar-nav .mud-nav-link.active .mud-nav-link-text,
.ejk-sidebar-nav .mud-nav-link.active .mud-nav-link-icon,
.ejk-sidebar-nav .mud-nav-link.mud-nav-link-active,
.ejk-sidebar-nav .mud-nav-link.mud-nav-link-active .mud-nav-link-text,
.ejk-sidebar-nav .mud-nav-link.mud-nav-link-active .mud-nav-link-icon {
    color: #60A5FA !important;
    opacity: 1 !important;
}

.index-filter-container {
    flex: 1;
    min-width: 280px;
    max-width: 420px;
}

.index-filter-container--full {
    width: 100%;
}

.index-filter-container--inline {
    display: flex;
    align-items: center;
    gap: 16px;
}

.index-grid-wrapper {
    border-radius: 12px;
    overflow: hidden;
}

.index-table {
    table-layout: fixed;
    width: 100%;
    border: 1px solid rgba(0, 0, 0, 0.06);
    border-radius: 12px;
    overflow: hidden;
}

.index-grid {
    border-radius: 12px;
}

.index-search {
    width: 100%;
}

.index-table .mud-table-head th,
.index-grid .mud-table-head th,
.index-grid .mud-data-grid-header {
    background-color: rgba(0, 0, 0, 0.02);
    font-weight: 600;
    white-space: nowrap;
}

.index-table .mud-table-body tr,
.index-grid .mud-table-body tr,
.index-grid .mud-data-grid-row {
    transition: background-color 0.18s ease-in-out;
}

.index-table .mud-table-body tr:hover,
.index-grid .mud-table-body tr:hover,
.index-grid .mud-data-grid-row:hover {
    background-color: rgba(25, 118, 210, 0.04);
}

.index-action-btn {
    border-radius: 10px;
}

.index-clamp-3 {
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    line-height: 1.4;
}

.index-actions-right {
    text-align: right;
}

.index-actions-nowrap {
    white-space: nowrap;
}

.index-flex-fill {
    flex: 1;
}

.fw-600 {
    font-weight: 600;
}

.detail-action-btn {
    border-radius: 10px;
}

.detail-section-panel,
.task-detail-card,
.finance-summary-card,
.tier-card,
.dimension-card,
.picklist-summary-card,
.picklist-table-wrapper,
.dispatch-section-wrapper,
.dispatch-card,
.dispatch-panel,
.movement-panel,
.order-create-panel,
.po-create-panel,
.permission-grid-wrapper,
.role-grid-wrapper {
    border-radius: 12px;
}

.detail-table,
.movement-table,
.picklist-table,
.order-product-table,
.po-product-table,
.selected-order-products-table,
.selected-products-table,
.po-day-card {
    border: 1px solid rgba(0, 0, 0, 0.06);
}

.detail-table,
.dispatch-table-wrapper,
.dispatch-list-grid-wrapper,
.movement-grid-wrapper,
.movement-table,
.pick-order-grid-wrapper,
.replenishment-grid-wrapper,
.suggested-moves-grid-wrapper,
.checkin-grid-wrapper,
.stock-grid-wrapper,
.stock-table,
.order-product-table,
.po-product-table,
.selected-order-products-table,
.selected-products-table,
.dispatch-grid-wrapper,
.detail-table,
.picklist-table,
.permission-grid,
.role-grid,
.dispatch-grid {
    border-radius: 12px;
    overflow: hidden;
}

.stock-grid,
.dispatch-list-grid,
.movement-grid,
.pick-order-grid,
.replenishment-grid,
.suggested-moves-grid,
.checkin-grid,
.dispatch-grid,
.supplier-grid {
    border-radius: 12px;
}

.detail-table .mud-table-head th,
.dispatch-table .mud-table-head th,
.movement-table .mud-table-head th,
.picklist-table .mud-table-head th,
.order-product-table .mud-table-head th,
.po-product-table .mud-table-head th,
.stock-grid .mud-table-head th,
.stock-grid .mud-data-grid-header,
.dispatch-list-grid .mud-table-head th,
.dispatch-list-grid .mud-data-grid-header,
.movement-grid .mud-table-head th,
.movement-grid .mud-data-grid-header,
.pick-order-grid .mud-table-head th,
.pick-order-grid .mud-data-grid-header,
.replenishment-grid .mud-table-head th,
.replenishment-grid .mud-data-grid-header,
.suggested-moves-grid .mud-table-head th,
.suggested-moves-grid .mud-data-grid-header,
.checkin-grid .mud-table-head th,
.checkin-grid .mud-data-grid-header,
.permission-grid .mud-table-head th,
.permission-grid .mud-data-grid-header,
.role-grid .mud-table-head th,
.role-grid .mud-data-grid-header,
.dispatch-grid .mud-table-head th,
.dispatch-grid .mud-data-grid-header {
    background-color: rgba(0, 0, 0, 0.02);
    font-weight: 600;
}

.detail-table .mud-table-head th,
.dispatch-table .mud-table-head th,
.movement-table .mud-table-head th,
.picklist-table .mud-table-head th,
.order-product-table .mud-table-head th,
.po-product-table .mud-table-head th {
    white-space: nowrap;
}

.detail-table .mud-table-body tr,
.dispatch-table .mud-table-body tr,
.movement-table .mud-table-body tr,
.picklist-table .mud-table-body tr,
.order-product-table .mud-table-body tr,
.po-product-table .mud-table-body tr,
.stock-grid .mud-table-body tr,
.stock-grid .mud-data-grid-row,
.dispatch-list-grid .mud-table-body tr,
.dispatch-list-grid .mud-data-grid-row,
.movement-grid .mud-table-body tr,
.movement-grid .mud-data-grid-row,
.pick-order-grid .mud-table-body tr,
.pick-order-grid .mud-data-grid-row,
.replenishment-grid .mud-table-body tr,
.replenishment-grid .mud-data-grid-row,
.suggested-moves-grid .mud-table-body tr,
.suggested-moves-grid .mud-data-grid-row,
.checkin-grid .mud-table-body tr,
.checkin-grid .mud-data-grid-row,
.dispatch-grid .mud-table-body tr,
.dispatch-grid .mud-data-grid-row {
    transition: background-color 0.18s ease-in-out;
}

.detail-table .mud-table-body tr:hover,
.dispatch-table .mud-table-body tr:hover,
.movement-table .mud-table-body tr:hover,
.picklist-table .mud-table-body tr:hover,
.order-product-table .mud-table-body tr:hover,
.po-product-table .mud-table-body tr:hover,
.stock-grid .mud-table-body tr:hover,
.stock-grid .mud-data-grid-row:hover,
.dispatch-list-grid .mud-table-body tr:hover,
.dispatch-list-grid .mud-data-grid-row:hover,
.movement-grid .mud-table-body tr:hover,
.movement-grid .mud-data-grid-row:hover,
.pick-order-grid .mud-table-body tr:hover,
.pick-order-grid .mud-data-grid-row:hover,
.replenishment-grid .mud-table-body tr:hover,
.replenishment-grid .mud-data-grid-row:hover,
.suggested-moves-grid .mud-table-body tr:hover,
.suggested-moves-grid .mud-data-grid-row:hover,
.checkin-grid .mud-table-body tr:hover,
.checkin-grid .mud-data-grid-row:hover,
.dispatch-grid .mud-table-body tr:hover,
.dispatch-grid .mud-data-grid-row:hover {
    background-color: rgba(25, 118, 210, 0.04);
}

.dispatch-search,
.movement-search,
.pick-order-search,
.order-product-search,
.po-product-search {
    width: 100%;
}

.movement-group-header {
    width: 100%;
    padding: 4px 0;
}

.order-product-description {
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    line-height: 1.4;
}

.risk-chip {
    white-space: nowrap;
}

.po-supplier-modal {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
}

.po-supplier-card {
    width: min(960px, 100%);
}

.assigned-location-card {
    border-radius: 10px;
    transition: box-shadow 0.2s ease;
}

.assigned-location-card:hover {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);
}

.permission-group-card:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.06);
}

.permission-group-card {
    border-radius: 12px;
    transition: box-shadow 0.18s ease-in-out, border-color 0.18s ease-in-out;
}

.permission-level-row {
    display: flex;
    gap: 8px;
    width: 100%;
}

.permission-level-btn {
    flex: 1 1 0;
}

.selected-supplier {
    border-color: var(--mud-palette-primary) !important;
    background-color: rgba(var(--mud-palette-primary-rgb), 0.05);
}

.mud-tabs-tabbar,
.mud-tabs-toolbar,
.mud-tab,
.mud-tab .mud-badge-root,
.mud-tab .mud-badge {
    overflow: visible !important;
}

.mud-tab {
    padding-right: 25px;
}

.po-entry {
    transition: all 0.18s ease-in-out;
}

.po-entry:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.06);
}

.po-time-badge {
    width: 56px;
    height: 56px;
    min-width: 56px;
    border-radius: 50%;
    background: var(--mud-palette-primary);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.95rem;
    line-height: 1;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.18);
}

.timeline-row {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    min-height: 36px;
}

.timeline-time-label {
    width: 44px;
    min-width: 44px;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--mud-palette-text-secondary);
    padding-top: 6px;
    text-align: right;
}

.timeline-connector {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 16px;
    min-width: 16px;
}

.timeline-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--mud-palette-primary);
    margin-top: 6px;
    flex-shrink: 0;
}

.timeline-dot-multi {
    background: var(--mud-palette-warning);
    box-shadow: 0 0 0 3px rgba(255, 167, 38, 0.25);
}

.timeline-line {
    width: 2px;
    flex: 1;
    min-height: 12px;
    background: var(--mud-palette-primary);
    opacity: 0.3;
    margin-top: 2px;
}

.timeline-chips {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 4px;
    padding-top: 2px;
    flex: 1;
}

.timeline-po-chip {
    height: 28px;
    min-width: 52px;
    border-radius: 6px;
    padding: 0 8px;
    font-weight: 600;
    font-size: 0.75rem;
    text-transform: none;
    color: white;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.18);
}

.comment-history-card,
.attachment-list-panel,
.priority-info-panel,
.attachment-dropzone {
    border-radius: 12px;
}

.attachment-dropzone {
    text-align: center;
    border-style: dashed;
}

.attachment-table,
.customer-order-grid-wrapper,
.item-info-table {
    border-radius: 12px;
    overflow: hidden;
}

.customer-order-grid {
    border-radius: 12px;
}

.attachment-table .mud-table-head th,
.customer-order-grid .mud-table-head th,
.customer-order-grid .mud-data-grid-header,
.item-info-table .mud-table-head th {
    background-color: rgba(0, 0, 0, 0.02);
    font-weight: 600;
}

.item-info-table {
    table-layout: fixed;
    width: 100%;
    border: 1px solid rgba(0, 0, 0, 0.06);
}

.item-info-table .mud-table-head th {
    white-space: nowrap;
}

.customer-order-grid .mud-table-body tr,
.customer-order-grid .mud-data-grid-row,
.item-info-table .mud-table-body tr {
    transition: background-color 0.18s ease-in-out;
}

.customer-order-grid .mud-table-body tr:hover,
.customer-order-grid .mud-data-grid-row:hover,
.item-info-table .mud-table-body tr:hover {
    background-color: rgba(25, 118, 210, 0.04);
}

.customer-order-search,
.item-info-search {
    width: 100%;
}

.timeline {
    position: relative;
    padding-left: 0;
    margin-left: 8px;
}

.timeline:before {
    content: '';
    position: absolute;
    left: 16px;
    top: 0;
    bottom: 0;
    width: 2px;
    background: rgba(0, 0, 0, 0.08);
    border-radius: 2px;
}

.timeline-item {
    position: relative;
    margin-bottom: 24px;
    padding-left: 52px;
}

.timeline-icon {
    position: absolute;
    left: 0;
    top: 2px;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: white;
    border: 2px solid rgba(0, 0, 0, 0.08);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
    z-index: 1;
}

.timeline-content {
    min-width: 0;
    padding-left: 0;
}

.timeline-content .mud-typography {
    word-break: break-word;
}

.item-col-id {
    width: 90px;
    min-width: 90px;
}

.item-col-product {
    width: 180px;
    min-width: 180px;
}

.item-col-status {
    width: 140px;
    min-width: 140px;
}

.item-col-source {
    width: 200px;
    min-width: 200px;
}

.item-col-description {
    width: 240px;
    min-width: 240px;
}

.item-col-date {
    width: 160px;
    min-width: 160px;
}

.item-col-user {
    width: 140px;
    min-width: 140px;
}

.item-col-actions {
    width: 220px;
    min-width: 220px;
}

.auth-page {
    padding-top: 1rem;
    padding-bottom: 2rem;
}

.auth-panel {
    position: relative;
    border: 1px solid color-mix(in srgb, var(--mud-palette-divider) 72%, transparent) !important;
    border-radius: 18px;
    background: linear-gradient(180deg, var(--mud-palette-surface) 0%, color-mix(in srgb, var(--mud-palette-surface) 78%, var(--mud-palette-background-gray) 22%) 100%);
    box-shadow: 0 14px 34px color-mix(in srgb, var(--mud-palette-black) 10%, transparent);
    overflow: hidden;
}

.auth-panel--primary::before {
    content: "";
    position: absolute;
    inset: 0 0 auto 0;
    height: 4px;
    background: linear-gradient(90deg, var(--mud-palette-primary) 0%, color-mix(in srgb, var(--mud-palette-primary) 55%, var(--mud-palette-info) 45%) 100%);
}

.auth-panel--secondary {
    background: linear-gradient(180deg, color-mix(in srgb, var(--mud-palette-surface) 90%, var(--mud-palette-background-gray) 10%) 0%, var(--mud-palette-surface) 100%);
}

.auth-header {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
}

.auth-header__content {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.auth-header__avatar,
.auth-feature__avatar {
    color: white !important;
    background: linear-gradient(135deg, var(--mud-palette-primary) 0%, color-mix(in srgb, var(--mud-palette-primary) 55%, var(--mud-palette-info) 45%) 100%) !important;
    box-shadow: 0 12px 24px color-mix(in srgb, var(--mud-palette-primary) 22%, transparent);
}

.auth-eyebrow {
    color: var(--mud-palette-primary) !important;
    font-weight: 800 !important;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.auth-form {
    width: 100%;
}

.auth-field-group {
    display: flex;
    flex-direction: column;
    gap: 0.55rem;
}

.auth-input {
    border-radius: 12px;
    border: 1px solid var(--mud-palette-lines-inputs);
    background: color-mix(in srgb, var(--mud-palette-surface) 90%, var(--mud-palette-background-gray) 10%);
    color: var(--mud-palette-text-primary);
    padding: 0.95rem 1rem;
    transition: border-color 0.18s ease-in-out, box-shadow 0.18s ease-in-out, background-color 0.18s ease-in-out;
}

.auth-input::placeholder {
    color: var(--mud-palette-text-secondary);
    opacity: 0.85;
}

.auth-input:focus {
    outline: none;
    border-color: var(--mud-palette-primary);
    box-shadow: 0 0 0 4px color-mix(in srgb, var(--mud-palette-primary) 14%, transparent);
    background: var(--mud-palette-surface);
}

.auth-form__meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
}

.auth-checkbox {
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
    font-weight: 600;
    color: var(--mud-palette-text-secondary);
}

.auth-checkbox input {
    width: 1rem;
    height: 1rem;
    margin: 0;
    accent-color: var(--mud-palette-primary);
}

.auth-submit-button {
    min-height: 3.25rem;
    border-radius: 14px !important;
    font-weight: 700 !important;
}

.auth-feature-list,
.auth-summary-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.auth-feature {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    padding: 1rem;
    border: 1px solid color-mix(in srgb, var(--mud-palette-divider) 70%, transparent);
    border-radius: 14px;
    background: color-mix(in srgb, var(--mud-palette-surface) 82%, var(--mud-palette-background-gray) 18%);
}

.auth-summary-item {
    padding-bottom: 0.9rem;
    border-bottom: 1px solid color-mix(in srgb, var(--mud-palette-divider) 70%, transparent);
}

.auth-summary-item--last {
    padding-bottom: 0;
    border-bottom: 0;
}

.auth-profile-actions {
    flex-wrap: wrap;
}

@media (max-width: 959.98px) {
    .auth-page {
        padding-top: 0.5rem;
    }

    .auth-header {
        flex-direction: column;
    }

    .auth-form__meta {
        align-items: flex-start;
    }
}
