/* GlarionSiteMaster theme — refreshed to match the latest Glarion brand reference:
   dark navy foundations, electric blue primary surfaces, warm gold accent moments,
   soft white cards, and cleaner dashboard/auth presentation shared with the MAUI app. */

:root {
    --glarion-primary: #1976D2;
    --glarion-primary-dark: #0D47A1;
    --glarion-primary-light: #26A9E0;
    --glarion-accent: #FFB300;
    --glarion-accent-soft: #FFE3A3;
    --glarion-bg: #F3F7FC;
    --glarion-bg-deep: #041B4A;
    --glarion-card: #FFFFFF;
    --glarion-track: #DDEAFB;
    --glarion-heading: #0C234A;
    --glarion-text: #20324F;
    --glarion-muted: #6A7A96;
    --glarion-border: #D8E3F2;
    --glarion-success: #26A95F;
    --glarion-danger: #E45B5B;
    --glarion-radius: 20px;
    --glarion-shadow: 0 18px 48px rgba(8, 37, 88, 0.09);
}

* {
    box-sizing: border-box;
}

html, body {
    margin: 0;
    padding: 0;
    background:
        radial-gradient(circle at top, rgba(38, 169, 224, 0.12), transparent 28%),
        linear-gradient(180deg, #F8FBFF 0%, var(--glarion-bg) 100%);
    color: var(--glarion-text);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

h1, h2, h3, h4, h5 {
    color: var(--glarion-heading);
    font-weight: 700;
}

a {
    color: var(--glarion-primary-dark);
}

.glarion-app {
    display: flex;
    min-height: 100vh;
    background:
        radial-gradient(circle at 18% 18%, rgba(38, 169, 224, 0.24), transparent 20%),
        radial-gradient(circle at 82% 78%, rgba(255, 179, 0, 0.2), transparent 18%),
        linear-gradient(145deg, #03163F 0%, #082B70 58%, #041B4A 100%);
}

.glarion-shell {
    display: flex;
    flex-direction: row;
    min-height: 100vh;
    background: transparent;
}

.glarion-sidebar {
    width: 260px;
    flex-shrink: 0;
    min-height: 100vh;
    background: linear-gradient(180deg, #051A46 0%, #082B70 100%);
    padding: 24px 16px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    overflow: hidden;
    white-space: nowrap;
    transition: width 0.18s ease, padding 0.18s ease;
}

.glarion-sidebar.collapsed {
    width: 0;
    padding: 24px 0;
}

.glarion-sidebar-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 0 8px;
    margin-bottom: 24px;
}

.glarion-sidebar-brand-badge {
    width: 40px;
    height: 40px;
    flex-shrink: 0;
    border-radius: 12px;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.08);
}

.glarion-sidebar-brand-badge img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.glarion-sidebar-brand-text {
    display: flex;
    flex-direction: column;
    line-height: 1.2;
}

.glarion-sidebar-brand-text .name {
    color: white;
    font-weight: 700;
    letter-spacing: 0.08em;
    font-size: 0.95rem;
}

.glarion-sidebar-brand-text .sub {
    color: rgba(255, 255, 255, 0.6);
    font-size: 0.68rem;
    letter-spacing: 0.1em;
}

.glarion-sidebar-nav {
    display: flex;
    flex-direction: column;
    gap: 4px;
    flex: 1;
    overflow-y: auto;
}

.glarion-help-card {
    margin-top: auto;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px;
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.08);
    text-decoration: none;
    color: white;
}

.glarion-help-card:hover {
    background: rgba(255, 255, 255, 0.14);
}

.glarion-help-icon {
    font-size: 1.3rem;
}

.glarion-help-title {
    font-weight: 700;
    font-size: 0.85rem;
    color: white;
}

.glarion-help-sub {
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.65);
}

.glarion-content-column {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-width: 0;
    min-height: 100vh;
}

.glarion-topbar {
    flex-shrink: 0;
    height: 72px;
    background: var(--glarion-card);
    border-bottom: 1px solid var(--glarion-border);
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 0 24px;
    position: sticky;
    top: 0;
    z-index: 10;
}

.glarion-hamburger-btn {
    background: transparent;
    border: none;
    color: var(--glarion-heading);
    font-size: 1.3rem;
    line-height: 1;
    cursor: pointer;
    padding: 8px 10px;
    border-radius: 8px;
    flex-shrink: 0;
}

.glarion-hamburger-btn:hover {
    background: var(--glarion-bg);
}

.glarion-breadcrumb {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.85rem;
    color: var(--glarion-muted);
    white-space: nowrap;
    flex: 1;
    min-width: 0;
    overflow-x: auto;
    scrollbar-width: none;
}

.glarion-breadcrumb::-webkit-scrollbar {
    display: none;
}

.glarion-breadcrumb-link {
    color: var(--glarion-muted);
    text-decoration: none;
}

.glarion-breadcrumb-link:hover {
    color: var(--glarion-primary);
}

.glarion-breadcrumb-current {
    color: var(--glarion-heading);
    font-weight: 700;
}

.glarion-breadcrumb-sep {
    color: var(--glarion-border);
}

.glarion-notif-wrap {
    position: relative;
    margin-left: auto;
    flex-shrink: 0;
}

.glarion-notif-btn {
    position: relative;
    background: var(--glarion-bg);
    border: 1px solid var(--glarion-border);
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    cursor: pointer;
    flex-shrink: 0;
}

.glarion-notif-btn:hover {
    background: var(--glarion-track);
}

.glarion-notif-badge {
    position: absolute;
    top: -4px;
    right: -4px;
    min-width: 18px;
    height: 18px;
    padding: 0 4px;
    border-radius: 9px;
    background: var(--glarion-danger);
    color: #fff;
    font-size: 0.65rem;
    font-weight: 700;
    line-height: 18px;
    text-align: center;
    box-shadow: 0 0 0 2px var(--glarion-card);
}

.glarion-notif-panel {
    position: absolute;
    top: calc(100% + 10px);
    right: -12px;
    width: 380px;
    max-width: calc(100vw - 32px);
    background: var(--glarion-card);
    border: 1px solid var(--glarion-border);
    border-radius: var(--glarion-radius);
    box-shadow: var(--glarion-shadow);
    z-index: 30;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.glarion-notif-panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 18px;
    border-bottom: 1px solid var(--glarion-border);
    font-weight: 700;
    color: var(--glarion-heading);
}

.glarion-notif-markall {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--glarion-primary);
    cursor: pointer;
}

.glarion-notif-markall:hover {
    color: var(--glarion-primary-dark);
    text-decoration: underline;
}

.glarion-notif-panel-list {
    max-height: 420px;
    overflow-y: auto;
}

.glarion-notif-empty {
    padding: 32px 18px;
    text-align: center;
    color: var(--glarion-muted);
    font-size: 0.85rem;
}

.glarion-notif-row {
    display: flex;
    gap: 12px;
    padding: 12px 18px;
    border-bottom: 1px solid var(--glarion-border);
    cursor: pointer;
    align-items: flex-start;
}

.glarion-notif-row:last-child {
    border-bottom: none;
}

.glarion-notif-row:hover {
    background: var(--glarion-bg);
}

.glarion-notif-row.unread {
    background: rgba(25, 118, 210, 0.05);
}

.glarion-notif-icon {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    flex-shrink: 0;
    background: var(--glarion-track);
}

.glarion-notif-icon.procurement { background: rgba(25, 118, 210, 0.12); }
.glarion-notif-icon.financial { background: rgba(228, 91, 91, 0.12); }
.glarion-notif-icon.execution { background: rgba(38, 169, 95, 0.12); }
.glarion-notif-icon.inventory { background: rgba(255, 179, 0, 0.16); }
.glarion-notif-icon.attendance { background: rgba(38, 169, 224, 0.14); }
.glarion-notif-icon.system { background: var(--glarion-track); }

