/* =========================================================
   Clover S.A. — Better IDEAS
   Font: Inter  |  Sidebar: #001660  |  Background: #F2F5FC
   Primary: #0033A1  |  Secondary: #E1251B
   ========================================================= */

*, *::before, *::after { box-sizing: border-box; }

html, body {
    margin: 0;
    padding: 0;
    height: 100%;
    font-family: Inter, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    font-size: 0.8125rem;
    color: #1A2A4A;
    background: #F2F5FC;
    -webkit-font-smoothing: antialiased;
}

/* MudBlazor global font override */
.mud-typography,
.mud-button,
.mud-chip,
.mud-input,
.mud-select,
.mud-table-cell,
.mud-nav-link {
    font-family: Inter, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif !important;
}

:root {
    --mud-appbar-height: 56px;
    --mud-drawer-width-left: 240px;
}

/* =========================================================
   MUD APP BAR — white, 56px, thin bottom border
   ========================================================= */
.mud-appbar {
    height: 56px !important;
    min-height: 56px !important;
    border-bottom: 1px solid #DDE3F0 !important;
    box-shadow: none !important;
}

.page-breadcrumb {
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 1.2px;
    color: #9E9E9E;
    text-transform: uppercase;
}

/* =========================================================
   MUD DRAWER — dark navy #001660, 240px
   ========================================================= */
.mud-drawer,
.mud-drawer-paper {
    width: 240px !important;
    border: none !important;
    background: #001660 !important;
}

.mud-drawer-paper {
    display: flex !important;
    flex-direction: column !important;
    height: 100% !important;
    padding-top: 0 !important;
}

.mud-drawer .mud-nav-menu,
.mud-drawer nav {
    padding: 0 !important;
    margin: 0 !important;
}

.mud-drawer .mud-list {
    padding-top: 0 !important;
    padding-bottom: 0 !important;
}

.mud-drawer .mud-divider {
    margin: 0 !important;
}

.sidebar-header {
    padding: 16px 20px 12px;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
    flex-shrink: 0;
}

.sidebar-logo-link { display: block; }

.sidebar-logo {
    width: 100%;
    max-width: none;
    height: auto;
    display: block;
}

.sidebar-app-name {
    font-size: 0.68rem;
    font-weight: 500;
    letter-spacing: 1.2px;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.55);
}

.sidebar-nav-scroll {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    min-height: 0;
}
.sidebar-nav-scroll::-webkit-scrollbar { width: 4px; }
.sidebar-nav-scroll::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.15); border-radius: 2px; }

/* Section labels: "Management", "Device View", etc. */
.sidebar-section-label {
    padding: 12px 16px 4px;
    font-size: 0.6rem;
    font-weight: 600;
    letter-spacing: 1.5px;
    color: rgba(255, 255, 255, 0.38);
    text-transform: uppercase;
}

.sidebar-footer {
    padding: 12px 16px 14px;
    flex-shrink: 0;
}
.sidebar-footer-text {
    font-size: 0.58rem;
    font-weight: 600;
    letter-spacing: 1.2px;
    color: rgba(255, 255, 255, 0.28);
    text-transform: uppercase;
}

/* =========================================================
   MUD NAV LINK — styled for dark #001660 sidebar
   ========================================================= */
.mud-drawer .mud-nav-link,
.mud-drawer .mud-nav-link-text,
.mud-drawer .mud-nav-link * {
    color: rgba(255, 255, 255, 0.75) !important;
}

.mud-drawer .mud-nav-link {
    height: 40px !important;
    min-height: 40px !important;
    padding: 0 16px !important;
    font-size: 0.84rem !important;
    font-weight: 400 !important;
    border-radius: 0 !important;
    transition: background 0.12s ease, color 0.12s ease !important;
    display: flex !important;
    align-items: center !important;
}

.mud-drawer .mud-nav-link:hover {
    background: rgba(255, 255, 255, 0.08) !important;
}
.mud-drawer .mud-nav-link:hover,
.mud-drawer .mud-nav-link:hover .mud-nav-link-text,
.mud-drawer .mud-nav-link:hover * {
    color: #FFFFFF !important;
}

