/* ============================================================
   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;
}

.main-content {
    flex: 1;
    padding: 2rem 3rem;
    overflow-y: auto;
    background-color: #F9FAFB;
}

/* ============================================================
   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
   ============================================================ */
.side-nav {
    display: flex;
    flex-direction: column;
    width: 220px;
    min-width: 220px;
    flex-shrink: 0;
    min-height: 100vh;
    padding: 1.5rem 1rem;
    background-color: #111827;
    border-right: 1px solid #1F2937;
}

.nav-logo {
    margin-bottom: 1rem;
    padding-bottom: .75rem;
    border-bottom: 1px solid #374151;
}

    .nav-logo img {
        width: 100%;
        max-width: 190px;
        height: auto;
    }

.nav-links {
    flex: 1;
    list-style: none;
    padding: 0;
    margin: 0;
}

    .nav-links li {
        margin-bottom: 0.25rem;
    }

    .nav-links a {
        display: block;
        padding: 0.6rem 0.75rem;
        border-radius: 0;
        color: #9CA3AF;
        font-size: 0.875rem;
        font-weight: 500;
        transition: background-color 0.15s, color 0.15s;
    }

        .nav-links a:visited {
            color: #9CA3AF;
        }

        .nav-links a:hover {
            background-color: #1F2937;
            color: #F9FAFB;
        }

        .nav-links a.active {
            background-color: #1F2937;
            color: #4ADE80;
        }

.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;
    }

.nav-user {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    font-size: 0.8rem;
    border-top: 1px solid #374151;
    padding-top: 1rem;
    color: #9CA3AF;
}

    .nav-user a {
        color: #6B7280;
        font-size: 0.8rem;
    }

        .nav-user a:hover {
            color: #4ADE80;
        }


.nav-user__identity {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
}

/* Name = slightly stronger */
.nav-user__name {
    color: #E5E7EB;
    font-weight: 500;
}

/* Role = clearly secondary */
.nav-user__role {
    color: #6B7280;
    font-size: 0.75rem;
}

/* Logout = toned down */
.nav-user__logout {
    margin-top: 0.5rem;
    color: #6B7280;
    font-size: 0.8rem;
    text-decoration: none;
}

    /* Keep hover subtle (less aggressive than nav) */
    .nav-user__logout:hover {
        color: #9CA3AF;
    }
/* ============================================================
   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: 0;
    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;
}

.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;
    }

.field-optional {
    font-weight: 400;
    color: #9CA3AF;
}
    .modal-body .form-field {
        margin-bottom:10px;
    }

input[type="text"],
input[type="date"],
input[type="number"],
select,
textarea {
    padding: 0.45rem 0.65rem;
    border: 1px solid #D1D5DB;
    border-radius: 0;
    font-size: 0.8125rem;
    font-family: 'Inter', sans-serif;
    color: #1F2937;
    background-color: #FFFFFF;
    outline: none;
    transition: border-color 0.15s;
}

    input[type="text"]:focus,
    input[type="date"]:focus,
    input[type="number"]:focus,
    select:focus,
    textarea:focus {
        border-color: #3B82F6;
        box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
    }

textarea {
    min-height: 100px;
    resize: vertical;
    line-height: 1.5;
}

/* ============================================================
   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: 0;
    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: #3B82F6;
    color: #FFFFFF;

}

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

    .btn-primary:disabled {
        background-color: #93C5FD;
        cursor: not-allowed;
    }

.btn-secondary {
    background-color: #FFFFFF;
    color: #374151;
    border: 1px solid #D1D5DB;
}

    .btn-secondary:hover {
        background-color: #F9FAFB;
    }

.btn-ghost {
    background-color: transparent;
    color: #6B7280;
    border: 1px solid #E5E7EB;
    padding: 0.4rem 0.75rem;
    font-size: 0.8rem;
}

    .btn-ghost:hover {
        background-color: #F9FAFB;
        color: #374151;
    }

.btn-danger {
    background-color: transparent;
    color: #EF4444;
    border: 1px solid #FCA5A5;
    padding: 0.4rem 0.75rem;
    font-size: 0.8rem;
}

    .btn-danger:hover {
        background-color: #FEF2F2;
    }

.btn-icon {
    background: transparent;
    border: none;
    padding: 0.25rem;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    opacity: 0.6;
    transition: opacity 0.15s;
}

    .btn-icon:hover {
        opacity: 1;
    }

.btn-danger-sm {
    background-color: transparent;
    color: #EF4444;
    border: 1px solid #FCA5A5;
    padding: 0.2rem 0.5rem;
    font-size: 0.75rem;
    cursor: pointer;
    border-radius: 2px;
}

    .btn-danger-sm:hover {
        background-color: #FEF2F2;
    }

/* ============================================================
   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;
}

.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
   ============================================================ */