.glarion-notif-row-body {
    flex: 1;
    min-width: 0;
}

.glarion-notif-row-title {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--glarion-heading);
    display: flex;
    align-items: center;
    gap: 6px;
}

.glarion-notif-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--glarion-primary);
    flex-shrink: 0;
}

.glarion-notif-row-desc {
    font-size: 0.78rem;
    color: var(--glarion-muted);
    margin-top: 2px;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.glarion-notif-row-time {
    font-size: 0.7rem;
    color: var(--glarion-muted);
    margin-top: 4px;
}

.glarion-notif-panel-footer {
    display: block;
    text-align: center;
    padding: 12px;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--glarion-primary);
    text-decoration: none;
    border-top: 1px solid var(--glarion-border);
    background: var(--glarion-bg);
}

.glarion-notif-panel-footer:hover {
    color: var(--glarion-primary-dark);
}

/* NotificationCenter.razor (full page, not the topbar dropdown) - reuses .glarion-notif-row/
   -icon/-dot/-badge etc. from the panel above so a row looks identical in both places. */
.glarion-notif-tabs {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

.glarion-notif-tab {
    background: var(--glarion-bg);
    border: 1px solid var(--glarion-border);
    border-radius: 999px;
    padding: 6px 14px;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--glarion-muted);
    cursor: pointer;
}

.glarion-notif-tab:hover {
    background: var(--glarion-track);
}

.glarion-notif-tab.active {
    background: var(--glarion-primary);
    border-color: var(--glarion-primary);
    color: #fff;
}

.glarion-notif-list-page .glarion-notif-row {
    padding: 14px 4px;
    border-radius: 10px;
}

.glarion-notif-list-page .glarion-notif-row.unread {
    background: rgba(25, 118, 210, 0.05);
}

.glarion-user-menu {
    position: relative;
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    padding: 6px 8px;
    border-radius: 12px;
    flex-shrink: 0;
}

.glarion-user-menu:hover {
    background: var(--glarion-bg);
}

.glarion-avatar {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--glarion-primary), var(--glarion-primary-light));
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.85rem;
    flex-shrink: 0;
}

.glarion-user-info {
    display: flex;
    flex-direction: column;
    line-height: 1.25;
}

.glarion-user-info strong {
    font-size: 0.87rem;
    color: var(--glarion-heading);
}

.glarion-user-info span {
    font-size: 0.72rem;
    color: var(--glarion-muted);
}

.glarion-chevron {
    color: var(--glarion-muted);
    font-size: 0.8rem;
}

.glarion-user-dropdown {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    background: var(--glarion-card);
    border: 1px solid var(--glarion-border);
    border-radius: 12px;
    box-shadow: var(--glarion-shadow);
    padding: 6px;
    min-width: 160px;
    z-index: 30;
}

.glarion-main {
    flex: 1;
    padding: 28px 32px;
    width: 100%;
}

.glarion-logo {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 24px;
    padding: 0 8px;
}

.glarion-logo-badge {
    width: 44px;
    height: 44px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 700;
    overflow: hidden;
}

.glarion-logo-badge img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.glarion-logo-text {
    font-weight: 700;
    font-size: 1.05rem;
    color: var(--glarion-heading);
}

.glarion-nav-link {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 14px;
    border-radius: 14px;
    color: rgba(255, 255, 255, 0.82);
    text-decoration: none;
    font-weight: 600;
    font-size: 0.92rem;
    transition: background-color 0.15s ease, color 0.15s ease, transform 0.15s ease;
}

.glarion-nav-link:hover {
    background: rgba(255, 255, 255, 0.1);
    color: white;
    transform: translateX(2px);
}

.glarion-nav-link.active {
    background: linear-gradient(90deg, rgba(25, 118, 210, 0.92) 0%, rgba(38, 169, 224, 0.9) 72%);
    color: white;
    box-shadow: 0 10px 20px rgba(2, 12, 36, 0.24);
}

.glarion-main {
    flex: 1;
    padding: 28px 32px;
    max-width: 1200px;
    width: 100%;
}

.glarion-page-title {
    font-size: 1.6rem;
    margin-bottom: 20px;
}

.glarion-form-page {
    width: min(100%, 840px);
    margin: 0 auto;
}

.glarion-company-card {
    width: 100%;
}

.glarion-page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
    gap: 12px;
}

.glarion-page-header .glarion-page-title {
    margin-bottom: 0;
}

.glarion-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(38, 38, 36, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 20px;
}

/* overflow:hidden (not auto) is deliberate here - the scrollbar for tall content now lives on
   .glarion-modal-body below instead of this element. Chrome on Windows doesn't clip a scrollbar
   track to border-radius on the same box that owns both, so the old overflow-y:auto right here
   squared off the top-right/bottom-right corners on every modal tall enough to scroll (which got
   a lot more common once the BillCaptureUploader modals grew a preview column). Moving the
   scroll to a plain inner box that has no border-radius of its own sidesteps the bug entirely -
   this outer box just clips to the rounded shape and never scrolls itself. */
.glarion-modal {
    background: var(--glarion-card);
    border-radius: var(--glarion-radius);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.3);
    width: 100%;
    max-width: 480px;
    max-height: 90vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

/* Wider variant for forms with multi-column item rows (Procurement requisition/PO item grids) -
   the default 480px was too narrow for a 4-5 column item row and forced horizontal scrolling
   with overlapping/cut-off fields. Bumped 720px -> 940px on 2026-07-13 so the BillCaptureUploader
   forms below have enough room for a legible attachment preview column. */
.glarion-modal-wide {
    max-width: 940px;
}

.glarion-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 22px;
    border-bottom: 1px solid var(--glarion-border);
    background: var(--glarion-card);
    flex-shrink: 0;
}

.glarion-modal-header h3 {
    margin: 0;
    font-size: 1.15rem;
}

.glarion-modal-close {
    background: none;
    border: none;
    font-size: 1.1rem;
    line-height: 1;
    cursor: pointer;
    color: var(--glarion-muted);
    padding: 4px 8px;
    border-radius: 6px;
}

.glarion-modal-close:hover {
    background: var(--glarion-bg);
}

.glarion-modal-body {
    padding: 20px 22px;
    overflow-y: auto;
    flex: 1;
    min-height: 0;
}

/* Two-column layout for forms that use BillCaptureUploader (Expense/Inventory/Petty Cash/Income
   modals) - form fields on the left, an instant attachment preview pinned on the right, so the
   user can see the receipt/invoice they just picked without scrolling past it. Added 2026-07-13
   per explicit request: "when i upload the attachment ... there should be option to preview
   immediately" on the right side of the modal. */
.glarion-bill-preview-layout {
    display: grid;
    grid-template-columns: 1fr 340px;
    gap: 24px;
    align-items: start;
}

/* "Premium" pass 2026-07-13 - the original small static thumbnail wasn't legible enough to
   actually check an invoice/voucher against, per direct user feedback. Now a bordered card with
   a soft shadow, a hover lift, and a "click to zoom" affordance that opens
   AttachmentPreviewPanel's lightbox (zoom + scroll). */
.glarion-bill-preview-panel {
    position: sticky;
    top: 0;
    border: 1px solid var(--glarion-border);
    border-radius: 14px;
    background: linear-gradient(180deg, var(--glarion-card) 0%, var(--glarion-bg) 100%);
    padding: 14px;
    min-height: 220px;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    overflow: hidden;
    box-shadow: 0 6px 18px rgba(13, 44, 108, 0.08);
}

.glarion-bill-preview-thumb-wrap {
    position: relative;
    width: 100%;
    cursor: zoom-in;
    border-radius: 10px;
    overflow: hidden;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.glarion-bill-preview-thumb-wrap:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 24px rgba(13, 44, 108, 0.18);
}

