/* ===========================
   PWTERP Professional Layout
   =========================== */

/* ===========================
   Global Base (Professional)
   Put this at TOP of app.css
   =========================== */

:root {
    --bg: #f6f7fb;
    --card: #ffffff;
    --text: #111827;
    --muted: #6b7280;
    --border: rgba(0,0,0,.08);
    --shadow: 0 12px 30px rgba(0,0,0,.07);
    --shadow-soft: 0 10px 28px rgba(0,0,0,.06);
    --radius: 16px;
}

* {
    box-sizing: border-box;
}

html, body {
    height: 100%;
}

body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font-family: system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
}

/* Make all links not look “default blue underlined” */
a {
    color: inherit;
    text-decoration: none;
}

    a:hover {
        text-decoration: none;
    }

/* Bootstrap buttons and inputs polish */
.btn {
    border-radius: 12px;
    font-weight: 800;
}

.btn-lg {
    border-radius: 14px;
}

.btn-sm {
    border-radius: 10px;
}

.form-control, .form-select, .input-group-text {
    border-radius: 12px;
    border-color: var(--border);
}

    .form-control:focus, .form-select:focus {
        box-shadow: 0 0 0 0.2rem rgba(37,99,235,.12);
        border-color: rgba(37,99,235,.45);
    }

/* Common page helpers */
.page-title {
    font-weight: 900;
    margin: 0;
}

.page-subtitle {
    color: var(--muted);
    margin-top: 4px;
}

.card-soft {
    background: var(--card);
    border: 1px solid rgba(0,0,0,.06);
    border-radius: var(--radius);
    box-shadow: var(--shadow-soft);
}

.card-soft-head {
    padding: 14px 16px;
    border-bottom: 1px solid rgba(0,0,0,.06);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.card-soft-body {
    padding: 14px 16px;
}

.table-card {
    overflow: hidden;
}

    .table-card table {
        margin: 0;
    }

.table thead th {
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: .08em;
    color: #374151;
}

.table tbody td {
    vertical-align: middle;
}

/* Small pill badges (reuse in Sales list / dashboard) */
.pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 10px;
    border-radius: 999px;
    font-weight: 800;
    font-size: 12px;
    border: 1px solid rgba(0,0,0,.08);
}

.pill.ok {
    background: rgba(16,185,129,.12);
    color: #065f46;
    border-color: rgba(16,185,129,.25);
}

.pill.warn {
    background: rgba(245,158,11,.14);
    color: #92400e;
    border-color: rgba(245,158,11,.30);
}

.pill.danger {
    background: rgba(239,68,68,.12);
    color: #7f1d1d;
    border-color: rgba(239,68,68,.25);
}

/* Fix link color inside sidebar so your earlier rule never breaks it */
.erp-sidebar a {
    color: rgba(255,255,255,.92) !important;
}


/* Reset / safety for layout */
html, body {
    height: 100%;
}

.erp-shell {
    min-height: 100vh;
    display: flex;
    background: #f6f7fb;
}

