/* ===== Self-hosted Inter (variable, SIL OFL — see fonts/inter-OFL.txt) ===== */
@font-face {
    font-family: 'Inter';
    font-style: normal;
    font-weight: 100 900;
    font-display: swap;
    src: url('fonts/inter-latin-wght-normal.woff2') format('woff2');
}

/* ===== Brand palette (from the POWERED UP! logo) ===== */
:root {
    --brand-pink: #cf4a9b;
    --brand-pink-rgb: 207, 74, 155;
    --brand-pink-dark: #b23d86;
    --brand-pink-darker: #8f2f6b;
    --brand-pink-050: #fbeef6;
    --brand-charcoal: #4b4d52;
    --brand-charcoal-rgb: 75, 77, 82;
    --brand-ink: #33343a;
    --sidebar-bg-top: #3d3f44;
    --sidebar-bg-bottom: #2c2d31;
    --page-bg: #f5f6f8;

    /* Bootstrap 5.3 variable overrides -> brand */
    --bs-primary: var(--brand-pink);
    --bs-primary-rgb: var(--brand-pink-rgb);
    --bs-link-color: var(--brand-pink-dark);
    --bs-link-color-rgb: 178, 61, 134;
    --bs-link-hover-color: var(--brand-pink-darker);
    --bs-link-hover-color-rgb: 143, 47, 107;

    /* Calmer, easier-on-the-eyes typography */
    --bs-body-color: #474a52;
    --bs-body-line-height: 1.55;
    --bs-heading-color: var(--brand-ink);
    --bs-border-color: #e7e8ec;
}