.glarion-bill-preview-thumb-wrap img {
    max-width: 100%;
    max-height: 380px;
    border-radius: 10px;
    display: block;
    object-fit: contain;
    margin: 0 auto;
}

.glarion-bill-preview-thumb-wrap iframe {
    width: 100%;
    height: 380px;
    border: none;
    border-radius: 10px;
    background: white;
    pointer-events: none;
}

.glarion-bill-preview-zoom-hint {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    padding: 6px 8px;
    font-size: 0.72rem;
    font-weight: 600;
    color: white;
    background: linear-gradient(0deg, rgba(13, 44, 108, 0.75) 0%, rgba(13, 44, 108, 0) 100%);
    opacity: 0;
    transition: opacity 0.15s ease;
}

.glarion-bill-preview-thumb-wrap:hover .glarion-bill-preview-zoom-hint {
    opacity: 1;
}

.glarion-bill-preview-empty {
    color: var(--glarion-muted);
    font-size: 0.82rem;
    padding: 14px;
}

.glarion-bill-preview-file {
    color: var(--glarion-muted);
    font-size: 0.82rem;
    padding: 14px;
    word-break: break-word;
}

.glarion-bill-preview-file .glarion-bill-preview-icon {
    font-size: 2.6rem;
    display: block;
    margin-bottom: 8px;
}

/* Click-to-zoom lightbox - opened from the thumbnail above. Sits above the loading overlay
   (z-index 2000) so it's reachable even while a save is in flight. Zoom is a plain CSS width
   percentage (no JS interop needed); once the image is wider than the viewport the
   .glarion-lightbox-scroll container's native overflow:auto gives scroll/pan for free. */
.glarion-lightbox-overlay {
    position: fixed;
    inset: 0;
    background: rgba(10, 20, 40, 0.78);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2100;
    padding: 24px;
}

.glarion-lightbox-shell {
    background: var(--glarion-card);
    border-radius: 16px;
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.4);
    width: 100%;
    max-width: 1100px;
    height: 90vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.glarion-lightbox-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 12px 18px;
    border-bottom: 1px solid var(--glarion-border);
    font-size: 0.9rem;
    font-weight: 600;
}

.glarion-lightbox-toolbar .glarion-lightbox-filename {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.glarion-lightbox-zoom-pct {
    min-width: 46px;
    text-align: center;
    font-weight: 600;
    color: var(--glarion-muted);
}

.glarion-lightbox-scroll {
    flex: 1;
    overflow: auto;
    background: repeating-conic-gradient(#f4f6fa 0% 25%, #eaeef5 0% 50%) 50% / 22px 22px;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding: 20px;
}

.glarion-lightbox-scroll img {
    display: block;
    border-radius: 6px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25);
    max-width: none;
}

.glarion-lightbox-scroll iframe {
    width: 100%;
    height: 100%;
    min-height: 70vh;
    border: none;
    border-radius: 6px;
    background: white;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25);
}

@media (max-width: 640px) {
    .glarion-bill-preview-layout {
        grid-template-columns: 1fr;
    }

    .glarion-bill-preview-panel {
        position: static;
        order: -1;
        min-height: 140px;
    }

    .glarion-lightbox-shell {
        height: 95vh;
    }
}

.glarion-loading-overlay {
    position: fixed;
    inset: 0;
    background: rgba(4, 27, 74, 0.32);
    backdrop-filter: blur(2px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    padding: 20px;
}

.glarion-loading-card {
    min-width: 180px;
    background: rgba(255, 255, 255, 0.96);
    border: 1px solid var(--glarion-border);
    border-radius: var(--glarion-radius);
    box-shadow: 0 18px 48px rgba(4, 27, 74, 0.18);
    padding: 18px 22px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    color: var(--glarion-heading);
    font-weight: 600;
}

.glarion-loading-spinner {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    border: 4px solid rgba(25, 118, 210, 0.16);
    border-top-color: var(--glarion-accent);
    animation: glarion-spin 0.75s linear infinite;
}

@keyframes glarion-spin {
    from {
        transform: rotate(0deg);
    }

    to {
        transform: rotate(360deg);
    }
}

.glarion-card {
    background: var(--glarion-card);
    border-radius: var(--glarion-radius);
    box-shadow: var(--glarion-shadow);
    padding: 22px 24px;
    margin-bottom: 18px;
    border: 1px solid var(--glarion-border);
}

.glarion-card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 16px;
    margin-bottom: 22px;
}

.glarion-stat-label {
    color: var(--glarion-muted);
    font-size: 0.85rem;
    font-weight: 600;
    margin-bottom: 6px;
}

.glarion-stat-value {
    font-size: 2rem;
    font-weight: 800;
    color: var(--glarion-primary-dark);
}

.glarion-stat-value.positive { color: var(--glarion-success); }
.glarion-stat-value.negative { color: var(--glarion-danger); }

.glarion-progress-track {
    width: 100%;
    height: 10px;
    border-radius: 6px;
    background: var(--glarion-track);
    overflow: hidden;
    margin-top: 10px;
}

.glarion-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--glarion-primary) 0%, var(--glarion-primary-light) 68%, var(--glarion-accent) 100%);
    border-radius: 6px;
}

.glarion-table {
    width: 100%;
    border-collapse: collapse;
}

.glarion-table th {
    text-align: left;
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    color: var(--glarion-muted);
    padding: 10px 12px;
    border-bottom: 1px solid var(--glarion-border);
}

.glarion-table td {
    padding: 12px;
    border-bottom: 1px solid var(--glarion-border);
    font-size: 0.92rem;
}

.glarion-btn {
    background: linear-gradient(90deg, var(--glarion-primary-dark) 0%, var(--glarion-primary) 78%);
    color: white;
    border: none;
    border-radius: 12px;
    padding: 11px 18px;
    font-weight: 700;
    cursor: pointer;
    font-size: 0.9rem;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
    box-shadow: 0 12px 24px rgba(13, 71, 161, 0.2);
}

.glarion-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 16px 28px rgba(13, 71, 161, 0.26);
}

.glarion-btn.secondary {
    background: white;
    color: var(--glarion-primary-dark);
    border: 1px solid var(--glarion-border);
    box-shadow: none;
}

/* Simple in-page tab toggle used by Procurement.razor (Requisitions / Purchase Orders) - plain
   underline style rather than a full pill/button treatment, so it reads as a sub-navigation
   within the card rather than competing with the primary .glarion-btn actions above it. */
.glarion-tab-btn {
    background: none;
    border: none;
    border-bottom: 3px solid transparent;
    padding: 10px 4px;
    margin-right: 18px;
    font-weight: 600;
    font-size: 0.92rem;
    color: var(--glarion-muted);
    cursor: pointer;
}

.glarion-tab-btn.active {
    color: var(--glarion-primary-dark);
    border-bottom-color: var(--glarion-primary);
}

.glarion-field {
    margin-bottom: 14px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.glarion-field label {
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--glarion-muted);
}

.glarion-field input,
.glarion-field select,
.glarion-field textarea {
    padding: 12px 14px;
    border-radius: 14px;
    border: 1px solid var(--glarion-border);
    font-size: 0.92rem;
    background: #F9FBFF;
    color: var(--glarion-text);
    transition: border-color 0.15s ease, box-shadow 0.15s ease, background-color 0.15s ease;
}

.glarion-field input:focus,
.glarion-field select:focus,
.glarion-field textarea:focus {
    outline: none;
    border-color: var(--glarion-primary);
    box-shadow: 0 0 0 4px rgba(25, 118, 210, 0.12);
    background: white;
}

.glarion-logo-row {
    display: flex;
    align-items: center;
    gap: 18px;
}

.glarion-logo-preview {
    width: 96px;
    height: 96px;
    flex: 0 0 auto;
    border-radius: 16px;
    border: 1px solid var(--glarion-border);
    background: #F9FBFF;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.glarion-logo-preview img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    padding: 8px;
    background: white;
}