.data-table-wrapper {
    background: #FFFFFF;
    border: 1px solid #D1D5DB;
    border-radius: 0;
    overflow: hidden;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.8125rem;
}

.data-table__header {
    background-color: #E5E7EB;
    padding: 0.75rem 1rem;
    border-right: 1px solid #E5E7EB;
    text-align: left;
    font-size: 0.75rem;
    font-weight: 600;
    color: #6B7280;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border-bottom: 1px solid #E5E7EB;
}

.data-table__row {
    border-bottom: 1px solid #F3F4F6;
    transition: background-color 0.1s;
     padding: 0.4rem 0.65rem;
}

  

    .data-table__row:nth-child(even) {
        background-color: #F9FAFB;
    }

    .data-table__row:last-child {
        border-bottom: none;
    }

.data-table__cell {
    padding: 0.4rem 0.65rem;
    color: #1F2937;
    border-right: 1px solid #E5E7EB;
}

.data-table__action {
    padding: 0.4rem 0.65rem;
    text-align: right;
    white-space: nowrap;
    width: 1%;
}

    .data-table__action a {
        color: #3B82F6;
        font-weight: 500;
        text-decoration: none;
    }

        .data-table__action a:hover {
            text-decoration: underline;
        }

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

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

        .data-table__action a + a {
            margin-left: 0.75rem;
            padding-left: 0.75rem;
            border-left: 1px solid #D1D5DB;
        }

/* ============================================================
   MODAL
   ============================================================ */
.modal-overlay {
    position: fixed;
    inset: 0;
    background-color: rgba(0, 0, 0, 0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.modal {
    background: #FFFFFF;
    border-radius: 0;
    width: 100%;
    max-width: 600px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid #E5E7EB;
}

.modal-body {
    padding: 1.5rem;
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 0.75rem;
    padding: 1rem 1.5rem;
    border-top: 1px solid #E5E7EB;
}

/* ============================================================
   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;
}

.success-message {
    background-color: #F0FDF4;
    border: 1px solid #86EFAC;
    border-left: 4px solid #16A34A;
    color: #16A34A;
    padding: 0.75rem 1rem;
    border-radius: 0;
    font-size: 0.875rem;
    margin-bottom: 1rem;
}
    /* ============================================================
   James
   ============================================================ */
.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}


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

.back-link {
    font-size: 0.8rem;
    color: #6B7280;
    transition: color 0.15s;
}

    .back-link:hover {
        color: #111827;
    }

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

.detail-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 1rem;
    margin-top: 1.5rem;
}

.detail-card {
    background: #FFFFFF;
    border: 1px solid #D1D5DB;
    border-radius: 0;
    padding: 1.25rem;
}

    .detail-card h2 {
        margin-bottom: 0.5rem;
    }

.detail-card__primary {
    font-size: 1rem;
    font-weight: 600;
    color: #111827;
    margin: 0 0 0.25rem 0;
}

.detail-card__secondary {
    font-size: 0.8rem;
    color: #6B7280;
    margin: 0;
}

/* ============================================================
   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__name {
    font-size: 1.1rem;
    font-weight: 600;
    color: #111827;
    margin-bottom: 0.35rem;
}

.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;
        }



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

    a.btn-secondary:hover {
        background-color: #F9FAFB;
    }




.page-header__left {
    padding-left: 0.5rem;
}

.back-link {
    margin-bottom: 0.25rem;
}


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

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


/* ============================================================
   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: 1px solid #D1D5DB;
    border-radius: 0;
    font-size: 0.875rem;
    width: 100%;
    box-sizing: border-box;
}

.role-list {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    border: 1px solid #D1D5DB;
    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: 0;
    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;
}

/* ============================================================
   MODAL
   ============================================================ */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.modal-box {
    background: #fff;
    border-radius: 0;
    padding: 2rem;
    min-width: 380px;
    max-width: 480px;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.15);
}

.modal-box h3 {
    margin: 0 0 0.25rem 0;
    font-size: 1.15rem;
}

.modal-box .form-actions {
    margin-top: 1.5rem;
}