/* ============================================================
   ROOT & RESET
   ============================================================ */
*, *::before, *::after {
    box-sizing: border-box;
}

body {
    font-family: 'Inter', sans-serif;
    font-size: 14px;
    color: #1F2937;
    margin: 0;
    background-color: #F9FAFB;
}

a {
    text-decoration: none;
    color: inherit;
}

/* ============================================================
   LAYOUT
   ============================================================ */
.layout {
    display: flex;
    height: 100vh;
}

.page-content {
    padding: 2rem 2.5rem;
}

/* ============================================================
   MUDBLAZOR APP BAR
   ============================================================ */
/* no app bar above the content anymore — drop the reserved app-bar space */
.mud-main-content {
    padding-top: 0;
}

/* the top bar lives INSIDE MudMainContent, which MudLayout already offsets
   past the drawer — so it never overlaps the nav and scrolls with the page,
   with no drawer-width math at all */
.top-bar {
    display: flex;
    align-items: center;
    padding: 0.75rem 2.5rem;
}

/* lighter top-bar icons (bell) */
.top-bar .mud-icon-button,
.top-bar .mud-icon-button .mud-icon-root {
    color: #6B7280 !important;
    fill: #6B7280 !important;
}

/* keep the search a fixed width so MudSpacer can push it to the right
   (MudTextField defaults to full width and would otherwise eat the toolbar) */
.app-search {
    flex: 0 0 auto !important;
    width: 280px !important;
}

/* soft, filled, pill search — gray fill, no harsh border, compact height */
.app-search .mud-input.mud-input-outlined {
    background-color: #F3F4F6;
    border-radius: 9999px !important;
    height: 40px;
}

.app-search .mud-input.mud-input-outlined .mud-input-outlined-border {
    border-radius: 9999px !important;
    border-color: transparent !important;
}

/* stay flat on focus — no colored border (kills the blue focus line) */
.app-search .mud-input.mud-input-outlined.mud-focused .mud-input-outlined-border {
    border-color: transparent !important;
    border-width: 1px !important;
}

/* MudBlazor adds an animated focus underline via pseudo-elements — remove it */
.app-search .mud-input::before,
.app-search .mud-input::after,
.app-search .mud-input-slot::before,
.app-search .mud-input-slot::after {
    display: none !important;
}

.app-search .mud-input-slot {
    box-shadow: none !important;
    caret-color: #9CA3AF;
}

/* compact text */
.app-search .mud-input-slot {
    padding-left: 4px;
    font-size: 0.8125rem !important;
}

.app-search .mud-input-slot::placeholder {
    font-size: 0.8125rem !important;
    opacity: 1;
}

/* smaller, muted search icon */
.app-search .mud-input-adornment .mud-icon-root {
    font-size: 1.15rem;
    color: #9CA3AF;
    fill: #9CA3AF;
}

/* drop the reserved helper-text space below the input so the pill
   centers vertically with the bell (otherwise the bell sits lower) */
.app-search,
.app-search .mud-input-control {
    margin-bottom: 0 !important;
    align-self: center;
}

.app-search .mud-input-control-helper-container,
.app-search .mud-input-helper-text {
    display: none !important;
}

/* breadcrumbs — small trail; previous crumbs grey, current page black + bold */
.app-breadcrumbs .mud-breadcrumb-item a,
.app-breadcrumbs .mud-breadcrumb-separator {
    font-size: 0.875rem;
    color: #9CA3AF !important;
}

.app-breadcrumbs .mud-breadcrumb-item:last-child,
.app-breadcrumbs .mud-breadcrumb-item:last-child * {
    font-size: 0.875rem;
    color: #111827 !important;
    font-weight: 500;
}

/* ============================================================
   NAV MENU (drawer)
   ============================================================ */
/* smaller nav icons */
.mud-navmenu .mud-nav-link .mud-icon-root {
    font-size: 1.2rem;
}

/* nudge the leading icon down to vertically center it with the label */
.mud-navmenu .mud-nav-link-icon {
    margin-top: 2px;
}

/* size hierarchy: group headers (direct children) larger than the sub-items */
.mud-navmenu .mud-nav-link {
    font-size: 0.85rem;          /* sub-items */
}

.mud-navmenu .mud-nav-group > .mud-nav-link {
    font-size: 0.95rem;          /* main/group headers */
    font-weight: 600;
}