.glarion-logo-placeholder-icon {
    font-size: 2.1rem;
    opacity: 0.45;
}

/* Native <input type=file> looks like an unstyled browser control by default (see InputFile in
   Company.razor) - wrapping it in a <label class="glarion-file-btn glarion-btn secondary"> and
   hiding the input itself gives a button that matches the rest of the design system while
   keeping the native picker's behavior/accessibility intact. */
.glarion-file-btn {
    position: relative;
    display: inline-flex;
    align-items: center;
    cursor: pointer;
    overflow: hidden;
}

.glarion-file-btn input[type="file"] {
    position: absolute;
    inset: 0;
    opacity: 0;
    cursor: pointer;
}

.glarion-file-btn input[type="file"]:disabled {
    cursor: not-allowed;
}

.glarion-badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 700;
    background: rgba(255, 179, 0, 0.16);
    color: #B36D00;
}

.glarion-accent-bar {
    height: 3px;
    border-radius: 2px;
    background: linear-gradient(90deg, var(--glarion-primary) 0%, var(--glarion-accent) 100%);
    margin: 0 8px 20px;
}

.glarion-login-page {
    width: 100%;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 32px 16px;
    background:
        linear-gradient(180deg, rgba(3, 22, 63, 0.38) 0%, rgba(3, 22, 63, 0.62) 100%),
        radial-gradient(circle at center, rgba(255, 179, 0, 0.18), transparent 24%),
        url("/images/login-hero.png") center/cover no-repeat;
}

.glarion-auth-card {
    width: 100%;
    margin: 0;
    background: rgba(255, 255, 255, 0.96);
    backdrop-filter: blur(4px);
    align-self: center;
}

/* Two classes (not one) deliberately - .glarion-card alone has the same specificity as the later,
   site-wide responsive rule ".glarion-card { max-width: 100% }" (added for the sidebar/dashboard
   layout), and being defined earlier in this file it would otherwise lose that tie and let the
   login/change-password card stretch edge-to-edge on every screen size instead of staying a
   centered ~420px card - which is what "broken design on Login" turned out to be. Chaining both
   classes here (the markup already has both) raises specificity so this wins regardless of
   source order. */
.glarion-card.glarion-login-card {
    max-width: 420px;
    box-shadow: 0 24px 60px rgba(3, 22, 63, 0.28);
    background: rgba(255, 255, 255, 0.92);
}

.glarion-auth-brand {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    margin-bottom: 22px;
    text-align: center;
}

.glarion-auth-title {
    margin: 0;
    color: var(--glarion-primary-dark);
    font-size: 1.9rem;
    font-weight: 800;
    letter-spacing: 0.18em;
}

.glarion-auth-subtitle {
    margin: 0;
    color: #D48600;
    font-size: 0.92rem;
    font-weight: 700;
    letter-spacing: 0.34em;
    text-transform: uppercase;
}

.glarion-auth-tagline {
    margin: 0;
    color: var(--glarion-muted);
    font-size: 0.83rem;
    letter-spacing: 0.08em;
}

.glarion-auth-links {
    display: flex;
    justify-content: space-between;
    margin-top: 14px;
    font-size: 0.85rem;
}

@media (max-width: 600px) {
    .glarion-login-page {
        padding: 20px 12px;
    }
}

/* ============================================================================
   Project Dashboard (hub page) - redesigned to match the Buildexa-style reference:
   icon-badge stat cards with trend pills, a two-column project info + progress-donut
   row, a quick-actions tile grid, and a financial line chart + activity feed row.
   ============================================================================ */

.glarion-hub-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
    margin-bottom: 18px;
}

.glarion-hub-header-meta {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    color: var(--glarion-muted);
    font-size: 0.9rem;
    margin-top: 6px;
}

.glarion-hub-header-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.glarion-hub-progress-row {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-top: 14px;
}

.glarion-hub-progress-row .glarion-progress-track {
    flex: 1;
    margin-top: 0;
}

.glarion-hub-progress-pct {
    font-weight: 800;
    color: var(--glarion-primary-dark);
    font-size: 0.95rem;
    white-space: nowrap;
}