.mud-drawer .mud-nav-link.active {
    background: rgba(255, 255, 255, 0.14) !important;
    font-weight: 600 !important;
}
.mud-drawer .mud-nav-link.active,
.mud-drawer .mud-nav-link.active .mud-nav-link-text,
.mud-drawer .mud-nav-link.active * {
    color: #FFFFFF !important;
}

.mud-drawer .mud-nav-link .mud-icon-root {
    font-size: 18px !important;
    width: 18px !important;
    height: 18px !important;
    opacity: 0.65;
    flex-shrink: 0;
}
.mud-drawer .mud-nav-link:hover .mud-icon-root,
.mud-drawer .mud-nav-link.active .mud-icon-root {
    opacity: 1 !important;
}

/* =========================================================
   MAIN CONTENT AREA
   ========================================================= */
.app-content {
    padding: 24px;
    background: #F2F5FC;
    min-height: 100%;
}

/* =========================================================
   MUDBLAZOR COMPONENT OVERRIDES
   ========================================================= */

.mud-paper {
    border-radius: 4px !important;
}

.mud-button-root {
    font-family: Inter, sans-serif !important;
    font-weight: 500 !important;
    text-transform: none !important;
    letter-spacing: 0.01em !important;
    border-radius: 4px !important;
}
.mud-button-filled-primary {
    background: #0033A1 !important;
    box-shadow: none !important;
}
.mud-button-filled-primary:hover {
    background: #002278 !important;
}
.mud-button-filled-secondary {
    background: #E1251B !important;
    box-shadow: none !important;
}
.mud-button-filled-secondary:hover {
    background: #B81D15 !important;
}

.mud-table-head .mud-table-cell {
    font-size: 0.72rem !important;
    font-weight: 600 !important;
    letter-spacing: 0.5px !important;
    text-transform: uppercase !important;
    color: #5A6A8A !important;
    background: #FFFFFF !important;
    border-bottom: 1px solid #DDE3F0 !important;
    padding: 10px 16px !important;
}
.mud-table-body .mud-table-cell {
    font-size: 0.8125rem !important;
    color: #1A2A4A !important;
    border-bottom: 1px solid #F2F5FC !important;
    padding: 9px 16px !important;
}
.mud-table-row:hover .mud-table-cell {
    background: #E8EDF8 !important;
}

.mud-link {
    color: #0033A1 !important;
    font-weight: 500 !important;
    text-decoration: none !important;
}
.mud-link:hover { text-decoration: underline !important; }

