/* ============================================================
   User dashboard custom overrides (partner-specific branding).
   Loaded AFTER the default stylesheets, so any selector here
   with the same specificity wins by cascade order.
   ============================================================ */

/* ------------------------------------------------------------
   Logo replacements.
   The JS in pippo.js rewrites src attributes; these rules act
   as a CSS-only fallback using `content: url()` in case JS
   doesn't run.
   ------------------------------------------------------------ */
img[src$="/static/img/logo.png"] {
    content: url("/custom/img/aiconis_Logo_RGB.svg") !important;
}
img[src$="/static/img/logo_reverse.png"] {
    content: url("/custom/img/aiconis_Logo_white_RGB.svg") !important;
}
img[src$="/static/img/logo_esteso.png"] {
    content: url("/custom/img/aiconis_Logo_RGB.svg") !important;
}
img[src$="/static/img/logo_esteso_reverse.png"] {
    content: url("/custom/img/aiconis_Logo_white_RGB.svg") !important;
}

/* The aiconis SVGs declare only a viewBox (no intrinsic width/height),
   so an <img> in a flex container with width:auto can collapse to 0
   width. Force concrete dimensions for both the post-JS-swap src and
   the pre-swap src that is being replaced via `content: url()`. */
img[src*="/custom/img/aiconis_Logo"],
img[src$="/static/img/logo.png"],
img[src$="/static/img/logo_reverse.png"],
img[src$="/static/img/logo_esteso.png"],
img[src$="/static/img/logo_esteso_reverse.png"] {
    height: 50px !important;
    width: auto !important;
    max-width: 100%;
    object-fit: contain;
}

/* ============================================================
   Color palette overrides.
   Every CSS custom property that controls a platform color is
   re-declared here. Change any of them to re-skin the dashboard
   for a specific partner. The originals remain in:
     - dashboard/static/css/global_layout.css
     - dashboard/static/css/dashboard/style.css
   ============================================================ */

/* ---- Light theme (default) ---- */
:root {
    /* Core palette (blue replaces the red accent) */
    --accent-color: #1233ea;
    --accent-hover: #0e28b8;
    --accent-rgb: 18, 51, 234;

    /* Text */
    --text-primary: #1E293B;
    --text-secondary: #64748b;

    /* Backgrounds */
    --bg-color: #F8FAFC;
    --card-bg: #FFFFFF;
    --input-bg: #FFFFFF;
    --dropdown-bg: #FFFFFF;
    --block-bg: #F8FAFC;

    /* Glass / borders / shadows */
    --glass-bg: rgba(255, 255, 255, 0.8);
    --glass-border: 1px solid rgba(0, 0, 0, 0.08);
    --border-color: rgba(0, 0, 0, 0.08);
    --card-shadow-color: rgba(100, 116, 139, 0.1);
}

/* ---- Dark theme ---- */
[data-theme="dark"] {
    /* Blue accent, slightly brighter on dark for readability */
    --accent-color: #4060ff;
    --accent-hover: #6b83ff;
    --accent-rgb: 64, 96, 255;

    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;

    --bg-color: #0b1020;
    --card-bg: rgba(30, 32, 52, 0.7);
    --input-bg: rgba(15, 18, 35, 0.3);
    --dropdown-bg: #1a1d30;
    --block-bg: rgba(30, 32, 52, 0.6);

    --glass-bg: rgba(30, 32, 52, 0.45);
    --glass-border: 1px solid rgba(255, 255, 255, 0.1);
    --border-color: rgba(148, 163, 184, 0.1);
    --card-shadow-color: rgba(0, 0, 0, 0.3);
}

/* ---- Workflow category card accents (unchanged semantic colors) ---- */
.card-finance {
    --card-accent: #10b981;
    --card-icon-bg: rgba(16, 185, 129, 0.1);
    --card-shadow-color: rgba(16, 185, 129, 0.15);
}

.card-legal {
    --card-accent: #6366f1;
    --card-icon-bg: rgba(99, 102, 241, 0.1);
    --card-shadow-color: rgba(99, 102, 241, 0.15);
}

.card-hr {
    --card-accent: #f59e0b;
    --card-icon-bg: rgba(245, 158, 11, 0.1);
    --card-shadow-color: rgba(245, 158, 11, 0.15);
}

.card-it {
    --card-accent: #8b5cf6;
    --card-icon-bg: rgba(139, 92, 246, 0.1);
    --card-shadow-color: rgba(139, 92, 246, 0.15);
}

.card-marketing {
    --card-accent: #ec4899;
    --card-icon-bg: rgba(236, 72, 153, 0.1);
    --card-shadow-color: rgba(236, 72, 153, 0.15);
}

/* ============================================================
   Hardcoded color overrides.
   These platform rules set colors literally instead of via CSS
   variables, so variable redeclaration above isn't enough to
   change them — we target the selectors directly.
   ============================================================ */

/* Sidebar background (hardcoded in global_layout.css for both themes) */
#sidebar-wrapper,
[data-theme="light"] #sidebar-wrapper,
[data-theme="dark"] #sidebar-wrapper {
    background: #494454 !important;
}

/* Login / reset-password gradient (hardcoded in dashboard/style.css) */
.login-container {
    background: linear-gradient(135deg, #494454 0%, #332c49 100%) !important;
}