.glarion-stat-card {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.glarion-stat-card-top {
    display: flex;
    align-items: center;
    gap: 12px;
}

.glarion-stat-icon {
    width: 44px;
    height: 44px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3rem;
    flex-shrink: 0;
    background: rgba(25, 118, 210, 0.12);
}

.glarion-stat-icon.income { background: rgba(38, 169, 95, 0.14); }
.glarion-stat-icon.expense { background: rgba(228, 91, 91, 0.14); }
.glarion-stat-icon.cash { background: rgba(255, 179, 0, 0.16); }

.glarion-stat-trend {
    font-size: 0.8rem;
    font-weight: 700;
    padding: 2px 9px;
    border-radius: 999px;
    width: fit-content;
}

.glarion-stat-trend.up { color: #1E8449; background: rgba(38, 169, 95, 0.14); }
.glarion-stat-trend.down { color: #B33939; background: rgba(228, 91, 91, 0.14); }
.glarion-stat-trend.neutral { color: var(--glarion-primary-dark); background: rgba(25, 118, 210, 0.1); }

.glarion-sparkline {
    width: 100%;
    height: 24px;
    display: block;
}

.glarion-toolbar {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 18px;
    flex-wrap: wrap;
}

.glarion-search-box {
    flex: 1;
    min-width: 220px;
    display: flex;
    align-items: center;
    gap: 8px;
    background: var(--glarion-bg);
    border: 1px solid var(--glarion-border);
    border-radius: 12px;
    padding: 9px 14px;
    color: var(--glarion-muted);
}

.glarion-search-box input {
    flex: 1;
    border: none;
    background: transparent;
    outline: none;
    font-size: 0.9rem;
    color: var(--glarion-text);
}

.glarion-sortable {
    cursor: pointer;
    user-select: none;
}

.glarion-sortable:hover {
    color: var(--glarion-primary);
}

.glarion-avatar-circle {
    width: 36px;
    height: 36px;
    flex-shrink: 0;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--glarion-primary), var(--glarion-primary-light));
    color: white;
    font-weight: 700;
    font-size: 0.78rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.glarion-icon-btn {
    width: 34px;
    height: 34px;
    border-radius: 10px;
    border: 1px solid var(--glarion-border);
    background: var(--glarion-card);
    cursor: pointer;
    font-size: 0.95rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: var(--glarion-primary-dark);
}

.glarion-icon-btn:hover {
    background: var(--glarion-bg);
}

.glarion-icon-btn.danger {
    color: var(--glarion-danger);
}

.glarion-icon-btn.danger:hover {
    background: rgba(228, 91, 91, 0.1);
}

.glarion-pagination {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid var(--glarion-border);
    font-size: 0.85rem;
    color: var(--glarion-muted);
}

.glarion-pagination select {
    border: 1px solid var(--glarion-border);
    border-radius: 8px;
    padding: 6px 10px;
    font-size: 0.85rem;
    color: var(--glarion-text);
    background: var(--glarion-card);
}

/* Gallery / Drawings - project selector + type tabs + grid/list toggle (see Gallery.razor,
   Drawings.razor). */
.glarion-media-filter-row {
    display: flex;
    align-items: flex-end;
    gap: 22px;
    flex-wrap: wrap;
}

.glarion-media-tabs {
    display: flex;
    gap: 6px;
    background: var(--glarion-bg);
    border: 1px solid var(--glarion-border);
    border-radius: 12px;
    padding: 4px;
}

.glarion-media-tab {
    border: none;
    background: transparent;
    color: var(--glarion-muted);
    font-weight: 600;
    font-size: 0.85rem;
    padding: 8px 14px;
    border-radius: 9px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    white-space: nowrap;
}

.glarion-media-tab.active {
    background: var(--glarion-card);
    color: var(--glarion-primary-dark);
    box-shadow: 0 2px 8px rgba(13, 71, 161, 0.12);
}

.glarion-media-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 16px;
}

.glarion-media-count {
    font-weight: 700;
    font-size: 1.02rem;
}

.glarion-media-count span {
    color: var(--glarion-muted);
    font-weight: 600;
    font-size: 0.85rem;
}

.glarion-view-toggle {
    display: flex;
    gap: 4px;
    border: 1px solid var(--glarion-border);
    border-radius: 10px;
    padding: 3px;
}

.glarion-view-toggle button {
    width: 32px;
    height: 30px;
    border: none;
    border-radius: 7px;
    background: transparent;
    cursor: pointer;
    color: var(--glarion-muted);
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.glarion-view-toggle button.active {
    background: rgba(25, 118, 210, 0.12);
    color: var(--glarion-primary);
}

.glarion-media-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 16px;
}

.glarion-media-card {
    position: relative;
    border-radius: 14px;
    overflow: hidden;
    border: 1px solid var(--glarion-border);
    background: var(--glarion-card);
    cursor: pointer;
}

.glarion-media-card-thumb {
    position: relative;
    aspect-ratio: 4/3;
    background: linear-gradient(135deg, #123B78, #1976D2);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.glarion-media-card-thumb img,
.glarion-media-card-thumb video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.glarion-media-card-icon {
    font-size: 2.4rem;
    color: rgba(255, 255, 255, 0.85);
}

.glarion-media-card-name {
    position: absolute;
    top: 8px;
    left: 8px;
    background: rgba(0, 0, 0, 0.55);
    color: white;
    font-size: 0.72rem;
    font-weight: 600;
    padding: 4px 9px;
    border-radius: 999px;
    max-width: calc(100% - 46px);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.glarion-media-card-play {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.1rem;
}

.glarion-media-card-play span {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
}

.glarion-media-card-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 12px;
    font-size: 0.78rem;
    color: var(--glarion-muted);
}

.glarion-media-card-meta span {
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

.glarion-media-empty {
    text-align: center;
    padding: 40px 20px;
    color: var(--glarion-muted);
}

.glarion-tip-box {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    background: rgba(25, 118, 210, 0.06);
    border: 1px solid rgba(25, 118, 210, 0.16);
    border-radius: 12px;
    padding: 14px 16px;
    font-size: 0.85rem;
    color: var(--glarion-muted);
    margin-top: 18px;
}

.glarion-tip-box strong {
    color: var(--glarion-heading);
}

/* Attendance - filter row's quick stat chips + colored per-status action pills (see
   Attendance.razor). */
.glarion-mini-stat-row {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.glarion-mini-stat {
    display: flex;
    align-items: center;
    gap: 10px;
    background: var(--glarion-bg);
    border-radius: 12px;
    padding: 10px 16px;
    min-width: 130px;
}

.glarion-mini-stat-icon {
    width: 34px;
    height: 34px;
    border-radius: 9px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
}

.glarion-mini-stat-label {
    font-size: 0.72rem;
    font-weight: 700;
    color: var(--glarion-muted);
    text-transform: uppercase;
}

.glarion-mini-stat-value {
    font-size: 1.15rem;
    font-weight: 800;
    color: var(--glarion-heading);
}

.glarion-pill-btn {
    border: none;
    border-radius: 999px;
    padding: 7px 14px;
    font-weight: 700;
    font-size: 0.78rem;
    cursor: pointer;
    white-space: nowrap;
}

.glarion-pill-btn.present { background: rgba(38, 169, 95, 0.14); color: #1E7A45; }
.glarion-pill-btn.absent { background: rgba(228, 91, 91, 0.14); color: #C0392B; }
.glarion-pill-btn.halfday { background: rgba(255, 179, 0, 0.16); color: #B36D00; }
.glarion-pill-btn.leave { background: rgba(142, 95, 217, 0.15); color: #6A3FB0; }

.glarion-pill-btn:hover { filter: brightness(0.95); }

.glarion-avatar-circle.attendance { background: rgba(25, 118, 210, 0.12); color: var(--glarion-primary-dark); }

.glarion-bulk-bar {
    display: flex;
    align-items: center;
    gap: 10px;
    background: rgba(25, 118, 210, 0.06);
    border: 1px solid rgba(25, 118, 210, 0.16);
    border-radius: 12px;
    padding: 10px 14px;
    margin-bottom: 14px;
    flex-wrap: wrap;
}

.glarion-hub-columns {
    display: grid;
    grid-template-columns: 1.4fr 1fr;
    gap: 18px;
    align-items: stretch;
}

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

.glarion-info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 14px 20px;
}

.glarion-info-item-label {
    color: var(--glarion-muted);
    font-size: 0.78rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    margin-bottom: 4px;
}

.glarion-info-item-value {
    font-size: 0.98rem;
    font-weight: 600;
    color: var(--glarion-heading);
}

.glarion-donut-wrap {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
}

.glarion-donut-canvas-holder {
    position: relative;
    width: 180px;
    height: 180px;
}

.glarion-donut-canvas-holder canvas {
    width: 100% !important;
    height: 100% !important;
}

.glarion-donut-center {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    pointer-events: none;
}

.glarion-donut-center .pct {
    font-size: 1.7rem;
    font-weight: 800;
    color: var(--glarion-heading);
}

.glarion-donut-center .label {
    font-size: 0.75rem;
    color: var(--glarion-muted);
    font-weight: 600;
}

.glarion-dash-row-3 {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 18px;
    align-items: stretch;
    margin-bottom: 22px;
}

@media (max-width: 1100px) {
    .glarion-dash-row-3 {
        grid-template-columns: 1fr;
    }
}

.glarion-donut-canvas-holder.small {
    width: 140px;
    height: 140px;
}

.glarion-status-legend {
    display: flex;
    flex-direction: column;
    gap: 10px;
    width: 100%;
    margin-top: 14px;
}

.glarion-status-legend-item {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.85rem;
}

.glarion-status-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    flex-shrink: 0;
}

.glarion-status-legend-label {
    flex: 1;
    color: var(--glarion-text);
}

.glarion-status-legend-count {
    font-weight: 700;
    color: var(--glarion-heading);
}

.glarion-status-legend-pct {
    color: var(--glarion-muted);
    font-size: 0.78rem;
    min-width: 46px;
    text-align: right;
}

.glarion-period-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: var(--glarion-card);
    border: 1px solid var(--glarion-border);
    border-radius: 12px;
    padding: 9px 14px;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--glarion-text);
    cursor: pointer;
}

.glarion-topproj-row {
    padding: 12px 0;
    border-bottom: 1px solid var(--glarion-border);
}

.glarion-topproj-row:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.glarion-topproj-top {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    margin-bottom: 8px;
    gap: 10px;
}

.glarion-topproj-name {
    font-weight: 700;
    color: var(--glarion-heading);
    font-size: 0.92rem;
}

.glarion-topproj-budget {
    font-size: 0.82rem;
    color: var(--glarion-muted);
    white-space: nowrap;
}

.glarion-topproj-pct {
    font-size: 0.78rem;
    color: var(--glarion-muted);
    margin-top: 4px;
    text-align: right;
}

.glarion-cashflow-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
    font-size: 0.88rem;
    border-bottom: 1px solid var(--glarion-border);
}

.glarion-cashflow-row:last-of-type {
    border-bottom: none;
}

.glarion-cashflow-row.total strong {
    font-size: 1.05rem;
}

.glarion-cashflow-row .income-amount { color: var(--glarion-success); font-weight: 700; }
.glarion-cashflow-row .expense-amount { color: var(--glarion-danger); font-weight: 700; }

.glarion-quick-actions-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 12px;
}

.glarion-quick-tile {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 16px 10px;
    border-radius: 16px;
    border: 1px solid var(--glarion-border);
    background: #F9FBFF;
    text-align: center;
    text-decoration: none;
    color: var(--glarion-text);
    font-size: 0.82rem;
    font-weight: 700;
    transition: transform 0.15s ease, box-shadow 0.15s ease, background-color 0.15s ease;
    cursor: pointer;
}

.glarion-quick-tile:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 22px rgba(8, 37, 88, 0.1);
    background: white;
}

.glarion-quick-tile-icon {
    width: 40px;
    height: 40px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.15rem;
    background: rgba(25, 118, 210, 0.12);
}

.glarion-quick-tile.disabled {
    cursor: not-allowed;
    opacity: 0.55;
    background: var(--glarion-bg);
}

.glarion-quick-tile.disabled:hover {
    transform: none;
    box-shadow: none;
    background: var(--glarion-bg);
}

.glarion-quick-tile-soon {
    font-size: 0.65rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    color: var(--glarion-muted);
}

.glarion-chart-canvas-holder {
    position: relative;
    height: 240px;
    width: 100%;
    min-width: 0;
    overflow: hidden;
}

.glarion-chart-canvas-holder canvas {
    display: block;
    width: 100% !important;
    height: 100% !important;
    max-width: 100%;
}

.glarion-activity-list {
    display: flex;
    flex-direction: column;
    gap: 4px;
    max-height: 260px;
    overflow-y: auto;
}

.glarion-activity-item {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 10px 4px;
    border-bottom: 1px solid var(--glarion-border);
}

.glarion-activity-item:last-child {
    border-bottom: none;
}

.glarion-activity-icon {
    width: 34px;
    height: 34px;
    border-radius: 10px;
    background: rgba(25, 118, 210, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    flex-shrink: 0;
}

.glarion-activity-text {
    font-size: 0.88rem;
    color: var(--glarion-text);
    line-height: 1.35;
}

.glarion-timeline-group {
    margin-bottom: 18px;
}

.glarion-timeline-group-label {
    font-size: 0.78rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--glarion-muted);
    margin: 4px 0 6px;
}

/* The dashboard's Recent Activity widget clips to a short scrollable box (see
   .glarion-activity-list above) - the full-page Project Timeline reuses the same item markup
   but should never be clipped since paging/"Load more" is how it stays a manageable length. */
.glarion-timeline-list {
    max-height: none;
    overflow-y: visible;
}

.glarion-activity-meta {
    font-size: 0.75rem;
    color: var(--glarion-muted);
    margin-top: 2px;
}

.glarion-empty-note {
    color: var(--glarion-muted);
    font-size: 0.88rem;
    padding: 8px 2px;
}

.glarion-menu-popover {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.glarion-menu-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 9px 10px;
    border-radius: 10px;
    border: none;
    background: none;
    width: 100%;
    text-align: left;
    text-decoration: none;
    font-size: 0.88rem;
    font-weight: 600;
    color: var(--glarion-text);
    cursor: pointer;
}

.glarion-menu-item:hover {
    background: var(--glarion-bg);
}

.glarion-menu-item.danger {
    color: var(--glarion-danger);
}

/* ============================================================================
   Responsive layout
   ----------------------------------------------------------------------------
   Two separate problems, fixed together here:

   1. "Grid blowout": a grid/flex item's default min-width is `auto`, which
      means it sizes to fit its content's intrinsic width even if that's wider
      than the track/container - this is what let a stat value like
      "₹14,65,00,000" push past its card's edge instead of wrapping. Setting
      min-width: 0 on the grid children (and letting the value itself wrap)
      fixes it at the root instead of shrinking the font as a band-aid.

   2. No real mobile/tablet layout: the sidebar was always 260px pushing the
      content column beside it, so on any viewport narrower than
      (260px + a usable content width) the whole page required horizontal
      scrolling. Below 992px the sidebar becomes a fixed off-canvas drawer
      (see MainLayout.razor's _isNarrowViewport / glarion-sidebar-backdrop)
      instead of part of the row layout.
   ============================================================================ */

html, body {
    overflow-x: hidden;
}

.glarion-card-grid > *,
.glarion-dash-row-3 > *,
.glarion-hub-columns > *,
.glarion-info-grid > *,
.glarion-quick-actions-grid > *,
.glarion-media-grid > *,
.glarion-mini-stat-row > * {
    min-width: 0;
}

.glarion-card {
    min-width: 0;
    max-width: 100%;
}

.glarion-stat-card-top {
    min-width: 0;
}

.glarion-stat-card-top > div:last-child {
    min-width: 0;
    flex: 1;
}

.glarion-stat-value {
    font-size: clamp(1.15rem, 1rem + 1.6vw, 2rem);
    overflow-wrap: anywhere;
    word-break: break-word;
    line-height: 1.15;
}

.glarion-stat-label {
    overflow-wrap: anywhere;
}

/* Tables scroll horizontally inside their own card instead of forcing the whole
   page to scroll sideways on a narrow screen. */
.glarion-card:has(> .glarion-table) {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.glarion-table {
    min-width: 560px;
}

.glarion-sidebar-backdrop {
    display: none;
}

@media (max-width: 992px) {
    .glarion-sidebar {
        position: fixed;
        top: 0;
        left: 0;
        height: 100vh;
        z-index: 50;
        width: 280px;
        transform: translateX(-100%);
        transition: transform 0.2s ease;
    }

    .glarion-sidebar:not(.collapsed) {
        transform: translateX(0);
        box-shadow: 20px 0 48px rgba(2, 12, 36, 0.35);
    }

    .glarion-sidebar.collapsed {
        width: 280px;
        padding: 24px 16px;
        overflow: hidden;
        white-space: nowrap;
        transform: translateX(-100%);
    }

    .glarion-content-column {
        width: 100%;
        min-width: 0;
    }

    .glarion-sidebar-backdrop {
        display: block;
        position: fixed;
        inset: 0;
        background: rgba(2, 12, 36, 0.45);
        z-index: 40;
    }

    .glarion-main {
        padding: 20px;
    }

    .glarion-topbar {
        padding: 0 16px;
        gap: 10px;
    }

    .glarion-user-info {
        display: none;
    }

    .glarion-chevron {
        display: none;
    }
}

@media (max-width: 640px) {
    .glarion-main {
        padding: 16px;
    }

    .glarion-topbar {
        height: 60px;
        padding: 0 12px;
    }

    .glarion-breadcrumb {
        font-size: 0.78rem;
    }

    .glarion-card {
        padding: 16px 18px;
    }

    .glarion-page-title {
        font-size: 1.3rem;
    }

    .glarion-page-header {
        flex-wrap: wrap;
    }

    .glarion-card-grid {
        grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
        gap: 12px;
    }

    .glarion-stat-value {
        font-size: clamp(1.05rem, 0.9rem + 2vw, 1.6rem);
    }

    .glarion-modal {
        max-width: 100%;
    }

    .glarion-notif-panel {
        position: fixed;
        top: 60px;
        right: 8px;
        left: 8px;
        width: auto;
        max-width: none;
    }
}

/* Glarion Assist chat page - premium chat layout (avatars, flowing assistant text, sticky
   topbar/inputbar) rather than the boxed "card with two bubble columns" first pass. */

.glarion-chat-shell {
    display: flex;
    flex-direction: row;
    align-items: stretch;
    position: relative;
    height: calc(100vh - 110px);
    min-height: 480px;
    background: var(--glarion-card);
    border-radius: var(--glarion-radius);
    border: 1px solid var(--glarion-border);
    box-shadow: var(--glarion-shadow);
    overflow: hidden;
}

/* Holds the topbar/scroll/inputbar column - previously the shell's own layout, now split out so
   the shell can lay the history sidebar and this column side-by-side (see
   .glarion-chat-sidebar below). */
.glarion-chat-main {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

/* Conversation-history panel, toggled by the topbar's hamburger icon-button - lists every
   non-archived conversation (newest first), highlights the active one, and offers its own
   "New chat" entry point. On narrow viewports it becomes a full-height overlay (see the media
   query near the bottom of this block) instead of permanently splitting the available width. */
.glarion-chat-sidebar {
    width: 240px;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    background: #F9FBFF;
    border-right: 1px solid var(--glarion-border);
}

.glarion-chat-sidebar-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 14px 8px;
    font-size: 0.78rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--glarion-muted);
}

.glarion-chat-sidebar-close {
    border: none;
    background: transparent;
    color: var(--glarion-muted);
    font-size: 1.1rem;
    line-height: 1;
    cursor: pointer;
    padding: 2px 4px;
}

.glarion-chat-sidebar-new {
    margin: 4px 14px 10px;
    padding: 9px 12px;
    border-radius: 10px;
    border: 1px solid var(--glarion-border);
    background: white;
    color: var(--glarion-text);
    font-size: 0.82rem;
    font-weight: 600;
    text-align: left;
    cursor: pointer;
    transition: background 0.15s ease, border-color 0.15s ease;
}

.glarion-chat-sidebar-new:hover:not(:disabled) {
    border-color: var(--glarion-primary);
}

.glarion-chat-sidebar-new:disabled {
    opacity: 0.55;
    cursor: not-allowed;
}

.glarion-chat-sidebar-list {
    flex: 1;
    overflow-y: auto;
    padding: 0 8px 12px;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.glarion-chat-sidebar-empty {
    padding: 12px;
    font-size: 0.8rem;
    color: var(--glarion-muted);
}

.glarion-chat-sidebar-item {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 2px;
    width: 100%;
    padding: 9px 10px;
    border: none;
    border-radius: 9px;
    background: transparent;
    cursor: pointer;
    text-align: left;
    transition: background 0.15s ease;
}

.glarion-chat-sidebar-item:hover:not(:disabled) {
    background: #EFF4FC;
}

.glarion-chat-sidebar-item.active {
    background: white;
    box-shadow: inset 0 0 0 1px var(--glarion-primary);
}

.glarion-chat-sidebar-item:disabled {
    cursor: not-allowed;
    opacity: 0.7;
}

.glarion-chat-sidebar-item-title {
    font-size: 0.83rem;
    font-weight: 600;
    color: var(--glarion-text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
}

.glarion-chat-sidebar-item-time {
    font-size: 0.7rem;
    color: var(--glarion-muted);
}

@media (max-width: 720px) {
    .glarion-chat-sidebar {
        position: absolute;
        inset: 0 20% 0 0;
        z-index: 5;
        box-shadow: 8px 0 24px rgba(12, 35, 74, 0.18);
    }
}

.glarion-chat-topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 16px 22px;
    border-bottom: 1px solid var(--glarion-border);
    flex-wrap: wrap;
}

.glarion-chat-topbar-title {
    display: flex;
    align-items: center;
    gap: 12px;
}

.glarion-chat-topbar-badge {
    width: 38px;
    height: 38px;
    border-radius: 12px;
    background: linear-gradient(135deg, var(--glarion-primary), var(--glarion-primary-dark));
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    flex-shrink: 0;
}

.glarion-chat-topbar-name {
    font-weight: 700;
    font-size: 1rem;
    color: var(--glarion-text);
}

.glarion-chat-topbar-sub {
    font-size: 0.78rem;
    color: var(--glarion-muted);
}

.glarion-chat-topbar-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

.glarion-chat-icon-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 7px 14px;
    border-radius: 10px;
    border: 1px solid var(--glarion-border);
    background: #F9FBFF;
    color: var(--glarion-text);
    font-size: 0.82rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s ease, border-color 0.15s ease;
}

.glarion-chat-icon-btn:hover:not(:disabled) {
    background: white;
    border-color: var(--glarion-primary);
}

.glarion-chat-icon-btn:disabled {
    opacity: 0.55;
    cursor: not-allowed;
}

/* "Speak" TTS toggle when voice responses are on - reuses the icon-btn shape but fills it with
   the theme primary color so the on-state is unmistakable at a glance (see feedback_web_theme_colors
   memory - this app's primary is blue, not the old terracotta). */
.glarion-chat-icon-btn.active {
    background: var(--glarion-primary);
    border-color: var(--glarion-primary);
    color: white;
}

.glarion-chat-icon-btn.active:hover:not(:disabled) {
    background: var(--glarion-primary);
    border-color: var(--glarion-primary);
}

.glarion-chat-scroll {
    flex: 1;
    overflow-y: auto;
    padding: 24px 20px 8px;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.glarion-chat-hero {
    margin: auto;
    max-width: 460px;
    text-align: center;
    padding: 20px;
    color: var(--glarion-text);
}

.glarion-chat-hero-badge {
    width: 52px;
    height: 52px;
    margin: 0 auto 14px;
    border-radius: 16px;
    background: linear-gradient(135deg, var(--glarion-primary), var(--glarion-primary-dark));
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
}

.glarion-chat-hero h2 {
    margin: 0 0 8px;
    font-size: 1.15rem;
}

.glarion-chat-hero p {
    margin: 0 0 18px;
    color: var(--glarion-muted);
    font-size: 0.88rem;
    line-height: 1.5;
}

.glarion-chat-suggestions {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.glarion-chat-suggestion-chip {
    padding: 10px 14px;
    border-radius: 12px;
    border: 1px solid var(--glarion-border);
    background: #F9FBFF;
    color: var(--glarion-text);
    font-size: 0.85rem;
    text-align: left;
    cursor: pointer;
    transition: background 0.15s ease, border-color 0.15s ease;
}

.glarion-chat-suggestion-chip:hover {
    background: white;
    border-color: var(--glarion-primary);
}

.glarion-chat-row {
    display: flex;
    gap: 12px;
    align-items: flex-start;
    max-width: 800px;
    width: 100%;
    margin: 0 auto;
}

.glarion-chat-row.user {
    flex-direction: row-reverse;
}

.glarion-chat-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.72rem;
    font-weight: 700;
    flex-shrink: 0;
    color: white;
}

.glarion-chat-avatar.user {
    background: linear-gradient(135deg, var(--glarion-primary), var(--glarion-primary-dark));
}

.glarion-chat-avatar.assistant {
    background: linear-gradient(135deg, var(--glarion-accent), #FF8A00);
}

.glarion-chat-content {
    flex: 1;
    min-width: 0;
}

.glarion-chat-row.user .glarion-chat-content {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
}

.glarion-chat-role-label {
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--glarion-muted);
    margin-bottom: 5px;
}

.glarion-chat-bubble {
    font-size: 0.92rem;
    line-height: 1.55;
    word-break: break-word;
}

.glarion-chat-bubble.user {
    max-width: 100%;
    padding: 11px 16px;
    border-radius: 16px;
    border-bottom-right-radius: 4px;
    background: linear-gradient(90deg, var(--glarion-primary-dark) 0%, var(--glarion-primary) 78%);
    color: white;
    white-space: pre-wrap;
}

.glarion-chat-bubble.assistant {
    padding: 2px 0;
    color: var(--glarion-text);
}

.glarion-chat-bubble.assistant ul {
    margin: 6px 0;
    padding-left: 20px;
}

.glarion-chat-bubble.assistant code {
    background: var(--glarion-bg);
    border: 1px solid var(--glarion-border);
    border-radius: 4px;
    padding: 1px 5px;
    font-size: 0.85em;
}

/* Copy / Replay row under each completed assistant reply (Assistant.razor's _messages loop) -
   Copy writes the raw text to the clipboard (glarionUtils.copyToClipboard), Replay re-reads this
   specific message aloud via glarionUtils.speak regardless of the ambient Speak toggle, mirroring
   the Mobile app's per-message action row. */
.glarion-chat-msg-actions {
    display: flex;
    gap: 4px;
    margin-top: 4px;
}

.glarion-chat-msg-action-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 26px;
    height: 26px;
    border: none;
    background: transparent;
    color: var(--glarion-muted);
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.85rem;
    transition: background 0.15s ease, color 0.15s ease;
}

.glarion-chat-msg-action-btn:hover {
    background: var(--glarion-bg);
    color: var(--glarion-primary);
}

.glarion-chat-bubble.glarion-chat-pending,
.glarion-chat-bubble.glarion-chat-error {
    padding: 12px 16px;
    border-radius: 14px;
    border: 1px solid var(--glarion-border);
}

.glarion-chat-bubble.glarion-chat-pending {
    border-color: var(--glarion-accent);
    background: var(--glarion-accent-soft);
}

.glarion-chat-bubble.glarion-chat-error {
    border-color: var(--glarion-danger);
    color: var(--glarion-danger);
    background: rgba(228, 91, 91, 0.08);
}

.glarion-chat-bubble.glarion-chat-success {
    padding: 12px 16px;
    border-radius: 14px;
    border: 1px solid var(--glarion-success);
    color: var(--glarion-success);
    background: rgba(38, 169, 95, 0.08);
}

.glarion-chat-typing {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--glarion-muted);
    font-size: 0.85rem;
    padding: 4px 0;
}

.glarion-chat-dots {
    display: inline-flex;
    gap: 4px;
}

.glarion-chat-dots i {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--glarion-muted);
    display: inline-block;
    animation: glarion-chat-bounce 1.1s infinite ease-in-out both;
}

