/* Enterprise ERP — global modern styling (loaded after MudBlazor) */
:root {
    --erp-primary: #2563eb;
    --erp-primary-dark: #1d4ed8;
    --erp-accent: #7c3aed;
    --erp-ink: #0f172a;
    --erp-muted: #64748b;
    --erp-surface: #ffffff;
    --erp-bg: #f1f5f9;
    --erp-border: #e2e8f0;
    --erp-radius: 14px;
    --erp-shadow: 0 10px 30px -12px rgba(2, 6, 23, 0.25);
    --erp-gradient: linear-gradient(135deg, #2563eb 0%, #4f46e5 50%, #7c3aed 100%);
}

html,
body {
    margin: 0;
    padding: 0;
    font-family: "Inter", "Segoe UI", Roboto, -apple-system, BlinkMacSystemFont, Arial, sans-serif;
    background: var(--erp-bg);
    color: var(--erp-ink);
    -webkit-font-smoothing: antialiased;
}

/* Softer, modern scrollbars */
* {
    scrollbar-width: thin;
    scrollbar-color: #cbd5e1 transparent;
}
*::-webkit-scrollbar {
    width: 9px;
    height: 9px;
}
*::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 999px;
}
*::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

/* ---------- Auth (Login / Register) — split-screen brand design ---------- */
:root {
    --auth-brand-start: #0a1f4d;
    --auth-brand-mid: #123a8c;
    --auth-brand-end: #071433;
    --auth-accent: #f4c542;
    --auth-primary: #2f5fd0;
    --auth-primary-dark: #24509f;
    --auth-success: #16a34a;
    --auth-danger: #dc2626;
    --auth-ink: #17233b;
    --auth-muted: #64748b;
    --auth-border: #e2e8f0;
    --auth-shadow: 0 18px 48px -18px rgba(10, 31, 77, 0.5);
    --auth-radius: 14px;
}

.auth-shell {
    --auth-font-body: "DM Sans", "Inter", "Segoe UI", sans-serif;
    --auth-font-display: "Sora", "DM Sans", sans-serif;
    min-height: 100vh;
    display: grid;
    grid-template-columns: 1.08fr 0.92fr;
    background: #f5f7fb;
    font-family: var(--auth-font-body);
    color: var(--auth-ink);
}

/* Brand hero / left panel */
.auth-hero {
    position: relative;
    overflow: hidden;
    color: #f4f7ff;
    padding: 56px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    background: linear-gradient(145deg, var(--auth-brand-start), var(--auth-brand-mid) 55%, var(--auth-brand-end));
}

.auth-hero-grid {
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(rgba(255, 255, 255, 0.06) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.06) 1px, transparent 1px);
    background-size: 48px 48px;
    -webkit-mask-image: linear-gradient(to bottom, transparent, black 25%, black 75%, transparent);
    mask-image: linear-gradient(to bottom, transparent, black 25%, black 75%, transparent);
    opacity: 0.5;
}

.auth-scanline {
    position: absolute;
    inset: 0 0 auto 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--auth-accent), transparent);
    animation: auth-scan 5s ease-in-out infinite;
}

.auth-top {
    position: relative;
    z-index: 2;
    display: flex;
    align-items: center;
    gap: 12px;
}

.auth-top-tile {
    width: 40px;
    height: 40px;
    border-radius: 11px;
    display: grid;
    place-items: center;
    border: 1px solid rgba(244, 247, 255, 0.2);
    background: rgba(244, 247, 255, 0.1);
    color: #fff;
}

.auth-top-name {
    font-weight: 700;
    font-size: 15px;
    line-height: 1.1;
}

.auth-top-tag {
    font-size: 12px;
    color: rgba(226, 234, 255, 0.7);
}