/* ===== Sidebar ===== */
.erp-sidebar {
    width: 270px;
    flex: 0 0 270px;
    padding: 14px;
    color: #fff;
    background: radial-gradient(1200px 600px at -10% -20%, rgba(255,255,255,.18), transparent 45%), linear-gradient(180deg, #0b1d3a 0%, #2b135a 100%);
    border-right: 1px solid rgba(255,255,255,.10);
    position: sticky;
    top: 0;
    height: 100vh;
    overflow-y: auto;
}

.erp-brand {
    padding: 14px 14px;
    border-radius: 14px;
    background: rgba(255,255,255,.10);
    box-shadow: inset 0 0 0 1px rgba(255,255,255,.08);
    margin-bottom: 14px;
}

.erp-brand-name {
    font-weight: 900;
    letter-spacing: .5px;
    font-size: 18px;
    line-height: 1.1;
}

.erp-brand-sub {
    font-size: 12px;
    opacity: .75;
    margin-top: 4px;
}

.erp-nav {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.erp-nav-link {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 11px 12px;
    border-radius: 12px;
    /* IMPORTANT: override your global a{} rule */
    color: rgba(255,255,255,.92) !important;
    text-decoration: none !important;
    font-weight: 650;
    transition: background .15s ease, transform .15s ease, box-shadow .15s ease;
}

    .erp-nav-link:hover {
        background: rgba(255,255,255,.12);
        color: #fff !important;
        transform: translateY(-1px);
    }

    .erp-nav-link.active {
        background: rgba(255,255,255,.18);
        box-shadow: inset 0 0 0 1px rgba(255,255,255,.14);
        color: #fff !important;
    }

.erp-ico {
    width: 22px;
    text-align: center;
    opacity: .95;
}

.erp-text {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* section */
.erp-nav-section {
    margin-top: 12px;
    padding-top: 10px;
    border-top: 1px solid rgba(255,255,255,.14);
}

.erp-nav-section-title {
    padding: 6px 10px 8px 10px;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: .12em;
    opacity: .72;
}

.erp-nav-link-child {
    margin-left: 10px;
    padding-left: 12px;
}

/* ===== Main / Topbar ===== */
.erp-main {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
}

.erp-topbar {
    height: 64px;
    background: #fff;
    border-bottom: 1px solid rgba(0,0,0,.08);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 18px;
}

.erp-topbar-left {
    display: flex;
    flex-direction: column;
    line-height: 1.15;
}

.erp-topbar-title {
    font-weight: 900;
    font-size: 16px;
    color: #111827;
}

.erp-topbar-subtitle {
    font-size: 12px;
    color: #6b7280;
    margin-top: 3px;
}

.erp-topbar-link {
    color: #2563eb !important;
    text-decoration: none !important;
    font-weight: 800;
    padding: 8px 10px;
    border-radius: 10px;
}

.erp-topbar-link:hover {
    background: rgba(37,99,235,.08);
}

/* ===== Content ===== */
.erp-content {
    padding: 20px 22px;
}

/* ===== Responsive ===== */
@media (max-width: 768px) {
    .erp-shell {
        flex-direction: column;
    }

    .erp-sidebar {
        width: 100%;
        flex: 0 0 auto;
        height: auto;
        position: relative;
    }
}

/* container so button never overlaps submenu */
.erp-nav-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

/* make the sales button behave exactly like a link */
.erp-collapse-btn {
    width: 100%;
    border: 0;
    background: transparent;
    text-align: left;
    cursor: pointer;
}

/* caret */
.erp-caret {
    margin-left: auto;
    opacity: .75;
    transition: transform .15s ease;
    font-size: 14px;
}

    .erp-caret.open {
        transform: rotate(90deg);
    }

/* submenu open/close (smooth) */
.erp-submenu {
    margin-left: 10px;
    padding-left: 10px;
    border-left: 1px solid rgba(255,255,255,.14);
    display: none; /* IMPORTANT */
}

.erp-submenu.open {
    display: block; /* IMPORTANT */
}

/* ===== Auth (Login) ===== */
.auth-shell {
    min-height: calc(100vh - 64px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
}

.auth-card {
    width: min(980px, 100%);
    border-radius: 18px;
    overflow: hidden;
    display: grid;
    grid-template-columns: 1.05fr 1fr;
    background: #fff;
    box-shadow: 0 18px 60px rgba(0,0,0,.10);
    border: 1px solid rgba(0,0,0,.06);
}

.auth-left {
    padding: 28px;
    color: #fff;
    background: radial-gradient(900px 500px at 0% 0%, rgba(255,255,255,.18), transparent 50%), linear-gradient(180deg, #0b1d3a 0%, #2b135a 100%);
}

.brand {
    display: flex;
    gap: 12px;
    align-items: center;
    margin-bottom: 22px;
}

.brand-logo {
    width: 46px;
    height: 46px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255,255,255,.16);
    font-weight: 900;
    letter-spacing: .5px;
}

.brand-name {
    font-weight: 900;
    font-size: 18px;
    line-height: 1.1;
}

.brand-sub {
    opacity: .8;
    font-size: 12px;
    margin-top: 3px;
}

.auth-hero {
    margin-top: 18px;
}

.hero-title {
    font-size: 28px;
    font-weight: 900;
    line-height: 1.1;
}

.hero-sub {
    margin-top: 10px;
    opacity: .85;
}

.hero-points {
    list-style: none;
    padding: 0;
    margin: 18px 0 0 0;
    display: grid;
    gap: 10px;
    opacity: .92;
}

.auth-right {
    padding: 28px;
}

.auth-title {
    font-weight: 900;
    margin-bottom: 4px;
}

.auth-muted {
    color: #6b7280;
    margin-bottom: 16px;
}

.auth-link {
    text-decoration: none;
    font-weight: 700;
}

.auth-footer {
    margin-top: 18px;
    font-size: 12px;
    text-align: center;
}

@media (max-width: 900px) {
    .auth-card {
        grid-template-columns: 1fr;
    }

    .auth-left {
        display: none;
    }
}

/* ===== Dashboard (Home) ===== */
.dash {
    max-width: 1200px;
    margin: 0 auto;
}

.dash-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    gap: 12px;
    margin-bottom: 16px;
}

.dash-title {
    font-weight: 900;
    margin: 0;
}

.dash-sub {
    color: #6b7280;
    margin-top: 4px;
}

    .dash-sub .dot {
        margin: 0 8px;
        opacity: .6;
    }

.dash-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.dash-skeleton {
    background: #fff;
    border: 1px solid rgba(0,0,0,.06);
    border-radius: 16px;
    padding: 18px;
    box-shadow: 0 10px 30px rgba(0,0,0,.06);
}

/* KPI cards */
.kpi-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px;
    margin-bottom: 14px;
}

.kpi-card {
    background: #fff;
    border: 1px solid rgba(0,0,0,.06);
    border-radius: 16px;
    padding: 14px 14px;
    box-shadow: 0 10px 28px rgba(0,0,0,.06);
}

.kpi-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.kpi-label {
    color: #6b7280;
    font-weight: 700;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: .08em;
}

.kpi-ico {
    font-size: 18px;
    opacity: .9;
}

.kpi-value {
    font-size: 28px;
    font-weight: 900;
    margin-top: 8px;
}

.kpi-foot {
    color: #6b7280;
    font-size: 12px;
    margin-top: 4px;
}

.kpi-accent {
    border-color: rgba(37,99,235,.22);
    box-shadow: 0 10px 28px rgba(37,99,235,.10);
}

/* Panels */
.dash-row {
    display: grid;
    grid-template-columns: 1.6fr 1fr;
    gap: 12px;
}

.panel {
    background: #fff;
    border: 1px solid rgba(0,0,0,.06);
    border-radius: 16px;
    box-shadow: 0 10px 28px rgba(0,0,0,.06);
    overflow: hidden;
}

.panel-head {
    padding: 14px 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid rgba(0,0,0,.06);
}

.panel-title {
    font-weight: 900;
}

.panel-sub {
    color: #6b7280;
    font-size: 12px;
    margin-top: 2px;
}

.panel-actions {
    display: flex;
    gap: 10px;
}

.panel-foot {
    padding: 12px 16px;
    border-top: 1px solid rgba(0,0,0,.06);
    color: #6b7280;
}

/* Quick actions */
.qa-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    padding: 14px 16px 16px 16px;
}

.qa {
    width: 100%;
    display: flex;
    gap: 12px;
    padding: 12px 12px;
    border-radius: 14px;
    border: 1px solid rgba(0,0,0,.08);
    background: #fff;
    text-align: left;
    cursor: pointer;
    transition: transform .15s ease, box-shadow .15s ease;
}

    .qa:hover {
        transform: translateY(-1px);
        box-shadow: 0 10px 20px rgba(0,0,0,.07);
    }

.qa-ico {
    width: 40px;
    height: 40px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(37,99,235,.10);
    font-size: 18px;
}

.qa-title {
    font-weight: 900;
}

.qa-sub {
    color: #6b7280;
    font-size: 12px;
    margin-top: 2px;
}

/* Snapshot */
.snap {
    padding: 14px 16px 16px 16px;
}

.snap-row {
    display: flex;
    justify-content: space-between;
    padding: 10px 0;
    border-bottom: 1px dashed rgba(0,0,0,.10);
}

    .snap-row:last-child {
        border-bottom: 0;
    }

.snap-label {
    color: #6b7280;
}

.snap-value {
    font-weight: 800;
    color: #111827;
}

.snap-actions {
    display: flex;
    gap: 10px;
    margin-top: 14px;
}

/* Badges */
.badge-soft {
    display: inline-flex;
    align-items: center;
    padding: 6px 10px;
    border-radius: 999px;
    font-weight: 800;
    font-size: 12px;
    border: 1px solid rgba(0,0,0,.08);
}

    .badge-soft.ok {
        background: rgba(16,185,129,.12);
        color: #065f46;
        border-color: rgba(16,185,129,.25);
    }

    .badge-soft.warn {
        background: rgba(245,158,11,.14);
        color: #92400e;
        border-color: rgba(245,158,11,.30);
    }

    .badge-soft.danger {
        background: rgba(239,68,68,.12);
        color: #7f1d1d;
        border-color: rgba(239,68,68,.25);
    }

.mono {
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
}

/* Responsive */
@media (max-width: 1100px) {
    .kpi-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .dash-row {
        grid-template-columns: 1fr;
    }
}
/* =====================================================
   PRINT MODE
   Print only the Razor page body, without ERP layout
   ===================================================== */

@media print {

    /* Hide the complete navigation and toolbar */
    .erp-sidebar,
    .erp-topbar,
    .no-print {
        display: none !important;
    }

    /* Remove flex layout restrictions */
    .erp-shell {
        display: block !important;
        min-height: auto !important;
        width: 100% !important;
        background: #ffffff !important;
    }

    /* Make the main page occupy full printable width */
    .erp-main {
        display: block !important;
        width: 100% !important;
        min-width: 0 !important;
        margin: 0 !important;
        padding: 0 !important;
    }

    /* Remove the normal application content spacing */
    .erp-content {
        width: 100% !important;
        max-width: none !important;
        margin: 0 !important;
        padding: 0 !important;
    }

    html,
    body {
        width: 100% !important;
        height: auto !important;
        margin: 0 !important;
        padding: 0 !important;
        background: #ffffff !important;
        overflow: visible !important;
    }

    /* Print only the bid view area */
    .bid-print-page {
        display: block !important;
        width: 100% !important;
        max-width: none !important;
        margin: 0 !important;
        padding: 0 !important;
        background: #ffffff !important;
    }

        /* Remove Bootstrap shadows while printing */
        .bid-print-page .card {
            box-shadow: none !important;
            border: 1px solid #999 !important;
        }

        /* Prevent responsive wrappers from clipping tables */
        .bid-print-page .table-responsive {
            overflow: visible !important;
        }

        /* Improve print colors */
        .bid-print-page,
        .bid-print-page * {
            -webkit-print-color-adjust: exact !important;
            print-color-adjust: exact !important;
        }
}

@page {
    size: A4 landscape;
    margin: 10mm;
}