.glarion-chat-dots i:nth-child(2) {
    animation-delay: 0.15s;
}

.glarion-chat-dots i:nth-child(3) {
    animation-delay: 0.3s;
}

@keyframes glarion-chat-bounce {

    0%,
    80%,
    100% {
        transform: scale(0.6);
        opacity: 0.5;
    }

    40% {
        transform: scale(1);
        opacity: 1;
    }
}

/* Attachment chip - sits above the pill input bar while a file is being read/attached (see
   Assistant.razor's HandleAttachmentSelectedAsync). Reuses the OCR pipeline already built for
   Expense/Income/Inventory/PettyCash (OcrController's api/ocr/extract) - the extracted RawText
   gets folded into the outgoing chat message, no Assistant-module backend changes needed. */
.glarion-chat-attachment-chip {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0 24px 8px;
    padding: 8px 12px;
    border-radius: 12px;
    background: var(--glarion-bg);
    border: 1px solid var(--glarion-border);
    font-size: 0.82rem;
    color: var(--glarion-muted);
}

.glarion-chat-attachment-chip.error {
    color: var(--glarion-danger);
    border-color: var(--glarion-danger);
    background: rgba(228, 91, 91, 0.08);
}

.glarion-chat-attachment-chip button {
    margin-left: auto;
    border: none;
    background: transparent;
    color: inherit;
    cursor: pointer;
    font-size: 1rem;
    line-height: 1;
    padding: 2px 4px;
}

