@import url('open-iconic/font/css/open-iconic-bootstrap.min.css');

html, body {
    font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
}

h1:focus {
    outline: none;
}

a, .btn-link {
    color: #0071c1;
}

.btn-primary {
    color: #fff;
    background-color: #1b6ec2;
    border-color: #1861ac;
}

.content {
    padding-top: 1.1rem;
}

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

.invalid {
    outline: 1px solid red;
}

.validation-message {
    color: red;
}

#blazor-error-ui {
    background: lightyellow;
    bottom: 0;
    box-shadow: 0 -1px 2px rgba(0, 0, 0, 0.2);
    display: none;
    left: 0;
    padding: 0.6rem 1.25rem 0.7rem 1.25rem;
    position: fixed;
    width: 100%;
    z-index: 1000;
}

    #blazor-error-ui .dismiss {
        cursor: pointer;
        position: absolute;
        right: 0.75rem;
        top: 0.5rem;
    }

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

    .blazor-error-boundary::after {
        content: "An error has occurred."
    }
.pa-4 {
    padding: 1rem;
}

.ml-2 {
    margin-left: .5rem;
}

.mb-2 {
    margin-bottom: .5rem;
}

.mb-3 {
    margin-bottom: .75rem;
}

.mb-4 {
    margin-bottom: 1rem;
}
:root {
    --brand-surface: #ffffff;
    --brand-surface-2: #f8fafc;
    --brand-border: #e5e7eb;
    --brand-head: #f3f4f6;
}

/* Generic table used in your pages */
.table {
    width: 100%;
    border-collapse: collapse;
}

    .table th, .table td {
        border-bottom: 1px solid var(--mud-palette-lines-default);
        padding: 8px;
    }

    .table thead th {
        background: var(--mud-palette-background-gray);
        color: var(--mud-palette-text-primary);
    }

    .table tbody tr:hover {
        background: #f8fafc;
    }