.mud-typography-h3,
.mud-typography-h4,
.mud-typography-h5,
.mud-typography-h6 { color: #1A2A4A !important; font-weight: 700 !important; }

.mud-alert-color-info    { background: rgba(14,165,194,.08) !important;  border-left: 3px solid #0EA5C2 !important; }
.mud-alert-color-success { background: rgba(26,138,58,.08)  !important;  border-left: 3px solid #1A8A3A !important; }
.mud-alert-color-error   { background: rgba(225,37,27,.08)  !important;  border-left: 3px solid #E1251B !important; }
.mud-alert-color-warning { background: rgba(245,158,11,.10) !important;  border-left: 3px solid #F59E0B !important; }

::-webkit-scrollbar         { width: 8px; height: 8px; }
::-webkit-scrollbar-track   { background: transparent; }
::-webkit-scrollbar-thumb   { background: #c4c4c4; border-radius: 1px; }
::-webkit-scrollbar-thumb:hover { background: #a6a6a6; }
html, body * { scrollbar-color: #c4c4c4 transparent; scrollbar-width: thin; }

#blazor-error-ui {
    background: #E1251B;
    bottom: 0; left: 0;
    display: none;
    padding: 0.6rem 1.25rem 0.7rem;
    position: fixed;
    width: 100%;
    z-index: 1000;
    color: #fff;
    font-family: Inter, sans-serif;
}
#blazor-error-ui .dismiss { cursor: pointer; position: absolute; right: 0.75rem; top: 0.5rem; }
.blazor-error-boundary { background: #9B1B13; padding: 1rem 1rem 1rem 3.7rem; color: #fff; }
.blazor-error-boundary::after { content: "An error has occurred."; }

/* =========================================================
   STAT CARDS — solid-colour KPI tiles
   ========================================================= */
.clover-stat-card-blue  { background: #0033A1 !important; color: #fff !important; border: none !important; border-radius: 4px !important; }
.clover-stat-card-green { background: #1A8A3A !important; color: #fff !important; border: none !important; border-radius: 4px !important; }
.clover-stat-card-teal  { background: #0EA5C2 !important; color: #fff !important; border: none !important; border-radius: 4px !important; }
.clover-stat-card-red   { background: #E1251B !important; color: #fff !important; border: none !important; border-radius: 4px !important; }
.clover-stat-card-navy  { background: #001660 !important; color: #fff !important; border: none !important; border-radius: 4px !important; }

.clover-stat-card-blue  *,
.clover-stat-card-green *,
.clover-stat-card-teal  *,
.clover-stat-card-red   *,
.clover-stat-card-navy  * { color: #FFFFFF !important; }

.clover-stat-label {
    font-size: 0.7rem;
    font-weight: 500;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.8);
}

.clover-stat-value {
    font-size: 2.125rem;
    font-weight: 700;
    line-height: 1;
    color: #FFFFFF;
}

/* =========================================================
   PAGE CARD HOVER — replaces old .hover-paper
   ========================================================= */
.clover-card-hover {
    transition: box-shadow 0.3s ease, transform 0.2s ease;
}
.clover-card-hover:hover {
    box-shadow: 0 4px 20px rgba(0, 22, 96, 0.15);
    transform: scale(1.01);
    cursor: pointer;
}

/* =========================================================
   AUTH PAGE — full-viewport centered login screen
   ========================================================= */
.clover-auth-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    background:
        radial-gradient(circle at 15% 10%, rgba(0, 51, 161, 0.07), transparent 45%),
        radial-gradient(circle at 85% 90%, rgba(225, 37, 27, 0.05), transparent 45%),
        #F2F5FC;
}

.clover-auth-card {
    position: relative;
    overflow: hidden;
    border-radius: 16px !important;
    border: 1px solid #E3E8F5;
    box-shadow: 0 8px 40px rgba(0, 22, 96, 0.12), 0 2px 8px rgba(0, 22, 96, 0.05) !important;
}
.clover-auth-card::before {
    content: "";
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 4px;
    background: linear-gradient(90deg, #0033A1, #0EA5C2);
}

.clover-auth-logo {
    filter: drop-shadow(0 6px 14px rgba(0, 51, 161, 0.18));
}

.clover-auth-page .mud-input-outlined-border {
    border-radius: 10px !important;
}

.clover-auth-page .mud-button-filled-primary:not(.mud-disabled):hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(0, 51, 161, 0.28) !important;
}
.clover-auth-page .mud-button-root {
    transition: background 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease !important;
}

.clover-auth-divider {
    display: flex;
    align-items: center;
    margin: 20px 0;
    color: #9AA6C0;
    font-size: 0.7rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}
.clover-auth-divider::before,
.clover-auth-divider::after {
    content: "";
    flex: 1;
    border-bottom: 1px solid #E3E8F5;
}
.clover-auth-divider span {
    padding: 0 12px;
}

.clover-auth-footer {
    border-top: 1px solid #EEF1FA;
    margin-top: 4px;
}

/* =========================================================
   DASHBOARD HEATMAP (Impact vs Cost-Benefit)
   ========================================================= */
.clover-heatmap {
    border-collapse: separate;
    border-spacing: 2px;
    width: 100%;
    min-width: 640px; /* below this the wrapper scrolls instead of crushing cells */
    table-layout: fixed;
    font-size: 0.8125rem;
}
.clover-heatmap th {
    font-weight: 500;
    color: var(--mud-palette-text-secondary);
    padding: 6px 8px;
    text-align: center;
    vertical-align: bottom;
    white-space: normal;
    overflow-wrap: anywhere;
    line-height: 1.3;
}
/* Row labels: fixed-width first column, value columns share the rest equally. */
.clover-heatmap tbody th {
    text-align: left;
    vertical-align: middle;
}
.clover-heatmap .clover-heatmap-corner {
    width: 26%;
    font-size: 0.7rem;
    text-align: left;
}
.clover-heatmap td {
    height: 44px;
    text-align: center;
    font-weight: 600;
    border-radius: 4px;
    outline: 1px solid var(--mud-palette-lines-default);
    outline-offset: -1px;
}

/* Invisible file input stretched over the IdeaPhoto drop zone so clicks and drops reach it. */
.clover-file-input {
    opacity: 0;
}