/* keep the expand arrow neutral — no green when expanded */
.mud-navmenu .mud-nav-link-expand-icon,
.mud-navmenu .mud-nav-link-expand-icon .mud-icon-root,
.mud-navmenu .mud-nav-link-expand-icon svg {
    color: #9CA3AF !important;
    fill: #9CA3AF !important;
}

/* group headers + items stay muted (no green text when expanded) */
.mud-navmenu .mud-nav-group .mud-nav-link {
    color: #9CA3AF !important;
}

/* selected item: subtle background + accent line on the right (no green text) */
.mud-navmenu .mud-nav-link.active {
    background-color: rgba(59, 130, 246, 0.14) !important;
    color: #FFFFFF !important;
    border-right: 3px solid #3B82F6;
}

/* ============================================================
   NAV PROFILE (bottom of drawer)
   ============================================================ */
.nav-profile {
    margin-top: auto;                                /* pin to bottom of the drawer */
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    padding: 0.6rem 0.75rem;
    display: flex;
    align-items: center;
    gap: 0.6rem;
    color: #E5E7EB;
}

.nav-profile__text {
    display: flex;
    flex-direction: column;
    line-height: 1.2;
    flex: 1;                                         /* push the logout button to the right */
    min-width: 0;
}

/* light text/icon on the dark drawer */
.nav-profile .mud-icon-root {
    color: #E5E7EB;
    fill: #E5E7EB;
}

.nav-profile .nav-profile__text .mud-typography {
    color: #E5E7EB !important;
}

.nav-profile .nav-profile__text .mud-typography-caption {
    color: #9CA3AF !important;
}

/* ============================================================
   LOGIN SCREEN
   ============================================================ */
.login-screen {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    min-height: 100vh;
    background-color: #111827;
}

.login-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
    padding: 3rem;
    text-align: center;
}

    .login-card h2 {
        color: #E5E7EB;
        font-size: 1.5rem;
        font-weight: 600;
        margin: 0;
    }

    .login-card p {
        color: #9CA3AF;
        font-size: 0.95rem;
        margin: 0;
    }

.login-logo {
    width: 500px;
    height: auto;
    margin-bottom: 1rem;
}

.login-btn {
    display: inline-block;
    margin-top: 1rem;
    padding: 0.75rem 2.5rem;
    font-size: 1rem;
    border-radius: 2px;
}

/* ============================================================
   NAV
   ============================================================ */
.nav-group {
    margin-bottom: 0.25rem;
}

.nav-group__toggle {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    padding: 0.6rem 0.75rem;
    border: none;
    border-radius: 0;
    background: none;
    color: #9CA3AF;
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.15s, color 0.15s;
}

    .nav-group__toggle:hover {
        background-color: #1F2937;
        color: #D1D5DB;
    }

.nav-group__chevron {
    font-size: 0.7rem;
    transition: transform 0.2s;
}

.nav-group__toggle.open .nav-group__chevron {
    transform: rotate(0deg);
}

.nav-group__toggle:not(.open) .nav-group__chevron {
    transform: rotate(-90deg);
}

.nav-group__items {
    list-style: none;
    padding: 0;
    margin: 0;
    padding-left: 0.75rem;
}

    .nav-group__items li {
        margin-bottom: 0.1rem;
    }

    .nav-group__items a {
        padding: 0.4rem 0.75rem;
        font-size: 0.825rem;
        font-weight: 400;
    }

/* ============================================================
   TYPOGRAPHY
   ============================================================ */
h1 {
    font-size: 1.5rem;
    font-weight: 600;
    color: #111827;
    margin: 0 0 1.5rem 0;
}

