/* InFact Design Tokens */
:root {
  --infact-navy:        #052767;
  --infact-plum:        #3a0647;
  --infact-sidebar-bg:  linear-gradient(180deg, #052767 0%, #3a0647 70%);
  --infact-blue:        #1b6ec2;
  --infact-blue-edge:   #1861ac;
  --infact-link:        #0071c1;
  --infact-focus:       #258cfb;
  --infact-success:     #26b050;
  --infact-danger:      #dc3545;
  --infact-warning:     #ffc107;
  --infact-info:        #0dcaf0;
  --infact-code:        #c02d76;
  --infact-white:       #ffffff;
  --infact-bg:          #f7f7f7;
  --infact-surface:     #ffffff;
  --infact-border:      #d6d5d5;
  --infact-border-soft: #e9ecef;
  --infact-fg-muted:    #6c757d;
  --infact-fg-subtle:   #adb5bd;
  --infact-fg:          #212529;
  --infact-nav-fg:           #d7d7d7;
  --infact-nav-fg-active:    #ffffff;
  --infact-nav-bg-hover:     rgba(255, 255, 255, 0.10);
  --infact-nav-bg-active:    rgba(255, 255, 255, 0.37);
  --infact-nav-topbar:       rgba(0, 0, 0, 0.40);
  --infact-font-sans:   "Helvetica Neue", Helvetica, Arial, sans-serif;
  --infact-font-md:     "Roboto", "Helvetica Neue", Helvetica, Arial, sans-serif;
  --infact-font-mono:   ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
  --infact-radius-sm:   2px;
  --infact-radius:      4px;
  --infact-radius-md:   6px;
  --infact-shadow-1:    0 2px 1px -1px rgba(0,0,0,0.20), 0 1px 1px 0 rgba(0,0,0,0.14), 0 1px 3px 0 rgba(0,0,0,0.12);
  --infact-shadow-2:    0 3px 1px -2px rgba(0,0,0,0.20), 0 2px 2px 0 rgba(0,0,0,0.14), 0 1px 5px 0 rgba(0,0,0,0.12);
  --infact-shadow-4:    0 2px 4px -1px rgba(0,0,0,0.20), 0 4px 5px 0 rgba(0,0,0,0.14), 0 1px 10px 0 rgba(0,0,0,0.12);
  --infact-topbar-h:    3.5rem;
  --infact-sidebar-w:   250px;
  --infact-ease:        cubic-bezier(0.4, 0, 0.2, 1);
  --infact-dur:         200ms;
  /* MudBlazor overrides */
  --mud-drawer-width-left: 250px;
}

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

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

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

.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 #258cfb;
}

.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+PHBhdGggZD0iTTI2My41MDYgNTFDMjY0LjcxNyA1MSAyNjUuODEzIDUxLjQ4MzcgMjY2LjYwNiA1Mi4yNjU4TDI2Ny4wNTIgNTIuNzk4NyAyNjcuNTM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IDI2My41NzYgODYuMDU0N1oiIGZpbGw9IiNGRkU1MDAiIGZpbGwtcnVsZT0iZXZlbm9kZCIvPjwvZz48L3N2Zz4=) no-repeat 1rem/1.8rem, #b32121;
    padding: 1rem 1rem 1rem 3.7rem;
    color: white;
}

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

.loading-progress {
    position: relative;
    display: block;
    width: 8rem;
    height: 8rem;
    margin: 20vh auto 1rem auto;
}

    .loading-progress circle {
        fill: none;
        stroke: #e0e0e0;
        stroke-width: 0.6rem;
        transform-origin: 50% 50%;
        transform: rotate(-90deg);
    }

        .loading-progress circle:last-child {
            stroke: #1b6ec2;
            stroke-dasharray: calc(3.141 * var(--blazor-load-percentage, 0%) * 0.8), 500%;
            transition: stroke-dasharray 0.05s ease-in-out;
        }

.loading-progress-text {
    position: absolute;
    text-align: center;
    font-weight: bold;
    inset: calc(20vh + 3.25rem) 0 auto 0.2rem;
}

    .loading-progress-text:after {
        content: var(--blazor-load-percentage-text, "Loading");
    }

code {
    color: #c02d76;
}

/* =============================================================
   InFact Navigation — Global overrides for MudBlazor drawer nav
   Scoped CSS ::deep selectors can fail to pierce MudBlazor
   component boundaries, so these are applied globally.
   ============================================================= */

.mud-drawer .mud-nav-link {
    color: #e0e0e0 !important;
    border-radius: 4px;
    font-size: 0.9rem;
    height: 2.75rem;
}

.mud-drawer .mud-nav-link:hover {
    background-color: rgba(255, 255, 255, 0.12) !important;
    color: #ffffff !important;
}

.mud-drawer .mud-nav-link.active {
    background-color: rgba(255, 255, 255, 0.22) !important;
    color: #ffffff !important;
    font-weight: 500;
}

.mud-drawer .mud-nav-link .mud-icon-root {
    color: inherit !important;
    font-size: 1.2rem;
    width: 1.2rem;
    height: 1.2rem;
    margin-right: 0.625rem;
}

.mud-drawer .mud-nav-link .mud-nav-link-text {
    color: inherit !important;
}

.infact-nav-group-label {
    color: rgba(255, 255, 255, 0.5) !important;
    font-size: 0.7rem !important;
    font-weight: 600 !important;
    letter-spacing: 0.08em !important;
    text-transform: uppercase !important;
    padding: 1rem 1rem 0.25rem !important;
    display: block;
}