.auth-shell {
    min-height: 100vh;
    display: grid;
    place-items: center;
    background: var(--mud-palette-background);
}
.login-bg {
    min-height: calc(100vh - 64px);
    background: linear-gradient(180deg, #0a2f57 0%, #033a68 100%);
    display: flex;
    align-items: center;
    justify-content: center;
}
.login-card {
    background: var(--mud-palette-surface, #fff);
    color: var(--mud-palette-text-primary, #0f172a);
    padding: 24px 28px;
    border-radius: 16px;
    box-shadow: 0 8px 24px rgba(0,0,0,.15);
    width: 100%;
    max-width: 460px;
}

/* dark theme tweaks for login card */
.mud-theme-dark .login-card {
    background: var(--mud-palette-surface, #1e1e1e);
    color: var(--mud-palette-text-primary, rgba(255,255,255,0.95));
    box-shadow: 0 8px 24px rgba(0,0,0,0.6);
}
.w-full {
    width: 100%;
}


/*.table {
    width: 100%;
    border-collapse: collapse;
    background: var(--brand-surface);
    border-radius: 12px;
    overflow: hidden;
}

    .table thead th {
        background: var(--brand-head);
        font-weight: 600;
        text-align: left;
        padding: .65rem .75rem;
        border-bottom: 1px solid var(--brand-border);
    }

    .table tbody td {
        padding: .6rem .75rem;
        border-bottom: 1px solid var(--brand-border);
    }

    .table tbody tr:hover {
        background: var(--brand-surface-2);
    }*/

/* Simple buttons (for your non-Mud <a class="btn"> and <button class="btn">) */
.btn {
    display: inline-block;
    padding: .45rem .7rem;
    border-radius: 10px;
    border: 1px solid #cbd5e1;
    background: #fff;
    color: #0f172a;
    text-decoration: none;
    cursor: pointer;
    line-height: 1;
}

    .btn:hover {
        background: #f8fafc;
    }

    .btn.danger {
        border-color: #fecaca;
        color: #b91c1c;
        background: #fff0f1;
    }

/* Center the page and constrain width */
.page-content {
    display: flex;
    justify-content: center;
    padding: 16px;
}

.page-shell {
    width: 100%;
    max-width: 1300px;
}
/*.page-shell {
    padding: 12px;
}*/

.page-card {
   /* background-color: var(--mud-palette-surface);*/
    border: 1px solid var(--mud-palette-lines-default);
    border-radius: 16px;
    box-shadow: var(--mud-elevation-2);
    padding: 16px;
}

.page-toolbar {
    display: flex;
    gap: 12px;
    align-items: flex-end;
    flex-wrap: wrap;
}

/* Keep logos / images theme-aware */
.logo-preview {
    background-color: var(--mud-palette-surface);
    border: 1px solid var(--mud-palette-lines-default);
    border-radius: 8px;
    padding: 4px;
}
    max-height: 80px;
    max-width: 280px;
    object-fit: contain;

/* User menu activator styling */
.user-activator { cursor: pointer; }
.user-name-box { display: flex; flex-direction: column; margin-left: 8px; line-height:1; }
.user-name { font-weight: 700; padding: 4px 8px; border-radius: 6px; background: rgba(255, 255, 255, 0.06); }
.user-sub { margin-top: -2px; color: rgba(255, 255, 255, 0.9); font-size:0.75rem }
.user-caret { margin-left: 6px; }

/* Menu item alignment: keep icon + text on single line and center vertically */
.mud-menu .mud-menu-item,
.mud-menu .mud-list-item,
.mud-menu .mud-list-item-root {
    display: flex !important;
    align-items: center !important;
    gap: 12px;
    white-space: nowrap;
}

.mud-menu .mud-icon-root {
    /* make icons consistent size and not wrap */
    font-size: 20px;
    width: 24px;
    height: 24px;
}

/* Ensure menu text does not get extra line-height and is vertically centered */
.mud-menu .mud-typography {
    line-height: 1.1;
}

/* Charts should be transparent so the card color shows */
.mud-chart canvas {
    background-color: transparent !important;
}
.login-host {
    min-height: 100vh;
    display: grid;
    place-items: center;
    background: var(--mud-palette-background);
    padding: 16px;
}

/* Ensure icons in appbar/drawer/rows keep good contrast in dark mode */
.invoice-download-icon svg, .mud-nav-link .mud-icon-root, .mud-appbar .mud-icon-root,
.mud-icon-button .mud-icon-root {
    fill: currentColor; /* inherit color from parent */
}

/* Force action icons to use primary/inherit color depending on theme */
.mud-theme-dark .mud-icon-button.invoice-download-icon {
    color: var(--mud-palette-primary);
}

/* Make sure drawer icons are visible in dark by inheriting drawer text color */
.mud-theme-dark .mud-nav-menu .mud-nav-link .mud-icon-root {
    color: var(--mud-palette-text-primary);
}

/* Sticky layout: header + main + footer */
.app-shell {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.app-body {
    flex: 1 0 auto;
}
/* main grows */
.app-footer {
    flex-shrink: 0;
}
/* footer sticks to bottom */
.drawer-column {
    display: flex;
    flex-direction: column;
    height: 100%;
}

.drawer-menu {
    flex: 1 1 auto;
    overflow: auto;
}
/* menu takes remaining space */
.drawer-footer {
    margin-top: auto;
}
/* sticks at bottom */

/* --- Invoice table layout --- */
.table-invoices .mud-table-cell {
    vertical-align: middle;
}

/* Make the number column wide enough for prefix + date + seq */
.table-invoices .col-no {
    width: 260px;
    white-space: nowrap;
}

/* Doc type is short */
.table-invoices .col-type {
    width: 120px;
    white-space: nowrap;
}

/* Let client take the remaining space, but keep it neat */
.table-invoices .col-client {
    min-width: 240px;
    max-width: 420px;
}

/* Date/Total/Status are compact and predictable */
.table-invoices .col-date {
    width: 100px;
    white-space: nowrap;
}

.table-invoices .col-total {
    width: 120px;
    white-space: nowrap;
    text-align: right;
}

.table-invoices .col-status {
    width: 100px;
    white-space: nowrap;
}

/* Actions at the far right */
.table-invoices .col-actions {
    width: 140px;
    text-align: right;
    white-space: nowrap;
}

/* Monospaced number for nicer alignment */
.table-invoices .mono {
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
}

/* Tidy truncation for long client names */
.table-invoices .ellipsis {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    display: block;
}

.page-card {
    overflow: hidden;
}
/* keep inputs compact and aligned */
.mud-table .w-100 {
    width: 100%;
}

.mud-table td, .mud-table th {
    vertical-align: middle;
}

    /* give number columns a comfortable min width */
    .mud-table td[align="right"], .mud-table th[align="right"] {
        min-width: 88px;
    }

/* make header rows visually distinct */
tr.header-row td {
    background: #F7F9FC; /* soft panel */
    border-top: 1px solid #D9DEE3;
    border-bottom: 1px solid #D9DEE3;
    font-weight: 600;
}
.header-row td {
    background: #f7f9fc !important;
    border-top: 1px solid #D9DEE3;
    border-bottom: 1px solid #D9DEE3;
    font-weight: 600;
}