/* Pill-shaped input bar: paperclip | textarea | voice indicator | divider | mic/send. Replaces
   the old flat toolbar layout to match the reference design the user provided 2026-07-12. */
.glarion-chat-inputbar {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 0 24px 18px;
    padding: 8px 10px 8px 8px;
    border-radius: 30px;
    border: 1px solid var(--glarion-border);
    background: var(--glarion-card);
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.06);
}

.glarion-chat-inputbar textarea {
    flex: 1;
    resize: none;
    min-height: 40px;
    max-height: 160px;
    padding: 10px 4px;
    border: none;
    font-size: 0.92rem;
    font-family: inherit;
    background: transparent;
    color: var(--glarion-text);
}

.glarion-chat-inputbar textarea:focus {
    outline: none;
}

/* Paperclip attach button - a <label> wrapping a visually-hidden <InputFile>, so the native file/
   photo picker still opens on click without needing JS interop to "click" a hidden input. */
.glarion-chat-attach-btn {
    position: relative;
    flex-shrink: 0;
    width: 40px;
    height: 40px;
    border-radius: 12px;
    background: var(--glarion-bg);
    color: var(--glarion-muted);
    font-size: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    overflow: hidden;
    transition: background 0.15s ease, color 0.15s ease, opacity 0.15s ease;
}