/* =============================================================
   InFact Design System — Page Utility Classes
   Prefix: if- to avoid Bootstrap/MudBlazor conflicts
   ============================================================= */

.material-symbols-outlined {
  font-variation-settings: 'FILL' 0, 'wght' 400, 'GRAD' 0, 'opsz' 20;
  font-size: 20px;
  vertical-align: middle;
}

/* Page heading + subtext */
.if-h1 { font-size: 1.75rem; font-weight: 300; margin: 0 0 4px; line-height: 1.2; letter-spacing: -0.005em; }
.if-subtle { color: var(--infact-fg-muted); font-size: 13px; }
.if-toolbar { display: flex; align-items: center; gap: 8px; margin-bottom: 14px; }
.if-toolbar .if-spacer { flex: 1; }
.if-link { color: var(--infact-link); text-decoration: none; cursor: pointer; }
.if-link:hover { text-decoration: underline; }

/* Grid layout */
.if-grid { display: grid; gap: 16px; }
.if-grid-4 { grid-template-columns: repeat(4, 1fr); }
.if-grid-3 { grid-template-columns: repeat(3, 1fr); }
.if-grid-2 { grid-template-columns: 2fr 1fr; }
.if-grid-2e { grid-template-columns: 1fr 1fr; }

/* Cards */
.if-card {
  background: #fff;
  border: 1px solid #e9ecef;
  border-radius: 4px;
  padding: 16px 18px;
  box-shadow: var(--infact-shadow-2);
}

/* KPI card */
.if-kpi { display: flex; flex-direction: column; gap: 6px; position: relative; }
.if-kpi-label { text-transform: uppercase; font-size: 10px; letter-spacing: 2px; color: var(--infact-fg-muted); font-weight: 500; }
.if-kpi-num { font-size: 2rem; font-weight: 700; color: #052767; letter-spacing: -0.5px; font-variant-numeric: tabular-nums; line-height: 1.05; }
.if-kpi-delta { font-size: 12px; color: #1c7c39; display: flex; align-items: center; gap: 6px; }
.if-kpi-delta::before { content: ""; width: 5px; height: 5px; border-radius: 50%; background: #1c7c39; flex-shrink: 0; }
.if-kpi-delta.neg { color: #a52532; }
.if-kpi-delta.neg::before { background: #a52532; }
.if-kpi::before { content: ""; position: absolute; top: 16px; right: 18px; width: 20px; height: 1.5px; background: #1b6ec2; }

/* Section heading */
.if-section-h { font-size: 13px; font-weight: 500; color: var(--infact-fg-muted); text-transform: uppercase; letter-spacing: 0.06em; margin: 18px 0 8px; }

.if-num-cell { font-variant-numeric: tabular-nums; text-align: right; }

/* Tabs */
.if-tabs { display: flex; border-bottom: 1px solid #d6d5d5; margin-bottom: 14px; }
.if-tab {
  padding: 10px 16px; cursor: pointer; font-size: 13px; font-weight: 500;
  color: var(--infact-fg-muted); border-bottom: 2px solid transparent;
  margin-bottom: -1px; transition: color 120ms;
}
.if-tab:hover { color: var(--infact-fg); }
.if-tab.active { color: var(--infact-blue); border-bottom-color: var(--infact-blue); }

/* Appointment calendar */
.if-calendar {
  display: grid; grid-template-columns: 80px repeat(5, 1fr);
  background: #fff; border: 1px solid #e9ecef; border-radius: 4px; overflow: hidden;
}
.if-calendar .cal-h {
  background: #f7f7f7; padding: 8px; font-size: 11px; text-transform: uppercase;
  color: var(--infact-fg-muted); letter-spacing: 0.06em;
  border-bottom: 1px solid #d6d5d5; text-align: center; font-weight: 500;
}
.if-calendar .cal-h.time { text-align: right; padding-right: 12px; }
.if-calendar .cal-slot { border-bottom: 1px solid #f1f3f5; min-height: 36px; padding: 2px; position: relative; }
.if-calendar .cal-slot.tcol {
  background: #f7f7f7; font-size: 11px; color: var(--infact-fg-muted);
  text-align: right; padding: 4px 12px 0 0;
  border-right: 1px solid #e9ecef; font-variant-numeric: tabular-nums;
}
.if-appt { background: #eaeef5; border-left: 3px solid #1b6ec2; color: #112d57; padding: 4px 6px; font-size: 11px; border-radius: 2px; height: 100%; overflow: hidden; }
.if-appt.green  { background: #e8f5ec; border-left-color: #26b050; color: #14471f; }
.if-appt.amber  { background: #fff8e1; border-left-color: #ffc107; color: #5a4400; }
.if-appt.purple { background: #f3e8f6; border-left-color: #5e2270; color: #3d124c; }

/* Contextual menus */
.if-menu { background: #fff; border: 1px solid #d6d5d5; border-radius: 4px; box-shadow: var(--infact-shadow-4); padding: 6px 0; }
.if-menu-item { padding: 6px 14px; font-size: 13px; cursor: pointer; }
.if-menu-item:hover { background: rgba(0,0,0,0.04); }
.if-menu-item.danger { color: #dc3545; }
.if-menu-sep { height: 1px; background: #e9ecef; margin: 4px 0; }