h2 {
    font-size: 0.9rem;
    font-weight: 600;
    color: #374151;
    margin: 0;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* ============================================================
   FORM
   ============================================================ */
.quick-actions {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.form-section {
    background: #FFFFFF;
    border: 1px solid #D1D5DB;
    border-radius: 8px;
    padding: 1.5rem;
    margin-bottom: 1rem;
}
.form-section h2 {
    margin-bottom: 1rem;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.25rem;
}

.section-title {
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: #6B7280;
    margin: 2rem 0 0.75rem;
}

.form-row {
    display: flex;
    gap: 1.5rem;
    margin-top: 1.25rem;
}

.form-field {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    flex: 1;
    min-width: 0;
}

.form-field input,
.form-field select,
.form-field textarea {
    width: 100%;
    box-sizing: border-box;
}

    .form-field label {
        font-size: 0.8rem;
        font-weight: 500;
        color: #6B7280;
    }

/* ============================================================
   ORDER LINES
   ============================================================ */
.lines-header {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 80px;
    gap: 1rem;
    padding: 0 0 0.5rem 0;
    border-bottom: 1px solid #E5E7EB;
    margin-bottom: 0.75rem;
    font-size: 0.75rem;
    font-weight: 600;
    color: #6B7280;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.line-row {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 80px;
    gap: 1rem;
    margin-bottom: 0.75rem;
    align-items: center;
}

    .line-row select,
    .line-row input {
        width: 100%;
    }

/* ============================================================
   BUTTONS
   ============================================================ */
button {
    padding: 0.45rem 1rem;
    border-radius: 8px;
    font-size: 0.8125rem;
    font-weight: 600;
    font-family: 'Inter', sans-serif;
    cursor: pointer;
    border: 1px solid transparent;
    transition: background-color 0.15s;
}

.btn-primary {
    background-color: #172744;
    color: #FFFFFF;

}

    .btn-primary:hover {
        background-color: #213552;
    }

    .btn-primary:disabled {
        background-color: #6B7280;
        cursor: not-allowed;
    }

/* ============================================================
   FORM ACTIONS
   ============================================================ */
.form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 0.75rem;
    margin-top: 1rem;
}

/* ============================================================
   PAGE HEADER
   ============================================================ */
.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

/* the global h1 has a 1.5rem bottom margin; inside the centered header that
   shoves the title above the action button. Zero it here (higher specificity
   than the bare h1 rule, so no !important needed) — the header's own
   margin-bottom still provides the spacing below. */
.page-header h1 {
    margin: 0;
    position: relative;
    top: -2px;   /* optical lift: cap-height makes the title read a touch low vs the button */
}

.page-header__actions {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.page-subtitle {
    font-size: 0.875rem;
    color: #6B7280;
    margin-top: 0.125rem;
}

/* ============================================================
   FILTER BAR
   ============================================================ */
.filter-bar {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
    align-items: center;
}

.filter-bar label {
    font-size: 0.75rem;
    font-weight: 500;
    color: #6B7280;
}

.filter-bar select {
    padding: 0.3rem 0.5rem;
    font-size: 0.8rem;
    border: 1px solid #D1D5DB;
    border-radius: 0;
    background: #FFFFFF;
    color: #374151;
    min-width: 120px;
}

/* ============================================================
   DATA TABLE
   ============================================================ */
.sort-indicator {
    font-size: 0.625rem;
    margin-left: 0.25rem;
    color: #9CA3AF;
    vertical-align: middle;
}

.sort-indicator--active {
    color: #374151;
}

a.link {
    color: #1E40AF;
    font-weight: 500;
    text-decoration: none;
}

    a.link:hover {
        text-decoration: underline;
    }

/* ============================================================
   ERROR
   ============================================================ */
.error-message {
    background-color: #FEF2F2;
    border: 1px solid #FCA5A5;
    border-left: 4px solid #DC2626;
    color: #DC2626;
    padding: 0.75rem 1rem;
    border-radius: 0;
    font-size: 0.875rem;
    margin-bottom: 1rem;
}

/* ============================================================
   DETAIL PAGE
   ============================================================ */
.page-header__left {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.po-title {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

/* ============================================================
   STATUS BADGE
   ============================================================ */
.status-badge {
    display: inline-block;
    padding: 0.15rem 0.5rem;
    border-radius: 0;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.status-badge--draft {
    background-color: #F3F4F6;
    color: #6B7280;
}

.status-badge--open {
    background-color: #DBEAFE;
    color: #1D4ED8;
}

.status-badge--closed {
    background-color: #D1FAE5;
    color: #065F46;
}

.status-badge--cancelled {
    background-color: #FEF2F2;
    color: #DC2626;
}





.vendor-block {
    background: #FFFFFF;
    border: 1px solid #D1D5DB;
    border-radius: 0;
    padding: 1.25rem 1.5rem;
    margin-bottom: 1rem;
}

.vendor-block__meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0;
}

.vendor-block__field {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    padding-right: 2rem;
    margin-right: 2rem;
    border-right: 1px solid #E5E7EB;
    min-width: 0;
    flex-shrink: 1;
    margin-bottom: 0.75rem;
}

    .vendor-block__field:last-child {
        border-right: none;
        padding-right: 0;
        margin-right: 0;
    }

.vendor-block__label {
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #9CA3AF;
}

.vendor-block__value {
    flex: 1 1 0;
    min-width: 0;
    font-size: 0.95rem;
    font-weight: 500;
    color: #111827;
    overflow-wrap: break-word;
}

.input-prefix {
    display: flex;
    align-items: center;
    border: 1px solid #D1D5DB;
    border-radius: 0;
    overflow: hidden;
    background: #FFFFFF;
}

    .input-prefix span {
        padding: 0.5rem 0.5rem 0.5rem 0.75rem;
        color: #6B7280;
        font-size: 0.875rem;
        background: #F9FAFB;
        border-right: 1px solid #D1D5DB;
    }

    .input-prefix input {
        border: none;
        border-radius: 0;
        flex: 1;
    }

        .input-prefix input:focus {
            box-shadow: none;
        }



.page-header__left {
    padding-left: 0;
}

a.btn-primary {
    display: inline-block;
    padding: 0.45rem 1rem;
    border-radius: 8px;
    font-size: 0.8125rem;
    font-weight: 600;
    color: #FFFFFF;
    background-color: #172744;
    border: 1px solid #172744;
    transition: background-color 0.15s;
}

    a.btn-primary:hover {
        background-color: #213552;
    }


/* ============================================================
   ROLE / LOCATION SELECTOR (shared between page + components)
   ============================================================ */
.role-selector {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.role-selected {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.role-search {
    padding: 0.4rem 0.75rem;
    border-radius: 0;
    font-size: 0.875rem;
    width: 100%;
    box-sizing: border-box;
}

.role-list {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    border-radius: 0;
    padding: 0.25rem;
    max-height: 220px;
    overflow-y: auto;
}

.role-option {
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
    padding: 0.5rem 0.75rem;
    border-radius: 0;
    cursor: pointer;
}

    .role-option input[type="radio"] {
        width: auto;
        flex-shrink: 0;
        margin-top: 0.2rem;
    }

    .role-option:hover {
        background: #F3F4F6;
    }

.role-option--selected {
    background: #EFF6FF;
}

.role-option-content {
    display: flex;
    flex-direction: column;
    gap: 0.1rem;
}

.role-name {
    font-size: 0.875rem;
    font-weight: 500;
}

.role-permissions {
    font-size: 0.75rem;
    color: #9CA3AF;
}




input[type="checkbox"] {
    accent-color: #3B82F6; /* brand color */
    width: 16px;
    height: 16px;
    cursor: pointer;
}

/* ============================================================
   HOME PAGE
   ============================================================ */
.home-greeting {
    margin-bottom: 2rem;
}

.home-greeting h1 {
    font-size: 1.75rem;
    font-weight: 700;
    color: #111827;
    margin: 0 0 0.25rem 0;
}

.home-subtitle {
    font-size: 0.95rem;
    color: #6B7280;
    margin: 0;
}

.home-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 1rem;
}

.home-card {
    display: flex;
    flex-direction: column;
    padding: 1.5rem;
    background: #fff;
    border: 1px solid #D1D5DB;
    border-radius: 12px;
    text-decoration: none;
    color: inherit;
    transition: box-shadow 0.15s ease, border-color 0.15s ease;
    cursor: pointer;
}

.home-card:hover {
    border-color: #3B82F6;
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.12);
}

.home-card__icon {
    font-size: 1.75rem;
    margin-bottom: 0.75rem;
}

.home-card__label {
    font-size: 1rem;
    font-weight: 600;
    color: #111827;
    margin-bottom: 0.25rem;
}

.home-card__desc {
    font-size: 0.825rem;
    color: #6B7280;
    line-height: 1.4;
}

.home-card--admin {
    border-style: dashed;
}

.home-alert-banner {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.85rem 1.25rem;
    margin-bottom: 1.5rem;
    background: #FFF5F5;
    border: 1px solid #FE5F55;
    border-left: 4px solid #FE5F55;
    border-radius: 0;
    text-decoration: none;
    color: #1F2937;
    transition: box-shadow 0.15s ease;
}

.home-alert-banner:hover {
    box-shadow: 0 2px 8px rgba(254, 95, 85, 0.15);
}

.home-alert-banner__dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #FE5F55;
    flex-shrink: 0;
}

.home-alert-banner__text strong {
    color: #FE5F55;
}

/* ============================================================
   SHOP FLOOR  (pallet-grouped inventory view)
   ============================================================ */
.floor-section {
    margin-bottom: 2.5rem;
}

/* ---- Shop-floor single grouped grid (Location > Pallet) ---- */
/* The column header is moved into each pallet group, so hide the grid's own
   top header row, and use a fixed table layout so the in-group header strip
   lines up with the data columns. */
/* Force every toggle item to the same width so "Location & Pallet" doesn't
   make its item much wider than "Shop"/"Type". */
.shopfloor-toggle .mud-toggle-item {
    min-width: 9rem;
    justify-content: center;
    text-align: center;
}

.floor-loc {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    width: 100%;
}

.floor-loc strong {
    font-size: 0.9rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #374151;
}

.floor-pgroup__bar {
    display: flex;
    align-items: center;
    gap: 0.6rem;
}

.floor-pgroup__num {
    font-family: ui-monospace, SFMono-Regular, monospace;
    font-weight: 600;
}

.floor-pgroup__count {
    color: #6B7280;
    font-size: 0.8rem;
}

.floor-pgroup__actions {
    display: inline-flex;
    align-items: center;
    gap: 0rem;
    margin-left: auto;
}

.shopfloor-empty {
    color: #9CA3AF;
    font-style: italic;
    margin: 0.5rem 0;
    padding: 0.25rem 0;
}

/* Donut chart summarizing item counts per inventory type (Type view). */
.type-chart {
    display: flex;
    justify-content: center;
    margin-bottom: 1rem;
}

/* Center overlay text on the donut (drawn on the chart's 40x40 user-unit viewBox). */
.donut-center-count {
    font-size: 30px;
    font-weight: 700;
    fill: #1F2937;
}

.donut-center-label {
    font-size: 15px;
    fill: #6B7280;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* Pallet cards */
.pallet-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.pallet-card {
    border: 1px solid #D1D5DB;
    background: #FFFFFF;
}

.pallet-card__header {
    display: flex;
    align-items: center;
    background: #F9FAFB;
}

.pallet-card__toggle {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 1rem;
    background: transparent;
    color: #111827;
    border: none;
    padding: 0.85rem 1.25rem;
    cursor: pointer;
    text-align: left;
    font-size: 0.95rem;
}

.pallet-card__toggle:hover {
    background: #F3F4F6;
}

.pallet-card__caret {
    width: 0.85rem;
    color: #6B7280;
    font-size: 0.8rem;
}

.pallet-card__number {
    font-weight: 600;
    font-family: monospace;
    letter-spacing: 0.02em;
}

.pallet-card__count {
    margin-left: auto;
    color: #6B7280;
    font-size: 0.85rem;
}


.pallet-card__body {
    border-top: 1px solid #E5E7EB;
    padding: 1rem 1.25rem 1.25rem;
}

/* In-transit badge variant (app.css already defines --open / --draft / etc.) */
.status-badge--in-transit {
    background-color: #FEF3C7;
    color: #92400E;
}

/* ============================================================
   TRANSFER PALLET GROUPS  (transfer detail items, grouped by pallet)
   ============================================================ */
.transfer-group {
    margin-bottom: 1.25rem;
}

.transfer-group__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.5rem;
}

.transfer-group__title {
    font-size: 0.9rem;
    font-weight: 600;
    margin: 0 0 0.5rem 0;
    color: #374151;
}

/* ============================================================
   RECEIVE DISPOSITION  (per-item "Received As" dropdown)
   ============================================================ */
/* recv-select is a MudSelect; the .recv-select* classes land on its root
   (.mud-input-control). Color the outline's left edge per state. */
.recv-select {
    min-width: 150px;
}

/* Thin colored left-edge per state — subtle accent, not a fill */
.recv-select--pallet .mud-input-outlined-border {
    border-left-width: 3px;
    border-left-color: #2563EB;   /* blue = received on a pallet */
}

.recv-select--unlinked .mud-input-outlined-border {
    border-left-width: 3px;
    border-left-color: #F59E0B;   /* amber = received, unlinked */
}

.recv-select--missing .mud-input-outlined-border {
    border-left-width: 3px;
    border-left-color: #DC2626;   /* red = not received */
}

.recv-select--missing input {
    color: #9CA3AF;   /* dim text when not received */
}

/* ============================================================
   MudButtonGroup — divider between grouped items
   ------------------------------------------------------------
   Filled primary groups default to PrimaryLighten (#93C5FD, a
   bright blue) for the separator. Use a slightly lighter navy
   off the #172744 primary instead.
   ============================================================ */
.mud-button-group-root .mud-button-root {
    border-color: #34456b !important;
}