.glarion-chat-attach-btn:hover {
    background: var(--glarion-border);
    color: var(--glarion-primary);
}

.glarion-chat-attach-btn.disabled {
    opacity: 0.45;
    pointer-events: none;
}

.glarion-chat-attach-btn input[type="file"] {
    position: absolute;
    inset: 0;
    opacity: 0;
    cursor: pointer;
}

/* Small animated bars shown next to the mic/send button only while hands-free voice mode is on
   (Assistant.razor's _voiceModeEnabled) - a "you're being heard" indicator, per the reference
   design. */
.glarion-chat-voice-indicator {
    flex-shrink: 0;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--glarion-bg);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 2px;
}

.glarion-chat-voice-indicator span {
    display: inline-block;
    width: 3px;
    border-radius: 2px;
    background: var(--glarion-primary);
    animation: glarion-voice-bar 0.9s ease-in-out infinite;
}

.glarion-chat-voice-indicator span:nth-child(1) { height: 8px; animation-delay: 0s; }
.glarion-chat-voice-indicator span:nth-child(2) { height: 16px; animation-delay: 0.15s; }
.glarion-chat-voice-indicator span:nth-child(3) { height: 10px; animation-delay: 0.3s; }
.glarion-chat-voice-indicator span:nth-child(4) { height: 14px; animation-delay: 0.45s; }

@keyframes glarion-voice-bar {
    0%, 100% { transform: scaleY(0.45); }
    50% { transform: scaleY(1); }
}

.glarion-chat-inputbar-divider {
    flex-shrink: 0;
    width: 1px;
    height: 24px;
    background: var(--glarion-border);
}

/* Single circular primary action button - shows mic (idle), a red stop square (voice mode on -
   see .listening), or a send arrow (there's typed text/an attachment ready and voice mode is off)
   depending on state; see Assistant.razor's ShowSendButton. Bigger + glowing vs. the old
   .glarion-chat-send-btn/.glarion-chat-mic-btn pair it replaces, matching the reference design. */
.glarion-chat-action-btn {
    flex-shrink: 0;
    width: 52px;
    height: 52px;
    border-radius: 50%;
    border: none;
    background: linear-gradient(135deg, var(--glarion-primary), var(--glarion-primary-dark));
    color: white;
    font-size: 1.25rem;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 6px 18px rgba(25, 118, 210, 0.35);
    transition: transform 0.15s ease, opacity 0.15s ease, background 0.15s ease, box-shadow 0.15s ease;
}

.glarion-chat-action-btn:hover:not(:disabled) {
    transform: translateY(-1px) scale(1.05);
}

.glarion-chat-action-btn:disabled {
    opacity: 0.45;
    cursor: not-allowed;
    box-shadow: none;
}

.glarion-chat-action-btn.listening {
    background: #E45B5B;
    box-shadow: 0 6px 18px rgba(228, 91, 91, 0.4);
}

.glarion-assistant-fab {
    position: fixed;
    right: 24px;
    bottom: 24px;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    border: none;
    background: linear-gradient(135deg, var(--glarion-primary), var(--glarion-primary-dark));
    color: white;
    font-size: 1.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 12px 28px rgba(13, 71, 161, 0.35);
    cursor: pointer;
    z-index: 1000;
    transition: transform 0.15s ease;
}

.glarion-assistant-fab:hover {
    transform: translateY(-2px) scale(1.05);
}

.glarion-chat-model-select {
    padding: 6px 10px;
    border-radius: 10px;
    border: 1px solid var(--glarion-border);
    background: #F9FBFF;
    color: var(--glarion-text);
    font-size: 0.82rem;
    font-family: inherit;
}

.glarion-chat-model-select:disabled {
    opacity: 0.6;
}