html, body {
    font-family: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background-color: var(--page-bg);
    color: #474a52;
    line-height: 1.55;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

h1, h2, h3, h4, h5, h6,
.h1, .h2, .h3, .h4, .h5, .h6 {
    color: var(--brand-ink);
    font-weight: 600;
    letter-spacing: -0.01em;
}

h1, .h1 { font-size: 1.8rem; }
h2, .h2 { font-size: 1.5rem; }
h3, .h3 { font-size: 1.25rem; }

/* Calmer, roomier tables — the main fix for the "crowded" feel */
.table {
    --bs-table-color: #474a52;
    --bs-table-border-color: #ececf0;
}
.table > :not(caption) > * > * {
    padding-top: 0.5rem;
    padding-bottom: 0.5rem;
}
.table-sm > :not(caption) > * > * {
    padding-top: 0.4rem;
    padding-bottom: 0.4rem;
}
.table-light {
    --bs-table-bg: #f6f7f9;
    --bs-table-color: #6b7079;
}
thead th {
    font-weight: 600;
}

.text-muted {
    color: #767a83 !important;
}

/* Tabular (fixed-width) figures so amounts line up cleanly in columns */
.table td.text-end,
.table th.text-end,
.tabular-nums {
    font-variant-numeric: tabular-nums;
}

/* App-wide edge spacing: when a table sits flush in a card — directly, or in a
   no-padding body (card-body p-0) — nudge the outer columns in so text isn't jammed
   against the card border. Cards whose body already has padding are unaffected. */
.card > .table > thead > tr > th:first-child,
.card > .table > tbody > tr > td:first-child,
.card > .table > tfoot > tr > td:first-child,
.card-body.p-0 .table > thead > tr > th:first-child,
.card-body.p-0 .table > tbody > tr > td:first-child,
.card-body.p-0 .table > tfoot > tr > td:first-child {
    padding-left: 1rem;
}

.card > .table > thead > tr > th:last-child,
.card > .table > tbody > tr > td:last-child,
.card > .table > tfoot > tr > td:last-child,
.card-body.p-0 .table > thead > tr > th:last-child,
.card-body.p-0 .table > tbody > tr > td:last-child,
.card-body.p-0 .table > tfoot > tr > td:last-child {
    padding-right: 1rem;
}

/* Centered full-page shell (login) with a branded backdrop */
.centered-shell {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
    background: linear-gradient(135deg, var(--sidebar-bg-top) 0%, var(--sidebar-bg-bottom) 100%);
}

.login-card {
    width: 100%;
    max-width: 23rem;
    background: #fff;
    border-radius: 0.9rem;
    box-shadow: 0 20px 55px rgba(0, 0, 0, 0.35);
    padding: 2rem 2rem 1.75rem;
}

.login-logo {
    width: 210px;
    max-width: 82%;
    height: auto;
}

/* Inline-edit field (save-on-blur with a ✓/⚠ flash) */
.inline-edit {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.inline-edit > input,
.inline-edit > textarea,
.inline-edit > select {
    flex: 1 1 auto;
    min-width: 0;
}

.inline-edit-flash {
    flex: 0 0 0.9rem;
    text-align: center;
    font-size: 0.9rem;
    line-height: 1;
}

/* Dashboard metric tiles */
.metric-tile {
    background: #fff;
    border: 1px solid #e8e9ee;
    border-left: 4px solid var(--tile-accent, var(--brand-charcoal));
    border-radius: 0.6rem;
    padding: 0.8rem 1rem;
    height: 100%;
    position: relative;   /* anchor for .metric-badge */
    transition: transform 0.12s ease, box-shadow 0.12s ease, border-color 0.12s ease;
}

a:hover > .metric-tile {
    transform: translateY(-2px);
    box-shadow: 0 6px 18px rgba(16, 17, 20, 0.10);
}

.metric-tile .metric-value {
    font-size: 1.7rem;
    font-weight: 700;
    line-height: 1.05;
    color: var(--tile-accent, var(--brand-ink));
    font-variant-numeric: tabular-nums;
}

.metric-tile .metric-label {
    font-size: 0.8rem;
    color: #767a83;
    margin-top: 0.1rem;
}

/* Attention badge in a tile's top-right corner (e.g. due/overdue follow-ups on the Open leads tile) */
.metric-badge {
    position: absolute;
    top: 0.5rem;
    right: 0.55rem;
    font-size: 0.7rem;
    font-weight: 600;
    padding: 0.2em 0.5em;
}

a, .btn-link {
    color: var(--brand-pink-dark);
}

a:hover, .btn-link:hover {
    color: var(--brand-pink-darker);
}

/* Primary buttons + badges -> brand pink (Bootstrap 5.3 component vars) */
.btn-primary {
    --bs-btn-bg: var(--brand-pink);
    --bs-btn-border-color: var(--brand-pink);
    --bs-btn-hover-bg: var(--brand-pink-dark);
    --bs-btn-hover-border-color: var(--brand-pink-dark);
    --bs-btn-active-bg: var(--brand-pink-dark);
    --bs-btn-active-border-color: var(--brand-pink-dark);
    --bs-btn-disabled-bg: var(--brand-pink);
    --bs-btn-disabled-border-color: var(--brand-pink);
    --bs-btn-focus-shadow-rgb: var(--brand-pink-rgb);
}

.btn-outline-primary {
    --bs-btn-color: var(--brand-pink-dark);
    --bs-btn-border-color: var(--brand-pink);
    --bs-btn-hover-bg: var(--brand-pink);
    --bs-btn-hover-border-color: var(--brand-pink);
    --bs-btn-active-bg: var(--brand-pink-dark);
    --bs-btn-active-border-color: var(--brand-pink-dark);
    --bs-btn-focus-shadow-rgb: var(--brand-pink-rgb);
}

/* Focus rings -> brand pink */
.btn:focus, .btn:active:focus, .btn-link.nav-link:focus, .form-control:focus, .form-check-input:focus {
    box-shadow: 0 0 0 0.1rem white, 0 0 0 0.25rem rgba(var(--brand-pink-rgb), 0.55);
}

.form-control:focus, .form-select:focus {
    border-color: var(--brand-pink);
    box-shadow: 0 0 0 0.2rem rgba(var(--brand-pink-rgb), 0.25);
}

.form-check-input:checked {
    background-color: var(--brand-pink);
    border-color: var(--brand-pink);
}

.form-check-input:focus {
    border-color: var(--brand-pink);
    box-shadow: 0 0 0 0.2rem rgba(var(--brand-pink-rgb), 0.25);
}

/* Cards lift off the light page background */
.card {
    border-color: #e8e9ee;
    border-radius: 0.55rem;
    box-shadow: 0 1px 2px rgba(16, 17, 20, 0.04);
}

.card-header {
    background-color: #fbfbfc;
    border-bottom-color: #edeef1;
}

.content {
    padding-top: 1.1rem;
}

h1:focus {
    outline: none;
}

.valid.modified:not([type=checkbox]) {
    outline: 1px solid #26b050;
}

.invalid {
    outline: 1px solid #e50000;
}

.validation-message {
    color: #e50000;
}

.blazor-error-boundary {
    background: url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNTYiIGhlaWdodD0iNDkiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIG92ZXJmbG93PSJoaWRkZW4iPjxkZWZzPjxjbGlwUGF0aCBpZD0iY2xpcDAiPjxyZWN0IHg9IjIzNSIgeT0iNTEiIHdpZHRoPSI1NiIgaGVpZ2h0PSI0OSIvPjwvY2xpcFBhdGg+PC9kZWZzPjxnIGNsaXAtcGF0aD0idXJsKCNjbGlwMCkiIHRyYW5zZm9ybT0idHJhbnNsYXRlKC0yMzUgLTUxKSI+PHBhdGggZD0iTTI2My41MDYgNTFDMjY0LjcxNyA1MSAyNjUuODEzIDUxLjQ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ny4zODcgODkuNzkyMSAyNjcuMzg3IDg3LjMwMDUgMjY2LjExNiA4Ni4wNTQ3IDI2My41NzYgODYuMDU0N1oiIGZpbGw9IiNGRkU1MDAiIGZpbGwtcnVsZT0iZXZlbm9kZCIvPjwvZz48L3N2Zz4=) no-repeat 1rem/1.8rem, #b32121;
    padding: 1rem 1rem 1rem 3.7rem;
    color: white;
}

    .blazor-error-boundary::after {
        content: "An error has occurred."
    }

.darker-border-checkbox.form-check-input {
    border-color: #929292;
}

.form-floating > .form-control-plaintext::placeholder, .form-floating > .form-control::placeholder {
    color: var(--bs-secondary-color);
    text-align: end;
}

.form-floating > .form-control-plaintext:focus::placeholder, .form-floating > .form-control:focus::placeholder {
    text-align: start;
}

/* ============================================================================
   Global form field hierarchy (lifted from the deal screen, app-wide):
   quiet uppercase labels vs. plain-dark values in subtle-fill "data cells".
   ============================================================================ */
.form-label {
    text-transform: uppercase;
    font-size: 0.66rem;
    letter-spacing: 0.06em;
    font-weight: 600;
    color: var(--bs-secondary-color);
    opacity: 0.9;
    margin-bottom: 0.05rem;
}

.form-control,
.form-select {
    font-weight: 400;
    color: var(--bs-body-color);
    background-color: var(--bs-tertiary-bg);
}

.form-control:focus,
.form-select:focus {
    background-color: var(--bs-body-bg);
}

.form-control::placeholder {
    font-weight: 400;
    color: var(--bs-secondary-color);
    opacity: 0.6;
}

/* Contract-ID pill — a clickable outline pill (fills pink on hover) used for the deal link on the
   /deals list (table + mobile card) and the dashboard Pending Contracts table. Pair with .badge.rounded-pill.
   Shows the Contract ID, or "View Deal" when the deal has none yet. */
.contract-pill {
    text-decoration: none;
    border: 1px solid var(--brand-pink, #cf4a9b);
    background: var(--bs-body-bg, #fff);
    color: var(--brand-pink, #cf4a9b);
    font-weight: 600;
    /* Consistent size everywhere: the deals list bumps its badges to 0.78rem, but the dashboard Pending
       Contracts table (0.85rem font) would otherwise shrink the pill to ~0.64rem via .badge's 0.75em. */
    font-size: 0.78rem;
}

.contract-pill:hover {
    background: var(--brand-pink, #cf4a9b);
    color: #fff;
}

/* Customer name / link — the bold anchor of each row across the Leads, Deals, and Pending Contracts lists
   (desktop tables + mobile cards). One shared definition so the three surfaces stay consistent. Colour stays
   per-context: tables render it as the link colour (pink); cards recolour it charcoal via their own rules. */
.cust-name {
    font-size: 1rem;
    font-weight: 600;
}
