:root {
    --milnavo-purple: #35106f;
    --milnavo-gold: #d99614;
    --surface: #ffffff;
    --page: #f5f6f8;
    --border: #dde1e7;
}

body {
    background: var(--page);
    color: #20242a;
}

.brand-logo {
    width: 150px;
    height: 58px;
    object-fit: contain;
}

.navbar {
    min-height: 78px;
}

.navbar-brand {
    min-width: 166px;
}

.row-main-link {
    color: inherit;
    text-decoration: none;
}

.clickable-row {
    cursor: pointer;
}

.clickable-row:hover > * {
    background-color: #f3f4f6 !important;
}

.compact-metric {
    min-width: 180px;
    padding: 14px 18px;
}

.nav-tabs-wrap {
    gap: 6px;
}

.nav-tabs-wrap .nav-link {
    border: 1px solid transparent;
    border-radius: 8px;
    color: #333946;
    padding: 9px 14px;
}

.nav-tabs-wrap .nav-link:hover {
    background: #f3f7f8;
    border-color: #d9e4e7;
}

.nav-tabs-wrap .nav-link.active {
    background: #eaf8f8;
    border-color: #66bfc5;
    color: #075f68;
    font-weight: 600;
}

.dashboard-logo {
    width: 62px;
    height: 62px;
    object-fit: contain;
}

.login-shell {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 24px;
    background: linear-gradient(135deg, #f8f5ff, #fff9ee);
}

.login-card {
    width: min(100%, 420px);
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 32px;
    box-shadow: 0 16px 50px rgba(28, 18, 56, .12);
}

.login-logo {
    display: block;
    width: 180px;
    max-width: 100%;
    margin: 0 auto 20px;
}

.section-panel,
.metric {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 20px;
}

.metric span {
    display: block;
    color: #68707c;
    font-size: .9rem;
}

.metric strong {
    display: block;
    font-size: 2rem;
    line-height: 1.1;
    color: var(--milnavo-purple);
}

.form-narrow {
    max-width: 680px;
}

.btn-primary {
    --bs-btn-bg: var(--milnavo-purple);
    --bs-btn-border-color: var(--milnavo-purple);
    --bs-btn-hover-bg: #260a55;
    --bs-btn-hover-border-color: #260a55;
}

.invoice-total-preview {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 16px 18px;
    background: #fafbfc;
}

.invoice-total-preview strong {
    font-size: 1.6rem;
    color: var(--milnavo-purple);
}

.invoice-print {
    width: 210mm;
    min-height: 297mm;
    margin: 0 auto;
    background: #fff;
    padding: 0 14mm;
    border: 1px solid var(--border);
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.invoice-ribbon {
    height: 7.5mm;
    background: linear-gradient(90deg, #10a6ad 0 100%);
    margin-left: -14mm;
    margin-right: -14mm;
    position: relative;
    overflow: hidden;
}

.invoice-ribbon-top {
    margin-top: 9mm;
    margin-bottom: 14mm;
}

.invoice-ribbon::before,
.invoice-ribbon::after,
.invoice-ribbon span::before {
    content: "";
    position: absolute;
    top: -3mm;
    width: 3.2mm;
    height: 15mm;
    background: #0b203d;
    transform: skewX(-32deg);
}

.invoice-ribbon::before {
    left: 43%;
}

.invoice-ribbon::after {
    left: calc(43% + 5mm);
}

.invoice-ribbon span::before {
    left: calc(43% + 2.7mm);
    background: #ffffff;
}

.invoice-ribbon-bottom {
    margin-top: 42px;
}

.invoice-brand-row {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 10mm;
    margin-bottom: 14mm;
}

.invoice-to,
.invoice-number-box {
    width: 32%;
}

.invoice-wordmark {
    color: #078996;
    font-size: 2.35rem;
    font-weight: 900;
    line-height: 1;
    text-align: center;
    width: 24%;
    letter-spacing: .5px;
    padding-top: 1mm;
}

.invoice-to h3,
.invoice-number-box h1,
.invoice-terms h3 {
    color: #0a8b95;
    text-transform: uppercase;
    letter-spacing: 0;
    margin-bottom: 4px;
}

.invoice-to h3 {
    font-size: 1rem;
}

.invoice-to h2 {
    color: #111827;
    font-size: 1.55rem;
    margin: 0;
}

.invoice-to p,
.invoice-number-box p {
    margin-bottom: 2px;
}

.invoice-number-box h1 {
    font-size: 2.05rem;
}

.invoice-number-box span {
    display: inline-block;
    min-width: 96px;
}

.invoice-only-number {
    font-size: 1rem;
    margin: 2mm 0;
}

.invoice-lines {
    margin-top: 0;
}

.invoice-lines thead th {
    color: #111827;
    text-transform: uppercase;
    border-bottom: 2px solid #0aa1aa;
}

.invoice-lines tbody td {
    border-bottom: 2px solid #72c8cd;
    padding-top: 14px;
    padding-bottom: 14px;
}

.invoice-bottom-row {
    display: flex;
    justify-content: space-between;
    gap: 32px;
    margin-top: auto;
    padding-top: 14mm;
}

.invoice-terms {
    max-width: 430px;
}

.invoice-terms h3 {
    font-size: 1.1rem;
}

.invoice-sign {
    display: block !important;
    text-align: center;
    border-bottom: 0 !important;
    border-top: 1px solid #303846;
    margin-top: 34px;
    padding-top: 8px !important;
}

.invoice-summary {
    width: min(100%, 360px);
}

.invoice-summary div {
    display: flex;
    justify-content: space-between;
    border-bottom: 1px solid var(--border);
    padding: 10px 0;
}

.invoice-summary .grand {
    font-size: 1.25rem;
    color: #0a8b95;
}

.invoice-footer-strip {
    min-height: 11mm;
    background: #10a6ad;
    margin: 12mm -14mm 0;
    color: #fff;
    display: grid;
    grid-template-columns: 1fr 1.2fr 30mm 1.2fr;
    align-items: center;
    gap: 5mm;
    padding: 0 12mm;
    font-size: .78rem;
    position: relative;
}

.invoice-footer-strip > div {
    display: flex;
    align-items: center;
    gap: 2mm;
    min-width: 0;
}

.footer-dot {
    width: 4mm;
    height: 4mm;
    border-radius: 50%;
    background: #0b203d;
    flex: 0 0 auto;
}

.footer-center-mark {
    height: 100%;
    justify-self: center;
    width: 24mm;
    position: relative;
}

.footer-center-mark::before,
.footer-center-mark::after {
    content: "";
    position: absolute;
    top: -2mm;
    width: 3mm;
    height: 16mm;
    background: #0b203d;
    transform: skewX(-32deg);
}

.footer-center-mark::before {
    left: 6mm;
}

.footer-center-mark::after {
    left: 12mm;
    box-shadow: 4mm 0 0 #fff;
}

@media (max-width: 768px) {
    .invoice-brand-row,
    .invoice-bottom-row {
        display: block;
    }

    .invoice-to,
    .invoice-number-box,
    .invoice-wordmark,
    .invoice-summary {
        width: 100%;
    }

    .invoice-wordmark {
        text-align: left;
        margin: 24px 0;
    }
}

@media print {
    @page {
        size: A4;
        margin: 0;
    }

    .navbar,
    .print-actions,
    .alert {
        display: none !important;
    }

    body,
    main {
        background: #fff !important;
        padding: 0 !important;
    }

    .invoice-print {
        border: 0;
        width: 210mm;
        min-height: 297mm;
        padding: 0 14mm;
        box-shadow: none;
    }
}
