@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+PHBhdGggZD0iTTI2My41MDYgNTFDMjY0LjcxNyA1MSAyNjUuODEzIDUxLjQ4MzcgMjY2LjYwNiA1Mi4yNjU4TDI2Ny4wNTIgNTIuNzk4NyAyNjcuNTM5IDUzLjYyODMgMjkwLjE4NSA5Mi4xODMxIDI5MC41NDUgOTIuNzk1IDI5MC42NTYgOTIuOTk2QzI5MC44NzcgOTMuNTEzIDI5MSA9NC4wODE1IDI5MSA5NC42NzgyIDI5MSA5Ny4wNjUxIDI4OS4wMzggOTkgMjg2LjYxNyA5OUwyNDAuMzgzIDk5QzIzNy45NjMgOTkgMjM2IDk3LjA2NTEgMjM2IDk0LjY3ODIgMjM2IDk0LjM3OTkgMjM2LjAzMSA5NC4wODg2IDIzNi4wODkgOTMuODA3MkwyMzYuMzM4IDkzLjAxNjIgMjM2Ljg1OCA5Mi4xMzE0IDI1OS40NzMgNTMuNjI5NCAyNTkuOTYxIDUyLjc5ODUgMjYwLjQwNyA1Mi4yNjU4QzI2MS4yIDUxLjQ4MzcgMjYyLjI5NiA1MSAyNjMuNTA6OjUxWk0yNjMuNTg2IDY2LjAxODNDMjYwLjczNyA2Ni4wMTgzIDI1OS4zMTMgNjcuMTI0NSAyNTkuMzEzIDY5LjMzNyAyNTkuMzEzIDY5LjYxMDIgMjU5LjMzMiA2OS44NjA4IDI1OS4zNzEgNzAuMDg4N0wyNjEuNzk1IDg0LjAxNjEgMjY1LjM4IDg0LjAxNjEgMjY3LjgyMSA2OS43NDc1QzI2Ny44NiA2OS43MzA5IDI2Ny44NzkgNjkuNTg3NyAyNjcuODc5IDY5LjMxNzkgMjY3Ljg3OSA2Ny4xMTgyIDI2Ni40NDg2IDY2LjAxODSaSBkYXJrc2NhbGUtaW1hZ2UgYXMgZXZlbnR8IiZpbGw9IiNGRkU1MDAiIGZpbGwtcnVsZT0iZXZlbm9kZCIvPjwvZz48L3N2Zz4=) 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: 100px;
    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 */

/* ============ HEADER ROW STYLES ============ */

/* ===== HEADER ROW LIGHT THEME ===== */
tr.header-row td,
.mud-table-row.header-row td {
    background: var(--mud-palette-background-gray) !important;
    color: var(--mud-palette-text-primary) !important;
    border-top: 1px solid var(--mud-palette-lines-default) !important;
}

/* ===== HEADER ROW DARK THEME ===== */

tr.header-row-dark td,
.mud-table-row.header-row-dark td {
    background: var(--mud-palette-surface) !important;
    color: var(--mud-palette-text-primary) !important;
    border-top: 1px solid var(--mud-palette-lines-default) !important;
}

/* Header-row inputs - light */
tr.header-row td input,
tr.header-row td textarea {
    background-color: transparent !important;
    color: var(--mud-palette-text-primary) !important;
}

    tr.header-row td input::placeholder,
    tr.header-row td textarea::placeholder {
        color: rgba(0,0,0,0.4) !important;
    }

/* Header-row inputs - dark */
tr.header-row-dark td input,
tr.header-row-dark td textarea,
.mud-table-row.header-row-dark td input,
.mud-table-row.header-row-dark td textarea {
    background-color: transparent !important;
    color: var(--mud-palette-text-primary) !important;
}

    tr.header-row-dark td input::placeholder,
    .mud-table-row.header-row-dark td input::placeholder {
        color: rgba(255,255,255,0.6) !important;
    }


/* Light theme: header-row class */
/*tr.header-row td {
    background: #f3f4f6 !important;
    border-top: 1px solid #e5e7eb !important;
    color: #0f172a !important;
}*/

/* Dark theme: header-row-dark class added when ThemeState.IsDark */
/*tr.header-row-dark td {
    background: #111827 !important;
    border-top: 1px solid #2f3136 !important;
    color: rgba(255,255,255,0.96) !important;
}*/

/* Also target by both class names (MudBlazor adds mud-table-row class) */
/*.mud-table-row.header-row td {
    background: #f3f4f6 !important;
    color: #0f172a !important;
}

.mud-table-row.header-row-dark td {
    background: #111827 !important;
    color: rgba(255,255,255,0.96) !important;
}*/

/* Inputs in light theme header rows */
/*tr.header-row td .mud-input-root,
tr.header-row td .mud-input-slot,
tr.header-row td .mud-textfield-root,
tr.header-row td input,
tr.header-row td textarea {
    background-color: transparent !important;
    color: #0f172a !important;
}

tr.header-row td input::placeholder,
tr.header-row td textarea::placeholder {
    color: rgba(0,0,0,0.4) !important;
}*/

/* Inputs in dark theme header rows */
/*tr.header-row-dark td .mud-input-root,
tr.header-row-dark td .mud-input-slot,
tr.header-row-dark td .mud-textfield-root,
tr.header-row-dark td input,
tr.header-row-dark td textarea,
.mud-table-row.header-row-dark td .mud-input-root,
.mud-table-row.header-row-dark td .mud-input-slot,
.mud-table-row.header-row-dark td .mud-textfield-root,
.mud-table-row.header-row-dark td input,
.mud-table-row.header-row-dark td textarea {
    background-color: transparent !important;
    color: rgba(255,255,255,0.96) !important;
}

tr.header-row-dark td input::placeholder,
tr.header-row-dark td textarea::placeholder,
.mud-table-row.header-row-dark td input::placeholder,
.mud-table-row.header-row-dark td textarea::placeholder {
color: rgba(255,255,255,0.6) !important;
}*/

/* Text color inheritance */
/*tr.header-row td * {
    color: inherit;
}

tr.header-row-dark td *,
.mud-table-row.header-row-dark td * {
    color: inherit;
}*/