.auth-hero-center {
    position: relative;
    z-index: 2;
    margin: auto;
    width: 100%;
    max-width: 460px;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.auth-logo-orbit {
    position: relative;
    width: 200px;
    height: 200px;
    margin-bottom: 40px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    border: 1px solid rgba(244, 247, 255, 0.15);
    animation: auth-float 6s ease-in-out infinite;
}

.auth-logo-halo {
    position: absolute;
    width: 160px;
    height: 160px;
    border-radius: 50%;
    background: rgba(244, 197, 66, 0.22);
    filter: blur(28px);
    animation: auth-breathe 3.8s ease-in-out infinite;
}

.auth-logo-img {
    position: relative;
    z-index: 1;
    width: 150px;
    height: 150px;
    border-radius: 28px;
    object-fit: cover;
    box-shadow: var(--auth-shadow);
}

.auth-eyebrow-brand {
    margin-bottom: 14px;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.16em;
    color: var(--auth-accent);
}

.auth-display {
    font-family: var(--auth-font-display);
    font-size: 46px;
    font-weight: 800;
    line-height: 1.1;
    margin: 0;
    color: #fff;
}

.auth-hero-lede {
    margin-top: 18px;
    max-width: 380px;
    font-size: 15px;
    line-height: 1.7;
    color: rgba(226, 234, 255, 0.82);
}

.auth-bottom {
    position: relative;
    z-index: 2;
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 12px;
    color: rgba(226, 234, 255, 0.7);
}

.auth-bottom .auth-secure-brand {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.auth-bottom .auth-secure-brand .mud-icon-root {
    color: var(--auth-accent);
    font-size: 18px;
}

/* Form side / right panel */
.auth-panel {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    padding: 40px 24px;
    background: #f5f7fb;
}

.auth-panel-glow {
    position: absolute;
    inset: 0 0 auto 0;
    height: 224px;
    background: linear-gradient(180deg, rgba(47, 95, 208, 0.12), transparent);
    pointer-events: none;
}

.auth-form-wrap {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 420px;
}

.auth-mobile-brand {
    display: none;
    align-items: center;
    gap: 12px;
    margin-bottom: 34px;
}

.auth-mobile-brand img {
    width: 54px;
    height: 54px;
    border-radius: 12px;
    object-fit: cover;
    box-shadow: var(--auth-shadow);
}

.auth-mobile-brand .mb-name {
    font-family: var(--auth-font-display);
    font-weight: 700;
    font-size: 18px;
    color: var(--auth-ink);
}

.auth-mobile-brand .mb-tag {
    font-size: 12px;
    color: var(--auth-muted);
}

.auth-eyebrow {
    margin-bottom: 8px;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.16em;
    color: var(--auth-primary);
}

.auth-title {
    font-family: var(--auth-font-display);
    font-size: 34px;
    font-weight: 800;
    color: var(--auth-ink);
    margin: 0;
    line-height: 1.15;
}

.auth-subtitle {
    margin: 10px 0 26px;
    font-size: 14px;
    line-height: 1.6;
    color: var(--auth-muted);
}

.auth-form {
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.auth-field {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.auth-field-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
}

.auth-label {
    font-size: 13px;
    font-weight: 600;
    color: var(--auth-ink);
}

.auth-label-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.auth-link-accent {
    font-size: 12px;
    font-weight: 600;
    color: var(--auth-primary);
    text-decoration: none;
}

.auth-link-accent:hover {
    color: var(--auth-primary-dark);
}

/* Boxed, icon-led inputs (mirrors the reference's bordered fields) */
.auth-shell .mud-input-control {
    margin: 0 !important;
}

.auth-shell .mud-input {
    height: 48px !important;
    font-size: 15px !important;
    color: var(--auth-ink) !important;
}

.auth-shell .mud-input::before,
.auth-shell .mud-input::after {
    display: none !important;
}

.auth-shell .mud-input-outlined-with-label,
.auth-shell .mud-input-outlined-border {
    border: none !important;
}

.auth-field .mud-input,
.auth-field .mud-input-control > div {
    border-radius: var(--auth-radius) !important;
}

.auth-field .mud-input-control {
    position: relative;
}

.auth-field .mud-input-control::before {
    content: "";
    position: absolute;
    inset: 0;
    border: 1px solid var(--auth-border);
    border-radius: var(--auth-radius);
    background: #fff;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
    pointer-events: none;
}

.auth-field .mud-input-control:focus-within::before {
    border-color: var(--auth-primary);
    box-shadow: 0 0 0 3px rgba(47, 95, 208, 0.18);
}

.auth-field .mud-input-adornment {
    position: relative;
    z-index: 1;
    color: var(--auth-muted) !important;
}

.auth-field input {
    position: relative;
    z-index: 1;
    background: transparent !important;
}

.auth-field .mud-input-slot {
    padding-left: 4px;
}

.auth-field ::placeholder {
    color: #94a3b8;
    opacity: 1;
}

/* Password strength meter (register) */
.auth-strength {
    display: flex;
    align-items: center;
    gap: 12px;
    padding-top: 2px;
}

.auth-strength-track {
    flex: 1;
    height: 6px;
    border-radius: 999px;
    background: var(--auth-border);
    overflow: hidden;
}

.auth-strength-fill {
    height: 100%;
    border-radius: 999px;
    background: var(--auth-primary);
    transition: width 0.3s ease, background 0.3s ease;
}

.auth-strength-label {
    width: 64px;
    text-align: right;
    font-size: 12px;
    font-weight: 600;
    color: var(--auth-muted);
}

/* Live availability hint (register: username / email / phone) */
.auth-hint {
    display: flex;
    align-items: center;
    gap: 4px;
    margin-top: 4px;
    font-size: 12px;
    font-weight: 600;
    line-height: 1.2;
}

.auth-hint-check {
    color: var(--auth-muted);
}

.auth-hint-ok {
    color: #16a34a;
}

.auth-hint-taken {
    color: #dc2626;
}

.auth-msg {
    margin: 0;
    padding: 10px 12px;
    border-radius: 10px;
    font-size: 14px;
    background: rgba(220, 38, 38, 0.08);
    color: var(--auth-danger);
}

.auth-submit {
    height: 48px !important;
    border-radius: var(--auth-radius) !important;
    font-weight: 600 !important;
    text-transform: none !important;
    letter-spacing: 0.2px;
    font-size: 15px !important;
    color: #fff !important;
    background: var(--auth-primary) !important;
    box-shadow: 0 16px 34px -14px rgba(47, 95, 208, 0.75) !important;
}

.auth-submit:hover {
    background: var(--auth-primary-dark) !important;
}

.auth-submit .submit-arrow {
    transition: transform 0.18s ease;
}

.auth-submit:hover .submit-arrow {
    transform: translateX(4px);
}

.auth-foot {
    margin-top: 22px;
    text-align: center;
    font-size: 14px;
    color: var(--auth-muted);
}

.auth-foot .auth-link-accent {
    font-size: 14px;
}

.auth-secure {
    margin-top: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-size: 12px;
    color: var(--auth-muted);
}

.auth-secure .mud-icon-root {
    color: var(--auth-success);
    font-size: 16px;
}

@keyframes auth-float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

@keyframes auth-breathe {
    0%, 100% { opacity: 0.6; transform: scale(0.92); }
    50% { opacity: 1; transform: scale(1.08); }
}

@keyframes auth-scan {
    0% { transform: translateY(0); opacity: 0; }
    15%, 85% { opacity: 0.75; }
    100% { transform: translateY(100vh); opacity: 0; }
}

@media (max-width: 900px) {
    .auth-shell {
        grid-template-columns: 1fr;
    }
    .auth-hero {
        display: none;
    }
    .auth-mobile-brand {
        display: flex;
    }
}

@media (prefers-reduced-motion: reduce) {
    .auth-logo-orbit,
    .auth-logo-halo,
    .auth-scanline {
        animation: none;
    }
}

/* ---------- App shell ---------- */
.erp-appbar {
    background: rgba(255, 255, 255, 0.85) !important;
    backdrop-filter: saturate(180%) blur(10px);
    border-bottom: 1px solid var(--erp-border);
    color: var(--erp-ink) !important;
}

.erp-appbar .mud-icon-button,
.erp-appbar .mud-text {
    color: var(--erp-ink) !important;
}

.erp-appbar-title {
    font-weight: 700 !important;
    letter-spacing: 0.2px;
    background: var(--erp-gradient);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.erp-drawer {
    border-right: 1px solid var(--erp-border) !important;
    background: #ffffff !important;
}

.erp-drawer-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 18px 18px 14px;
    font-weight: 700;
    color: var(--erp-ink);
}

.erp-drawer-brand .brand-badge {
    width: 34px;
    height: 34px;
    border-radius: 10px;
    background: var(--erp-gradient);
    color: #fff;
    display: grid;
    place-items: center;
}

.erp-nav .mud-nav-link {
    border-radius: 10px !important;
    margin: 2px 10px !important;
}

.erp-nav .mud-nav-link.active {
    background: rgba(37, 99, 235, 0.10) !important;
    color: var(--erp-primary) !important;
}

.erp-nav .mud-nav-link.active .mud-nav-link-icon {
    color: var(--erp-primary) !important;
}

.erp-content {
    padding: 26px;
}

/* ---------- Cards / surfaces ---------- */
.erp-paper {
    border-radius: var(--erp-radius) !important;
    border: 1px solid var(--erp-border) !important;
    box-shadow: 0 1px 2px rgba(2, 6, 23, 0.04) !important;
}

.erp-button-primary {
    border-radius: 10px !important;
    text-transform: none !important;
    font-weight: 600 !important;
}

/* ---------- Shared page furniture (Inventory / Finance / Reports) ---------- */
.erp-page-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
    margin-bottom: 18px;
}

.erp-page-head .erp-page-title {
    font-size: 26px;
    font-weight: 800;
    letter-spacing: 0.2px;
    color: var(--erp-ink);
    line-height: 1.15;
}

.erp-page-head .erp-page-sub {
    color: var(--erp-muted);
    font-size: 14px;
    margin-top: 2px;
}

.erp-section-head {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 14px;
}

.erp-section-head .erp-section-ico {
    width: 38px;
    height: 38px;
    border-radius: 11px;
    background: rgba(37, 99, 235, 0.10);
    color: var(--erp-primary);
    display: grid;
    place-items: center;
    flex: 0 0 auto;
}

.erp-section-head .erp-section-title {
    font-size: 17px;
    font-weight: 700;
    color: var(--erp-ink);
}

.erp-mono {
    font-variant-numeric: tabular-nums;
    font-feature-settings: "tnum";
}

/* Low-stock table row emphasis */
.erp-row-low td {
    background: rgba(245, 158, 11, 0.08) !important;
}

.erp-avatar-code {
    width: 34px;
    height: 34px;
    border-radius: 9px;
    display: grid;
    place-items: center;
    font-weight: 700;
    font-size: 13px;
    color: #fff;
    flex: 0 0 auto;
}

