/*
 * Nusatec Insight - Industrial Light Theme
 * Flat design dengan palet warna coklat tua, hitam, abu
 */

/* ============================================================================
   COLOR PALETTE
   ============================================================================ */

:root {
    /* Primary Colors - Red & Blue Industrial Theme */
    --color-deep-red: #8B0000;
    --color-navy-blue: #0D1642;
    --color-dark-blue: #1A1F3A;
    --color-charcoal: #212121;
    --color-medium-gray: #616161;
    --color-light-gray: #BDBDBD;
    --color-off-white: #F5F5F5;
    --color-white: #FFFFFF;

    /* Accent Colors */
    --color-bright-red: #B71C1C;
    --color-bright-blue: #1565C0;
    --color-green: #388E3C;
    --color-orange: #FF6F00;
    --color-yellow: #FFA000;

    /* Status Colors */
    --status-running: #388E3C;
    --status-idle: #FFA000;
    --status-down: #D32F2F;
    --status-maintenance: #455A64;

    /* Alert Severity */
    --alert-critical: #D32F2F;
    --alert-warning: #FF6F00;
    --alert-info: #455A64;

    /* Layout */
    --navbar-height: 65px;
    --sidebar-width: 250px;

    /* Typography */
    --font-main: 'Inter', 'Roboto', -apple-system, BlinkMacSystemFont, sans-serif;
    --font-mono: 'Roboto Mono', 'Courier New', monospace;
}

/* ============================================================================
   GLOBAL STYLES
   ============================================================================ */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: var(--font-main);
    background-color: var(--color-off-white);
    color: var(--color-charcoal);
    font-size: 14px;
    line-height: 1.6;
}

/* Smooth scrolling */
html {
    scroll-behavior: smooth;
}

/* Main content - transitions disabled for instant page load */
main.container-fluid {
    opacity: 1;
    transform: translateY(0);
    /* Transitions disabled - using normal page navigation */
    /* transition: opacity 0.15s ease-out, transform 0.15s ease-out; */
    /* will-change: opacity, transform; */
    min-height: calc(100vh - var(--navbar-height) - 100px);
}

/* Prevent layout shift during navigation */
.card,
.table,
.chart-container {
    content-visibility: auto;
    contain-intrinsic-size: auto 300px;
}

/* Page loading overlay */
.page-loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(2px);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.1s ease-out;
}

.page-loading-spinner {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
}

.page-loading-spinner .spinner-border {
    width: 2.5rem;
    height: 2.5rem;
    border-width: 3px;
    color: var(--color-navy-blue) !important;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

/* ============================================================================
   TYPOGRAPHY
   ============================================================================ */

h1, h2, h3, h4, h5, h6 {
    color: var(--color-charcoal);
    font-weight: 600;
    margin-bottom: 1rem;
}

h1 { font-size: 2rem; }
h2 { font-size: 1.75rem; }
h3 { font-size: 1.5rem; }
h4 { font-size: 1.25rem; }
h5 { font-size: 1rem; }
h6 { font-size: 0.875rem; }

.text-muted {
    color: var(--color-medium-gray) !important;
}

.metric-value {
    font-family: var(--font-mono);
    font-weight: 700;
    font-size: 2rem;
    line-height: 1.2;
    min-height: 2.5rem;
    display: block;
}

/* ============================================================================
   NAVIGATION BAR
   ============================================================================ */

.navbar-custom {
    background-color: var(--color-white) !important;
    height: var(--navbar-height);
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    border-top: 4px solid var(--color-deep-red);
    border-bottom: 4px solid var(--color-navy-blue);
}

.navbar-logo {
    height: 45px;
    max-width: 180px;
    object-fit: contain;
    display: block;
    transition: opacity 0.2s ease;
}

.navbar-logo:hover {
    opacity: 0.85;
}

.navbar-custom .navbar-brand {
    padding: 0.4rem 0;
    margin-right: 2rem;
    display: flex;
    align-items: center;
}

.navbar-custom .navbar-brand:hover {
    opacity: 0.9;
}

.navbar-custom .nav-link {
    color: var(--color-charcoal) !important;
    font-weight: 500;
    padding: 0.5rem 1rem;
    transition: all 0.2s ease;
    border-radius: 4px;
    margin: 0 0.25rem;
    position: relative;
}

.navbar-custom .nav-link:hover {
    color: var(--color-deep-red) !important;
    background-color: rgba(139, 0, 0, 0.05);
}

.navbar-custom .nav-link.active {
    color: var(--color-deep-red) !important;
    background-color: rgba(139, 0, 0, 0.08);
    font-weight: 600;
}

/* Active menu indicator - arrow (exclude dropdowns to avoid double arrow) */
.navbar-custom .nav-link.active:not(.dropdown-toggle)::after {
    content: '';
    position: absolute;
    bottom: -8px;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 0;
    border-left: 7px solid transparent;
    border-right: 7px solid transparent;
    border-bottom: 7px solid var(--color-deep-red);
}

.navbar-custom .nav-link .badge {
    background-color: var(--color-deep-red) !important;
}

/* User Dropdown */
.navbar-custom .dropdown-toggle {
    color: var(--color-charcoal) !important;
}

.navbar-custom .dropdown-toggle:hover {
    color: var(--color-navy-blue) !important;
}

/* Dropdown Menu - Light background with dark text (good contrast) */
.navbar-custom .dropdown-menu {
    background-color: var(--color-white);
    border: 2px solid var(--color-light-gray);
    border-top: 3px solid var(--color-navy-blue);
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    margin-top: 0.5rem;
}

/* Dropdown Items - Dark text on light background */
.navbar-custom .dropdown-item {
    color: var(--color-charcoal) !important;  /* Dark text */
    padding: 0.5rem 1rem;
    transition: all 0.2s ease;
    background-color: transparent;
}

/* Dropdown Item Hover - Dark blue background with white text (good contrast) */
.navbar-custom .dropdown-item:hover {
    background-color: var(--color-navy-blue) !important;  /* Dark blue background */
    color: var(--color-white) !important;  /* White text for contrast */
    padding-left: 1.5rem;
}

/* Dropdown Item Active - Same as hover for consistency */
.navbar-custom .dropdown-item.active {
    background-color: var(--color-navy-blue) !important;
    color: var(--color-white) !important;
}

/* Dropdown Header - Keep dark text on light background */
.navbar-custom .dropdown-header {
    color: var(--color-medium-gray) !important;
    font-weight: 600;
}

/* Dropdown Divider */
.navbar-custom .dropdown-divider {
    border-color: var(--color-light-gray);
}

/* Mobile Toggler */
.navbar-custom .navbar-toggler {
    border: 2px solid var(--color-navy-blue);
    padding: 0.25rem 0.5rem;
}

.navbar-custom .navbar-toggler:focus {
    box-shadow: 0 0 0 0.25rem rgba(13, 22, 66, 0.25);
}

.navbar-custom .navbar-toggler-icon {
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 30'%3e%3cpath stroke='%230D1642' stroke-linecap='round' stroke-miterlimit='10' stroke-width='2' d='M4 7h22M4 15h22M4 23h22'/%3e%3c/svg%3e");
}

/* ============================================================================
   CARDS & PANELS
   ============================================================================ */

.card {
    background-color: var(--color-white);
    border: 2px solid var(--color-light-gray);
    border-radius: 4px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
    margin-bottom: 1.5rem;
    animation: cardFadeIn 0.3s ease-out;
}

@keyframes cardFadeIn {
    from {
        opacity: 0;
        transform: translateY(8px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.card-header {
    background-color: var(--color-off-white);
    border-bottom: 2px solid var(--color-light-gray);
    padding: 0.75rem 1.25rem;
    font-weight: 600;
    color: var(--color-charcoal);
}

.card-body {
    padding: 1.25rem;
}

.card-flat {
    box-shadow: none;
    border: 1px solid var(--color-light-gray);
}

/* Dashboard Cards */
.dashboard-card {
    height: 100%;
    transition: transform 0.2s ease;
}

.dashboard-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

/* Asset Status Card */
.asset-card {
    border-left: 4px solid var(--color-medium-gray);
}

.asset-card.status-running {
    border-left-color: var(--status-running);
}

.asset-card.status-idle {
    border-left-color: var(--status-idle);
}

.asset-card.status-down {
    border-left-color: var(--status-down);
}

.asset-card.status-maintenance {
    border-left-color: var(--status-maintenance);
}

/* ============================================================================
   BUTTONS
   ============================================================================ */

.btn {
    font-weight: 500;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    font-size: 0.9rem;
    transition: all 0.2s ease;
    border: none;
}

.btn i {
    font-size: 0.9rem;
    margin-right: 0.375rem;
}

.btn-primary {
    background-color: var(--color-navy-blue);
    color: var(--color-white) !important;  /* Force white text on dark background */
    border: 2px solid var(--color-deep-red);
}

.btn-primary:hover {
    background-color: var(--color-deep-red);
    color: var(--color-white) !important;  /* Force white text on dark background */
    border-color: var(--color-navy-blue);
}

.btn-sm {
    padding: 0.375rem 0.75rem;
    font-size: 0.85rem;
}

.btn-sm i {
    font-size: 0.85rem;
    margin-right: 0.25rem;
}

.btn-lg {
    padding: 0.625rem 1.25rem;
    font-size: 1rem;
}

.btn-lg i {
    font-size: 1rem;
    margin-right: 0.5rem;
}

.btn-secondary {
    background-color: transparent;
    color: var(--color-charcoal);
    border: 1px solid var(--color-medium-gray);
}

.btn-secondary:hover {
    background-color: var(--color-off-white);
    border-color: var(--color-charcoal);
}

.btn-success {
    background-color: var(--color-green);
    color: var(--color-white) !important;  /* Force white text on dark background */
}

.btn-warning {
    background-color: var(--color-orange);
    color: var(--color-white) !important;  /* Force white text on dark background */
}

.btn-danger {
    background-color: var(--status-down);
    color: var(--color-white) !important;  /* Force white text on dark background */
}

/* ============================================================================
   STATUS BADGES & INDICATORS
   ============================================================================ */

.badge {
    font-weight: 500;
    padding: 0.35rem 0.75rem;
    border-radius: 20px;
    font-size: 0.85rem;
}

.badge-running {
    background-color: #E8F5E9;
    color: #2E7D32;
}

.badge-idle {
    background-color: #FFF8E1;
    color: #F57F17;
}

.badge-down {
    background-color: #FFEBEE;
    color: #C62828;
}

.badge-maintenance {
    background-color: #ECEFF1;
    color: #455A64;
}

/* Status Indicator Dots */
.status-dot {
    display: inline-block;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    margin-right: 8px;
}

.status-dot.running {
    background-color: var(--status-running);
    box-shadow: 0 0 0 2px rgba(56, 142, 60, 0.2);
}

.status-dot.idle {
    background-color: var(--status-idle);
    box-shadow: 0 0 0 2px rgba(255, 160, 0, 0.2);
}

.status-dot.down {
    background-color: var(--status-down);
    box-shadow: 0 0 0 2px rgba(211, 47, 47, 0.2);
}

.status-dot.maintenance {
    background-color: var(--status-maintenance);
    box-shadow: 0 0 0 2px rgba(69, 90, 100, 0.2);
}

/* ============================================================================
   ALERTS
   ============================================================================ */

.alert-item {
    border-left: 4px solid;
    padding: 1rem;
    margin-bottom: 0.75rem;
    background-color: var(--color-white);
    border-radius: 4px;
}

.alert-item.critical {
    border-left-color: var(--alert-critical);
    background-color: #FFEBEE;
}

.alert-item.warning {
    border-left-color: var(--alert-warning);
    background-color: #FFF3E0;
}

.alert-item.info {
    border-left-color: var(--alert-info);
    background-color: #E3F2FD;
}

.alert-severity {
    font-weight: 700;
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.5px;
}

/* ============================================================================
   TABLES
   ============================================================================ */

.table {
    background-color: var(--color-white);
}

.table thead th {
    background-color: var(--color-off-white);
    color: var(--color-charcoal);
    font-weight: 600;
    border-bottom: 2px solid var(--color-light-gray);
    padding: 0.75rem;
}

.table tbody tr {
    border-bottom: 1px solid var(--color-light-gray);
}

.table tbody tr:hover {
    background-color: var(--color-off-white);
}

.table tbody td {
    padding: 0.75rem;
    color: var(--color-charcoal);
}

.table-striped tbody tr:nth-of-type(odd) {
    background-color: rgba(245, 245, 245, 0.5);
}

/* ============================================================================
   OEE METRICS DISPLAY
   ============================================================================ */

.oee-metric {
    text-align: center;
    padding: 1rem 0.5rem;
}

.oee-metric-label {
    font-size: 0.75rem;
    color: var(--color-medium-gray);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 0.5rem;
    font-weight: 600;
}

.gauge-container {
    position: relative;
    width: 100px;
    height: 100px;
    margin: 0 auto 0.5rem auto;
}

.gauge-container canvas {
    max-width: 100%;
    max-height: 100%;
}

.gauge-value {
    font-family: var(--font-mono);
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--color-charcoal);
    line-height: 1.2;
    display: block;
    margin-top: 0.25rem;
}

.oee-metric-value {
    font-family: var(--font-mono);
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--color-charcoal);
    line-height: 1.2;
    min-width: 120px;
    display: inline-block;
}

.oee-metric-unit {
    font-size: 1.25rem;
    color: var(--color-medium-gray);
    vertical-align: baseline;
}

/* OEE Rating Colors */
.oee-world-class {
    color: #388E3C !important;  /* Green - World Class */
}

.oee-good {
    color: #FFA000 !important;  /* Yellow - Good */
}

.oee-fair {
    color: #FF6F00 !important;  /* Orange - Fair */
}

.oee-poor {
    color: #D32F2F !important;  /* Red - Poor */
}

/* ============================================================================
   FORMS
   ============================================================================ */

.form-control {
    border: 1px solid var(--color-light-gray);
    border-radius: 4px;
    padding: 0.5rem 0.75rem;
    font-size: 0.875rem;
}

.form-control:focus {
    border-color: var(--color-dark-brown);
    box-shadow: 0 0 0 3px rgba(62, 39, 35, 0.1);
    outline: none;
}

.form-label {
    font-weight: 600;
    color: var(--color-charcoal);
    margin-bottom: 0.5rem;
}

/* ============================================================================
   CHARTS
   ============================================================================ */

.chart-container {
    position: relative;
    height: 300px;
    margin: 1rem 0;
}

/* ============================================================================
   LOGIN PAGE
   ============================================================================ */

/* Particles Canvas Background */
#particles-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
    background: #F5F5F5;  /* Solid light gray - no gradient */
    pointer-events: none;  /* Allow clicks to pass through */
}

.login-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    z-index: 2;  /* Above particles canvas */
}

.login-card {
    width: 100%;
    max-width: 400px;
    padding: 2rem;
    background-color: rgba(255, 255, 255, 0.95);  /* Slightly transparent */
    backdrop-filter: blur(10px);  /* Blur effect for depth */
    border-radius: 12px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15),
                0 0 0 1px rgba(0, 0, 0, 0.05);  /* Soft elevated shadow */
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.login-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 25px 80px rgba(0, 0, 0, 0.2),
                0 0 0 1px rgba(0, 0, 0, 0.05);
}

.login-logo {
    text-align: center;
    margin-bottom: 2rem;
}

.login-logo-image {
    max-width: 220px;
    height: auto;
    margin: 0 auto;
    display: block;
}

.login-logo h1 {
    color: var(--color-deep-red);
    font-size: 2rem;
    font-weight: 700;
}

.login-logo p {
    color: var(--color-medium-gray);
    font-size: 0.875rem;
}

/* ============================================================================
   UTILITIES
   ============================================================================ */

.page-header {
    padding: 2rem 0 1rem 0;
    border-bottom: 2px solid var(--color-light-gray);
    margin-bottom: 2rem;
}

.page-title {
    font-size: 2rem;
    font-weight: 700;
    color: var(--color-charcoal);
}

.page-subtitle {
    color: var(--color-medium-gray);
    font-size: 1rem;
}

.divider {
    height: 1px;
    background-color: var(--color-light-gray);
    margin: 1.5rem 0;
}

/* Spacing */
.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mt-4 { margin-top: 2rem; }

.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }
.mb-4 { margin-bottom: 2rem; }

/* Text Alignment */
.text-center { text-align: center; }
.text-left { text-align: left; }
.text-right { text-align: right; }

/* ============================================================================
   RESPONSIVE
   ============================================================================ */

@media (max-width: 768px) {
    .navbar-logo {
        height: 32px;
        max-width: 160px;
    }

    .navbar-custom {
        height: auto;
        min-height: 58px;
    }

    .login-logo-image {
        max-width: 180px;
    }

    .oee-metric-value {
        font-size: 2rem;
    }

    .metric-value {
        font-size: 1.75rem;
    }

    .page-title {
        font-size: 1.5rem;
    }
}

@media (max-width: 480px) {
    .navbar-logo {
        height: 28px;
        max-width: 120px;
    }

    .login-logo-image {
        max-width: 140px;
    }
}

/* ============================================================================
   MODAL - Use Bootstrap 5 Defaults
   ============================================================================ */

/* Ensure navbar stays below modals */
.navbar-custom.sticky-top {
    z-index: 1020;
}

/* Bootstrap 5 Modal - z-index hierarchy:
   - modal-backdrop: 1050
   - modal: 1055
   - navbar sticky-top: 1020 (below modals)
   Let Bootstrap handle pointer-events naturally - do NOT override them
*/

/* Ensure modal backdrop covers everything including fixed elements */
.modal-backdrop {
    z-index: 1050 !important;
}

.modal {
    z-index: 1055 !important;
}

/* Custom styling for modal headers to match theme */
.modal-header {
    background-color: var(--color-off-white);
    border-bottom: 2px solid var(--color-light-gray);
}

.modal-title {
    color: var(--color-charcoal);
    font-weight: 600;
}

.modal-footer {
    background-color: var(--color-off-white);
    border-top: 2px solid var(--color-light-gray);
}

/* ============================================
   CHART SKELETON LOADING
   ============================================ */

/* Hide canvas initially until loaded */
.chart-canvas {
    opacity: 0;
    transition: opacity 0.3s ease-in;
}

.chart-canvas.loaded {
    opacity: 1;
}

/* Skeleton loader container */
.chart-skeleton {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    align-items: flex-end;
    justify-content: space-around;
    padding: 40px 20px 30px;
    background: transparent;
    z-index: 1;
    transition: opacity 0.3s ease-out;
}

.chart-skeleton.hidden {
    opacity: 0;
    pointer-events: none;
}

/* Individual skeleton bars */
.skeleton-bar {
    flex: 1;
    max-width: 80px;
    margin: 0 5px;
    background: #E0E0E0;  /* Solid gray - no gradient */
    border-radius: 4px 4px 0 0;
    animation: skeleton-pulse 1.5s ease-in-out infinite;
}

/* Staggered heights for visual variety */
.skeleton-bar:nth-child(1) { height: 60%; }
.skeleton-bar:nth-child(2) { height: 75%; }
.skeleton-bar:nth-child(3) { height: 85%; }
.skeleton-bar:nth-child(4) { height: 70%; }
.skeleton-bar:nth-child(5) { height: 90%; }
.skeleton-bar:nth-child(6) { height: 80%; }
.skeleton-bar:nth-child(7) { height: 65%; }

/* Simple opacity pulse animation - no gradient shimmer */
@keyframes skeleton-pulse {
    0%, 100% {
        opacity: 0.6;
    }
    50% {
        opacity: 1;
    }
}

/* ============================================================================
   CALENDAR SKELETON LOADER
   ============================================================================ */

/* Calendar skeleton container */
.calendar-skeleton {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: auto;
    max-height: 100%;
    background: #fff;
    z-index: 10;
    padding: 20px;
    padding-bottom: 0;
    transition: opacity 0.3s ease-out;
    overflow: hidden;
}

.calendar-skeleton.hidden {
    opacity: 0;
    pointer-events: none;
}

/* Calendar header (days of week) */
.calendar-skeleton-header {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 8px;
    margin-bottom: 12px;
}

.skeleton-header-cell {
    height: 30px;
    background: #E8E8E8;
    border-radius: 4px;
    animation: skeleton-pulse 1.5s ease-in-out infinite;
}

/* Calendar grid (days) */
.calendar-skeleton-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 8px;
}

.skeleton-day-cell {
    height: 80px;
    background: linear-gradient(to bottom, #F5F5F5 0%, #E0E0E0 50%, #F5F5F5 100%);
    border-radius: 4px;
    animation: skeleton-pulse 1.5s ease-in-out infinite;
}

/* Stagger animation for more natural feel */
.skeleton-day-cell:nth-child(1) { animation-delay: 0s; }
.skeleton-day-cell:nth-child(2) { animation-delay: 0.05s; }
.skeleton-day-cell:nth-child(3) { animation-delay: 0.1s; }
.skeleton-day-cell:nth-child(4) { animation-delay: 0.15s; }
.skeleton-day-cell:nth-child(5) { animation-delay: 0.2s; }
.skeleton-day-cell:nth-child(6) { animation-delay: 0.25s; }
.skeleton-day-cell:nth-child(7) { animation-delay: 0.3s; }

/* ============================================================================
   DARK BACKGROUND TEXT FIX - Force white text on dark backgrounds
   ============================================================================ */

/* Any element with dark background should have white text */
[style*="background: #0D1642"],
[style*="background-color: #0D1642"],
[style*="background: #1565C0"],
[style*="background-color: #1565C0"],
.bg-dark,
.bg-primary,
.navbar-dark {
    color: white !important;
}

/* Force all child text elements to be white on dark backgrounds */
[style*="background: #0D1642"] h1,
[style*="background: #0D1642"] h2,
[style*="background: #0D1642"] h3,
[style*="background: #0D1642"] h4,
[style*="background: #0D1642"] h5,
[style*="background: #0D1642"] h6,
[style*="background: #0D1642"] p,
[style*="background: #0D1642"] span,
[style*="background: #0D1642"] div,
[style*="background-color: #0D1642"] h1,
[style*="background-color: #0D1642"] h2,
[style*="background-color: #0D1642"] h3,
[style*="background-color: #0D1642"] h4,
[style*="background-color: #0D1642"] h5,
[style*="background-color: #0D1642"] h6,
[style*="background-color: #0D1642"] p,
[style*="background-color: #0D1642"] span,
[style*="background-color: #0D1642"] div {
    color: white !important;
}

/* ============================================================================
   DASHBOARD MANAGER PAGE
   ============================================================================ */

/* Page Header - Dark navy blue background with white text */
.dashboard-page-header {
    background: var(--color-navy-blue);
    color: var(--color-white) !important;
    padding: 2rem;
    margin: -1rem -1rem 2rem -1rem;
    border-radius: 0 0 12px 12px;
}

/* Force all text in page header to be white */
.dashboard-page-header h1,
.dashboard-page-header h2,
.dashboard-page-header h3,
.dashboard-page-header h4,
.dashboard-page-header h5,
.dashboard-page-header h6,
.dashboard-page-header p,
.dashboard-page-header span,
.dashboard-page-header div {
    color: var(--color-white) !important;
}

/* Dashboard Cards */
.dashboard-card {
    border: 1px solid #E0E0E0;
    border-radius: 12px;
    padding: 1.5rem;
    background: var(--color-white);
    transition: all 0.3s;
    cursor: pointer;
    height: 100%;
}

.dashboard-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.12);
    border-color: var(--color-bright-blue);
}

.dashboard-icon {
    width: 44px;
    height: 44px;
    border-radius: 8px;
    background: var(--color-navy-blue);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--color-white) !important;
    font-size: 1.25rem;
    margin-bottom: 0.875rem;
}

.dashboard-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--color-charcoal);
    margin-bottom: 0.5rem;
}

.dashboard-description {
    color: var(--color-medium-gray);
    font-size: 0.9rem;
    margin-bottom: 1rem;
    min-height: 40px;
}

.dashboard-meta {
    display: flex;
    gap: 1rem;
    font-size: 0.85rem;
    color: #9E9E9E;
    border-top: 1px solid #E0E0E0;
    padding-top: 0.75rem;
}

.dashboard-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.3rem 0.6rem;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 500;
    margin-right: 0.5rem;
    margin-bottom: 0.5rem;
}

.badge-default {
    background: #E8F5E9;
    color: #2E7D32;
}

.badge-shared {
    background: #E3F2FD;
    color: var(--color-bright-blue);
}

.dashboard-actions {
    display: flex;
    gap: 0.5rem;
    margin-top: 0.75rem;
}

.btn-dashboard-action {
    flex: 1;
    padding: 0.5rem;
    border: 1px solid #E0E0E0;
    background: var(--color-white);
    color: var(--color-medium-gray);
    border-radius: 6px;
    font-size: 0.85rem;
    transition: all 0.2s;
}

.btn-dashboard-action:hover {
    background: var(--color-bright-blue);
    color: var(--color-white) !important;
    border-color: var(--color-bright-blue);
}

.btn-create-dashboard {
    background: var(--color-green);
    border: none;
    color: var(--color-white) !important;
    padding: 0.625rem 1.25rem;
    border-radius: 6px;
    font-weight: 500;
    font-size: 0.9rem;
    transition: all 0.3s;
}

.btn-create-dashboard:hover {
    background: #2E7D32;
    color: var(--color-white) !important;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(56, 142, 60, 0.3);
}

.btn-create-dashboard i {
    font-size: 1rem;
    margin-right: 0.5rem;
}

.section-title {
    font-size: 1.15rem;
    font-weight: 600;
    color: var(--color-charcoal);
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.section-title i {
    font-size: 1.1rem;
    color: var(--color-medium-gray);
}

.empty-state {
    text-align: center;
    padding: 3rem;
    background: var(--color-white);
    border-radius: 12px;
    border: 2px dashed var(--color-light-gray);
}

.empty-state i {
    font-size: 3rem;
    color: var(--color-light-gray);
    margin-bottom: 1rem;
}

/* Empty State Buttons - Professional and Proportional */
.empty-state .btn {
    padding: 0.625rem 1.5rem;
    font-size: 0.9rem;
    font-weight: 500;
    border-radius: 6px;
    transition: all 0.2s ease;
}

.empty-state .btn i {
    font-size: 1rem;
    margin-right: 0.5rem;
    color: inherit;
}

/* ============================================================================
   DASHBOARD VIEW PAGE (Dashboard Builder)
   ============================================================================ */

/* Dashboard Header - Dark navy blue background with white text */
.dashboard-header {
    background: var(--color-navy-blue);
    color: var(--color-white) !important;
    padding: 1.5rem;
    margin: -1rem -1rem 1.5rem -1rem;
    border-radius: 0 0 12px 12px;
}

/* Force all text in dashboard header to be white */
.dashboard-header h1,
.dashboard-header h2,
.dashboard-header h3,
.dashboard-header h4,
.dashboard-header h5,
.dashboard-header h6,
.dashboard-header p,
.dashboard-header span,
.dashboard-header div {
    color: var(--color-white) !important;
}

/* Mode Toggle */
.mode-toggle {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.mode-badge {
    padding: 0.4rem 0.8rem;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 500;
    background: rgba(255, 255, 255, 0.2);
}

.btn-mode-toggle {
    background: rgba(255, 255, 255, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: var(--color-white) !important;
    padding: 0.5rem 0.875rem;
    border-radius: 6px;
    font-size: 0.875rem;
    font-weight: 500;
    transition: all 0.3s;
}

.btn-mode-toggle:hover {
    background: rgba(255, 255, 255, 0.25);
    color: var(--color-white) !important;
}

.btn-mode-toggle.active {
    background: var(--color-white);
    color: var(--color-bright-blue) !important;
    border-color: var(--color-white);
}

.btn-mode-toggle i {
    font-size: 0.875rem;
    margin-right: 0.375rem;
}

/* Gridstack Container */
.grid-stack {
    background: transparent;
}

.grid-stack-item {
    border-radius: 8px;
    overflow: hidden;
}

.grid-stack-item-content {
    background: var(--color-white);
    border: 1px solid #E0E0E0;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    height: 100%;
    transition: all 0.3s;
}

.grid-stack-item-content:hover {
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
}

/* Widget Header */
.widget-header {
    background: #F5F5F5;
    padding: 0.75rem 1rem;
    border-bottom: 1px solid #E0E0E0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: move;
}

.widget-title {
    font-weight: 600;
    font-size: 0.95rem;
    color: var(--color-charcoal);
    margin: 0;
}

.widget-actions {
    display: flex;
    gap: 0.5rem;
    opacity: 0;
    transition: opacity 0.2s;
}

.grid-stack-item:hover .widget-actions {
    opacity: 1;
}

.widget-action-btn {
    background: var(--color-white);
    border: 1px solid var(--color-light-gray);
    color: var(--color-medium-gray);
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.2s;
}

.widget-action-btn:hover {
    background: var(--color-bright-blue);
    color: var(--color-white) !important;
    border-color: var(--color-bright-blue);
}

/* Widget Content */
.widget-content {
    flex: 1;
    padding: 1rem;
    overflow: auto;
}

/* Add Widget Button - Professional and Proportional */
.btn-add-widget {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: var(--color-navy-blue);
    color: var(--color-white) !important;
    border: none;
    box-shadow: 0 3px 12px rgba(13, 22, 66, 0.3);
    font-size: 1.25rem;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s;
    z-index: 1000;
}

.btn-add-widget:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 16px rgba(21, 101, 192, 0.4);
}

/* View Mode Styles */
.view-mode .widget-header {
    cursor: default;
}

.view-mode .grid-stack-item {
    cursor: default !important;
}

.view-mode .btn-add-widget {
    display: none;
}

/* Edit Mode */
.edit-mode .widget-header {
    background: #E3F2FD;
    border-bottom-color: #90CAF9;
}

.edit-mode .grid-stack-item-content {
    border-color: #90CAF9;
}

/* Empty Dashboard State */
.empty-dashboard {
    text-align: center;
    padding: 3rem 2rem;
    background: var(--color-white);
    border-radius: 12px;
    border: 2px dashed var(--color-light-gray);
    margin: 2rem 0;
}

.empty-dashboard i {
    font-size: 3rem;
    color: var(--color-light-gray);
    margin-bottom: 1rem;
}

.empty-dashboard h4 {
    color: var(--color-medium-gray);
    margin-bottom: 0.5rem;
    font-size: 1.1rem;
    font-weight: 600;
}

.empty-dashboard p {
    color: #9E9E9E;
    margin-bottom: 1.5rem;
    font-size: 0.9rem;
}

/* Empty Dashboard Buttons - Professional and Proportional */
.empty-dashboard .btn {
    padding: 0.625rem 1.5rem;
    font-size: 0.9rem;
    font-weight: 500;
    border-radius: 6px;
    transition: all 0.2s ease;
}

.empty-dashboard .btn i {
    font-size: 1rem;
    margin-right: 0.5rem;
    color: inherit;
}

/* Widget Library Grid */
.widget-library-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 1rem;
}

.widget-library-item {
    border: 2px solid #E0E0E0;
    border-radius: 8px;
    padding: 1.25rem 1rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s;
    background: var(--color-white);
}

.widget-library-item:hover {
    border-color: var(--color-bright-blue);
    background: #E3F2FD;
    transform: translateY(-2px);
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.1);
}

.widget-library-item i {
    font-size: 1.75rem;
    color: var(--color-bright-blue);
    margin-bottom: 0.625rem;
    display: block;
}

.widget-library-item .widget-name {
    font-weight: 600;
    color: var(--color-charcoal);
    margin-bottom: 0.25rem;
    font-size: 0.9rem;
}

.widget-library-item .widget-desc {
    color: var(--color-medium-gray);
    font-size: 0.75rem;
    line-height: 1.3;
}

/* Auto-refresh indicator */
.auto-refresh-indicator {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.4rem 0.8rem;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 20px;
    font-size: 0.85rem;
}

.auto-refresh-indicator.active {
    background: rgba(76, 175, 80, 0.3);
}

.refresh-spinner {
    animation: spin 1s linear infinite;
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* ============================================================================
   REGISTER PAGE
   ============================================================================ */

/* Register Page Body - Special layout for registration */
body.register-page {
    background: var(--color-off-white);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

/* Register Container */
.register-container {
    position: relative;
    z-index: 10;
    width: 100%;
    max-width: 500px;
}

/* Register Card */
.register-card {
    width: 100%;
    padding: 2.5rem;
    background-color: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 12px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15),
                0 0 0 1px rgba(0, 0, 0, 0.05);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.register-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 25px 80px rgba(0, 0, 0, 0.2),
                0 0 0 1px rgba(0, 0, 0, 0.05);
}

/* Register Logo */
.register-logo-image {
    max-width: 200px;
    height: auto;
    margin: 0 auto 1.5rem;
    display: block;
}

/* Register Title and Subtitle */
.register-title {
    color: var(--color-navy-blue);
    font-weight: 600;
    margin-bottom: 0.5rem;
    text-align: center;
}

.register-subtitle {
    color: var(--color-medium-gray);
    font-size: 0.95rem;
    margin-bottom: 2rem;
    text-align: center;
}

/* Register Button - Professional and Proportional */
.btn-register {
    padding: 0.625rem 1.5rem;
    font-weight: 600;
    border-radius: 6px;
    font-size: 0.95rem;
    background: var(--color-navy-blue);
    border: none;
    color: var(--color-white) !important;
    width: 100%;
    transition: all 0.3s;
    margin-top: 1rem;
}

.btn-register:hover {
    background: var(--color-bright-blue);
    color: var(--color-white) !important;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(13, 22, 66, 0.3);
}

.btn-register:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.btn-register i {
    font-size: 1rem;
    margin-right: 0.5rem;
}

/* Login Link */
.login-link {
    text-align: center;
    margin-top: 1.5rem;
    color: var(--color-medium-gray);
}

.login-link a {
    color: var(--color-bright-blue);
    text-decoration: none;
    font-weight: 600;
    transition: color 0.2s;
}

.login-link a:hover {
    color: var(--color-navy-blue);
    text-decoration: underline;
}

/* Password Strength Indicator */
.password-strength {
    height: 4px;
    border-radius: 2px;
    margin-top: 0.5rem;
    background-color: #e0e0e0;
    overflow: hidden;
}

.password-strength-bar {
    height: 100%;
    width: 0%;
    transition: all 0.3s;
    background-color: #d32f2f;
}

.password-strength-bar.weak {
    width: 33%;
    background-color: #d32f2f;
}

.password-strength-bar.medium {
    width: 66%;
    background-color: #ff9800;
}

.password-strength-bar.strong {
    width: 100%;
    background-color: #388e3c;
}

.password-hint {
    font-size: 0.85rem;
    color: var(--color-medium-gray);
    margin-top: 0.5rem;
}

.required-star {
    color: #d32f2f;
}

/* ============================================================================
   TABLE ACTION BUTTONS
   ============================================================================ */

/* Ensure action buttons stay in one line */
.table td .btn-group {
    display: inline-flex;
    vertical-align: middle;
}

/* Compact button group styling */
.table .btn-group-sm .btn {
    padding: 0.25rem 0.5rem;
    font-size: 0.875rem;
    line-height: 1.5;
    border-radius: 0;
}

/* First button rounded left */
.table .btn-group-sm .btn:first-child {
    border-top-left-radius: 0.25rem;
    border-bottom-left-radius: 0.25rem;
}

/* Last button rounded right */
.table .btn-group-sm .btn:last-child {
    border-top-right-radius: 0.25rem;
    border-bottom-right-radius: 0.25rem;
}

/* Remove double borders between buttons */
.table .btn-group-sm .btn + .btn {
    margin-left: -1px;
}

/* Hover effect - lift slightly */
.table .btn-group-sm .btn:hover {
    z-index: 1;
    transform: translateY(-1px);
}

/* Ensure icons are centered */
.table .btn-group-sm .btn i {
    display: inline-block;
    vertical-align: middle;
    line-height: 1;
}

/* ============================================================================
   STATUS BOARD COMPONENT - Industrial Monitoring Panel
   ============================================================================ */

.status-board {
    background-color: #FAFAFA;
}

.parameter-row {
    display: grid;
    grid-template-columns: 2fr 1fr 80px 140px;
    align-items: center;
    padding: 1rem 1.25rem;
    background-color: white;
    border-bottom: 1px solid #E8E8E8;
    transition: all 0.2s ease;
    gap: 1rem;
}

.parameter-row:hover {
    background-color: #F5F8FA;
    transform: translateX(2px);
    box-shadow: inset 4px 0 0 #1565C0;
}

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

.param-label {
    display: flex;
    align-items: center;
    font-weight: 500;
    color: #424242;
    font-size: 0.95rem;
}

.param-label i {
    color: #616161;
    font-size: 1.1rem;
}

.param-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: #1565C0;
    font-family: 'Segoe UI', 'Roboto', monospace;
    text-align: right;
    letter-spacing: -0.5px;
}

.param-trend {
    display: flex;
    justify-content: center;
    align-items: center;
}

.trend-icon {
    font-size: 1.4rem;
    font-weight: bold;
}

.trend-up {
    color: #2E7D32;
    animation: pulse-up 2s ease-in-out infinite;
}

.trend-down {
    color: #C62828;
    animation: pulse-down 2s ease-in-out infinite;
}

.trend-stable {
    color: #757575;
}

@keyframes pulse-up {
    0%, 100% { opacity: 1; transform: translateY(0); }
    50% { opacity: 0.7; transform: translateY(-2px); }
}

@keyframes pulse-down {
    0%, 100% { opacity: 1; transform: translateY(0); }
    50% { opacity: 0.7; transform: translateY(2px); }
}

.param-sparkline {
    display: flex;
    justify-content: flex-end;
    align-items: center;
}

.sparkline {
    display: block;
}

.sparkline-line {
    fill: none;
    stroke: #1565C0;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.sparkline-area {
    fill: url(#sparkline-gradient);
    opacity: 0.2;
}

.sparkline-dot {
    fill: #1565C0;
    stroke: white;
    stroke-width: 2;
}

/* Responsive adjustments */
@media (max-width: 992px) {
    .parameter-row {
        grid-template-columns: 1fr;
        gap: 0.75rem;
        padding: 1rem;
    }

    .param-value {
        text-align: left;
        font-size: 1.3rem;
    }

    .param-trend {
        justify-content: flex-start;
    }

    .param-sparkline {
        justify-content: flex-start;
    }
}

/* ============================================================================
   CUSTOM DASHBOARD WIDGETS - Compact Industrial Widgets
   ============================================================================ */

/* Status Board Widget - Compact Version */
.status-board-widget {
    height: 100%;
    overflow-y: auto;
}

.status-board-compact {
    background-color: white;
}

.parameter-row-compact {
    display: grid;
    grid-template-columns: 2fr 1fr 40px 70px;
    align-items: center;
    padding: 0.75rem 1rem;
    border-bottom: 1px solid #E8E8E8;
    transition: all 0.2s ease;
    gap: 0.75rem;
    font-size: 0.9rem;
}

.parameter-row-compact:hover {
    background-color: #F5F8FA;
}

.parameter-row-compact:last-child {
    border-bottom: none;
}

.param-label-compact {
    display: flex;
    align-items: center;
    font-weight: 500;
    color: #424242;
    font-size: 0.85rem;
}

.param-label-compact i {
    color: #616161;
    font-size: 1rem;
}

.param-value-compact {
    font-size: 1.1rem;
    font-weight: 700;
    color: #1565C0;
    font-family: 'Segoe UI', 'Roboto', monospace;
    text-align: right;
}

.param-trend-compact {
    display: flex;
    justify-content: center;
    align-items: center;
}

.param-trend-compact .trend-icon {
    font-size: 1.2rem;
}

.param-sparkline-compact {
    display: flex;
    justify-content: flex-end;
    align-items: center;
}

.sparkline-mini {
    display: block;
}

/* Production Counter Widget */
.production-counter {
    height: 100%;
    display: flex;
    flex-direction: column;
    padding: 1.5rem;
}

.counter-header {
    display: flex;
    align-items: center;
    font-size: 0.95rem;
    color: #616161;
    margin-bottom: 1.5rem;
}

.counter-main {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1rem;
}

.counter-total {
    text-align: center;
}

.counter-label {
    font-size: 0.85rem;
    color: #757575;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 0.5rem;
}

.counter-value {
    font-size: 3rem;
    font-weight: 700;
    color: #1565C0;
    font-family: 'Segoe UI', 'Roboto', monospace;
    line-height: 1;
}

.counter-breakdown {
    display: flex;
    justify-content: space-around;
    padding-top: 1rem;
    border-top: 2px solid #E8E8E8;
}

.counter-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.9rem;
}

.counter-item i {
    font-size: 1.2rem;
}

.counter-item.good {
    color: #2E7D32;
}

.counter-item.reject {
    color: #C62828;
}

.counter-item .label {
    font-weight: 500;
}

.counter-item .value {
    font-weight: 700;
    font-family: 'Segoe UI', 'Roboto', monospace;
}

/* Asset Status Grid Widget */
.asset-status-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 0.75rem;
    padding: 1rem;
    height: 100%;
    overflow-y: auto;
}

.asset-status-item {
    display: flex;
    align-items: center;
    padding: 0.75rem;
    background: white;
    border: 1px solid #E0E0E0;
    border-radius: 6px;
    border-left: 4px solid transparent;
    transition: all 0.2s ease;
}

.asset-status-item:hover {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    transform: translateY(-2px);
}

.asset-status-item.status-running {
    border-left-color: #2E7D32;
}

.asset-status-item.status-idle {
    border-left-color: #F57F17;
}

.asset-status-item.status-down {
    border-left-color: #C62828;
}

.asset-status-item.status-maintenance {
    border-left-color: #455A64;
}

.status-indicator {
    margin-right: 0.75rem;
}

.asset-info {
    flex: 1;
    min-width: 0;
}

.asset-name {
    font-weight: 600;
    font-size: 0.9rem;
    color: #212121;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.asset-location {
    font-size: 0.75rem;
    color: #757575;
    margin-top: 0.25rem;
}

.asset-oee {
    font-size: 1.1rem;
    font-weight: 700;
    color: #1565C0;
    font-family: 'Segoe UI', 'Roboto', monospace;
    margin-left: 0.5rem;
}

/* ============================================================================
   FLOATING AI CHATBOX
   ============================================================================ */

/* Chat toggle button (floating icon) */
.ai-chat-button {
    position: fixed;
    bottom: 24px;
    right: 24px;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: #0D1642;
    border: none;
    color: white;
    font-size: 28px;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    transition: all 0.3s ease;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.ai-chat-button:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.3);
}

.ai-chat-button:active {
    transform: scale(0.95);
}

/* Notification badge */
.chat-notification-badge {
    position: absolute;
    top: -5px;
    right: -5px;
    background: #ff4444;
    color: white;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    font-size: 12px;
    font-weight: bold;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid white;
}

/* Chat window */
.ai-chat-window {
    position: fixed;
    bottom: 100px;
    right: 24px;
    width: 380px;
    height: 550px;
    background: white;
    border: 1px solid #BDBDBD;
    border-radius: 4px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
    display: flex;
    flex-direction: column;
    z-index: 1000;
    animation: slideUp 0.3s ease;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Chat header */
.ai-chat-header {
    background: #1565C0;
    color: white;
    padding: 16px 20px;
    border-radius: 16px 16px 0 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-weight: 600;
}

/* Chat messages container */
.ai-chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
    background: #f8f9fa;
}

/* Chat input */
.ai-chat-input {
    padding: 12px 16px;
    border-top: 1px solid #e0e0e0;
    background: white;
    border-radius: 0 0 16px 16px;
}

.ai-chat-input .form-control {
    border-radius: 20px;
    border: 1px solid #ddd;
    padding: 8px 16px;
    font-size: 14px;
}

.ai-chat-input .btn {
    border-radius: 20px;
    padding: 8px 16px;
}

/* Message bubbles */
.chat-message {
    margin-bottom: 12px;
}

.message-bubble {
    max-width: 85%;
    word-wrap: break-word;
}

.user-message .message-bubble {
    margin-left: auto;
    background: #1565C0 !important;
    color: white !important;
}

.bot-message .message-bubble {
    background: white;
    border: 1px solid #e0e0e0;
}

/* Scrollbar styling */
.ai-chat-messages::-webkit-scrollbar {
    width: 6px;
}

.ai-chat-messages::-webkit-scrollbar-track {
    background: #f1f1f1;
}

.ai-chat-messages::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 3px;
}

.ai-chat-messages::-webkit-scrollbar-thumb:hover {
    background: #555;
}

/* AI Chatbot Enhanced UI Styles */
.ai-thinking-indicator {
    padding: 8px 12px;
    background: #e3f2fd;
    border-left: 3px solid #1976d2;
    border-radius: 4px;
    margin: 8px 0;
    font-style: italic;
    animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

.tool-call-indicator {
    padding: 6px 10px;
    background: #fff9c4;
    border-left: 3px solid #f57c00;
    border-radius: 4px;
    margin: 6px 0;
}

.tool-result-display {
    background: #f5f5f5;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    padding: 10px;
    margin: 8px 0;
    font-family: var(--font-mono);
    font-size: 0.85em;
}

.tool-result-display pre {
    margin: 0;
    white-space: pre-wrap;
    word-wrap: break-word;
}

.tool-error {
    background: #ffebee !important;
    border: 1px solid #ef5350;
    border-radius: 6px;
    padding: 8px;
    margin: 6px 0;
}

.chart-display {
    background: white;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 12px;
    margin: 10px 0;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.document-download {
    background: #e8f5e9;
    border: 1px solid #66bb6a;
    border-radius: 6px;
    padding: 10px;
    margin: 8px 0;
}

.document-download button {
    transition: all 0.2s ease;
}

.document-download button:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.15);
}

.spin-animation {
    animation: spin 1s linear infinite;
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* Update chat header to support multiple buttons */
.ai-chat-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    background: #1565C0;
    color: white;
    border-radius: 4px 4px 0 0;
}

.ai-chat-header > div {
    display: flex;
    align-items: center;
    gap: 8px;
}

/* Mobile responsive */
@media (max-width: 768px) {
    .ai-chat-window {
        width: calc(100vw - 32px);
        height: 80vh;
        bottom: 80px;
        right: 16px;
        left: 16px;
        margin: 0 auto;
    }

    .ai-chat-button {
        right: 16px;
        bottom: 16px;
        width: 56px;
        height: 56px;
        font-size: 24px;
    }

    .chart-display {
        padding: 8px;
    }
}

/* ========================================
   AI CHATBOT - PROFESSIONAL UI/UX
   ======================================== */

/* Smooth fade-in animation */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-in {
    animation: fadeIn 0.3s ease-out;
}

/* Thinking dots animation */
@keyframes thinkingDots {
    0%, 20% { opacity: 0.3; }
    50% { opacity: 1; }
    100% { opacity: 0.3; }
}

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

.thinking-dots span {
    width: 6px;
    height: 6px;
    background: #6c757d;
    border-radius: 50%;
    display: inline-block;
    animation: thinkingDots 1.4s infinite;
}

.thinking-dots span:nth-child(2) {
    animation-delay: 0.2s;
}

.thinking-dots span:nth-child(3) {
    animation-delay: 0.4s;
}

/* Chat messages professional styling */
.chat-message {
    display: flex;
    gap: 12px;
    margin-bottom: 20px;
    align-items: flex-start;
}

/* User messages on the right */
.user-message {
    justify-content: flex-end;
    flex-direction: row-reverse;
}

/* AI messages on the left */
.assistant-message {
    justify-content: flex-start;
}

.message-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-size: 18px;
}

.user-avatar {
    background: #667eea;
    color: white;
}

.ai-avatar {
    background: #f5576c;
    color: white;
}

.message-bubble {
    flex: 1;
    max-width: 85%;
}

.user-message .message-bubble {
    background: #667eea;
    color: white;
    border-radius: 4px;
    padding: 12px 16px;
    box-shadow: none;
    border: 1px solid #667eea;
}

.assistant-message .message-bubble {
    background: white;
    border: 1px solid #dee2e6;
    border-radius: 4px;
    padding: 12px 16px;
    box-shadow: none;
}

.message-content {
    font-size: 14px;
    line-height: 1.6;
}

.message-text {
    word-wrap: break-word;
}

.message-text code {
    background: rgba(0, 0, 0, 0.05);
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 13px;
    font-family: 'Courier New', monospace;
}

.user-message .message-text code {
    background: rgba(255, 255, 255, 0.2);
}

/* AI thinking indicator */
.ai-thinking-indicator {
    padding: 8px 12px;
    background: #f8f9fa;
    border-radius: 4px;
    display: inline-flex;
    align-items: center;
    color: #6c757d;
    font-size: 13px;
}

.thinking-text {
    display: block;
    max-height: 60px;
    overflow-y: auto;
    font-style: italic;
}

/* Tool execution indicator */
.tool-indicator {
    display: flex;
    align-items: center;
    padding: 10px 14px;
    background: #fff3cd;
    border-left: 3px solid #ffc107;
    border-radius: 4px;
    font-size: 13px;
}

/* Tool result card - NO RAW JSON */
.tool-result-card {
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 4px;
    overflow: hidden;
}

.tool-header {
    padding: 10px 14px;
    background: #667eea;
    color: white;
    font-weight: 600;
    font-size: 13px;
}

.result-content {
    padding: 12px 14px;
}

.result-summary {
    color: #495057;
    font-size: 13px;
    font-weight: 500;
}

.result-message {
    color: #212529;
    font-size: 13px;
    line-height: 1.5;
}

.result-error {
    padding: 12px 14px;
    background: #f8d7da;
    color: #721c24;
    font-size: 13px;
}

/* Chart container */
.chart-container {
    background: white;
    border: 1px solid #e9ecef;
    border-radius: 4px;
    padding: 16px;
    box-shadow: none;
}

/* Document card */
.document-card {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px;
    background: #e0f7fa;
    border: 1px solid #00bcd4;
    border-radius: 4px;
}

.doc-icon {
    font-size: 32px;
    color: #00838f;
}

.doc-info {
    flex: 1;
}

.doc-name {
    font-weight: 600;
    font-size: 14px;
    color: #00695c;
}

.doc-size {
    font-size: 12px;
    color: #00838f;
}

/* Error message */
.error-message {
    padding: 12px 14px;
    background: #f8d7da;
    border-left: 3px solid #dc3545;
    border-radius: 4px;
    color: #721c24;
    font-size: 13px;
}

/* Fullpage mode */
#ai-chatbot-window.fullpage-mode {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    width: 100% !important;
    height: 100vh !important;
    max-width: 100% !important;
    max-height: 100vh !important;
    border-radius: 0 !important;
    z-index: 9999 !important;
    box-shadow: none !important;
}

#ai-chatbot-window.fullpage-mode #ai-chatbot-messages {
    max-height: calc(100vh - 140px) !important;
}

/* Smooth scroll */
#ai-chatbot-messages {
    scroll-behavior: smooth;
}

/* Input focus state */
#ai-chatbot-input:focus {
    border-color: #667eea;
    box-shadow: 0 0 0 0.2rem rgba(102, 126, 234, 0.25);
}

/* Button hover effects */
.ai-chat-header button:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: scale(1.1);
    transition: all 0.2s ease;
}

/* Spinner animation */
@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.spinner-border {
    animation: spin 0.75s linear infinite;
}

/* Terminal-style typing cursor animation */
@keyframes cursorBlink {
    0%, 49% {
        opacity: 1;
    }
    50%, 100% {
        opacity: 0;
    }
}

.typing-cursor {
    display: inline-block;
    margin-left: 2px;
    font-weight: normal;
    animation: cursorBlink 1s infinite;
    color: #667eea;
}

.typed-content {
    display: inline;
}

/* ============================================================================
   CALENDAR GRID STYLES
   ============================================================================ */

.calendar-grid-container {
    padding: 10px;
}

.calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 8px;
    max-width: 100%;
}

.calendar-day-header {
    background: #1A1F3A;
    color: #FFFFFF;
    text-align: center;
    padding: 8px;
    font-weight: 600;
    font-size: 12px;
    border-radius: 4px;
}

.calendar-day-cell {
    background: #FFFFFF;
    border: 1px solid #E0E0E0;
    border-radius: 4px;
    padding: 6px;
    min-height: 70px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    transition: all 0.2s ease;
}

.calendar-day-cell.has-data {
    cursor: pointer;
    border-color: #1A1F3A;
}

.calendar-day-cell.has-data:hover {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    transform: translateY(-2px);
}

.calendar-day-cell.no-data {
    background: #F5F5F5;
    opacity: 0.6;
}

.calendar-day-cell.other-month {
    background: #FAFAFA;
    opacity: 0.3;
}

.calendar-day-number {
    font-weight: 600;
    font-size: 14px;
    color: #212121;
    margin-bottom: 8px;
}

.calendar-day-bar {
    display: flex;
    height: 20px;
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 4px;
}

.calendar-bar-ok {
    background: #2E7D32;
    transition: width 0.3s ease;
}

.calendar-bar-ng {
    background: #D32F2F;
    transition: width 0.3s ease;
}

.calendar-day-label {
    font-size: 11px;
    font-weight: 600;
    color: #2E7D32;
    text-align: center;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .calendar-grid {
        gap: 4px;
    }

    .calendar-day-cell {
        min-height: 60px;
        padding: 6px;
    }

    .calendar-day-number {
        font-size: 12px;
        margin-bottom: 4px;
    }

    .calendar-day-bar {
        height: 16px;
    }

    .calendar-day-label {
        font-size: 10px;
    }
}

/* ============================================================================
   AI CHATBOT - PROFESSIONAL LOADING ANIMATIONS
   ============================================================================ */

/* Iteration Progress Indicator */
.iteration-indicator {
    padding: 8px 12px;
    background: linear-gradient(135deg, #e3f2fd 0%, #f5f5f5 100%);
    border-left: 3px solid #2196F3;
    border-radius: 6px;
    animation: slideInLeft 0.3s ease-out;
}

/* Tool Execution Indicator */
.tool-indicator {
    padding: 8px 12px;
    background: linear-gradient(135deg, #f3e5f5 0%, #f5f5f5 100%);
    border-left: 3px solid #9C27B0;
    border-radius: 6px;
    animation: slideInLeft 0.3s ease-out;
}

/* Tool Completed State */
.tool-completed {
    background: linear-gradient(135deg, #e8f5e9 0%, #f5f5f5 100%);
    border-left: 3px solid #4CAF50;
}

/* Spinner Animations - Professional */
@keyframes spin-smooth {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.spinner-border-sm {
    animation: spin-smooth 0.8s linear infinite;
}

/* Thinking Dots Animation - Enhanced */
.ai-thinking-indicator .thinking-dots {
    display: inline-flex;
    gap: 4px;
}

.ai-thinking-indicator .thinking-dots span {
    width: 6px;
    height: 6px;
    background: #2196F3;
    border-radius: 50%;
    display: inline-block;
    animation: thinkingPulse 1.4s infinite ease-in-out both;
}

.ai-thinking-indicator .thinking-dots span:nth-child(1) {
    animation-delay: -0.32s;
}

.ai-thinking-indicator .thinking-dots span:nth-child(2) {
    animation-delay: -0.16s;
}

@keyframes thinkingPulse {
    0%, 80%, 100% {
        transform: scale(0.6);
        opacity: 0.5;
    }
    40% {
        transform: scale(1);
        opacity: 1;
    }
}

/* Slide animations */
@keyframes slideInLeft {
    from {
        transform: translateX(-20px);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* Pulse animation for spinner-grow */
.spinner-grow-sm {
    animation: spinnerGrow 0.75s linear infinite;
}

@keyframes spinnerGrow {
    0%, 100% {
        transform: scale(0);
        opacity: 0.5;
    }
    50% {
        transform: scale(1);
        opacity: 1;
    }
}

/* Success checkmark animation */
.bi-check-circle-fill {
    animation: checkmarkPop 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

@keyframes checkmarkPop {
    0% {
        transform: scale(0);
        opacity: 0;
    }
    50% {
        transform: scale(1.2);
    }
    100% {
        transform: scale(1);
        opacity: 1;
    }
}

/* Fade in animation - smoother */
.fade-in {
    animation: fadeInSmooth 0.3s ease-out;
}

@keyframes fadeInSmooth {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Progress bar for long operations */
.ai-progress-bar {
    height: 3px;
    background: #e0e0e0;
    border-radius: 2px;
    overflow: hidden;
    margin-top: 8px;
}

.ai-progress-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, #2196F3, #21CBF3);
    animation: progressIndeterminate 1.5s infinite linear;
    transform-origin: 0% 50%;
}

@keyframes progressIndeterminate {
    0% {
        transform: translateX(0) scaleX(0);
    }
    40% {
        transform: translateX(0) scaleX(0.4);
    }
    100% {
        transform: translateX(100%) scaleX(0.5);
    }
}

/* Enhanced typing cursor */
.typing-cursor {
    animation: blink 1s step-end infinite;
    color: #2196F3;
    font-weight: bold;
}

@keyframes blink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0; }
}

/* Tool icon pulse */
.tool-indicator i,
.iteration-indicator i {
    animation: iconPulse 2s ease-in-out infinite;
}

@keyframes iconPulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}


/* ============================================================================
   AI CHATBOT - FLAT & SHARP STYLE (Red/Blue/White)
   ============================================================================ */

/* Chat Window - Flat Sharp Style */
#ai-chatbot-window {
    border: 3px solid #0D1642 !important;
    border-radius: 0 !important;
    box-shadow: 0 4px 12px rgba(13, 22, 66, 0.3) !important;
}

#ai-chatbot-window .card-header {
    background: #0D1642 !important;
    border-bottom: 3px solid #8B0000 !important;
    border-radius: 0 !important;
}

#ai-chatbot-window .card-body {
    background: #FFFFFF !important;
}

/* Message Bubbles - Flat Sharp */
.chat-message.user-message .message-bubble {
    background: #8B0000 !important;
    color: #FFFFFF !important;
    border-radius: 0 !important;
    border-left: 4px solid #FFFFFF !important;
    box-shadow: 2px 2px 0 rgba(0, 0, 0, 0.1) !important;
}

.chat-message.assistant-message .message-bubble {
    background: #F5F5F5 !important;
    color: #212121 !important;
    border-radius: 0 !important;
    border-left: 4px solid #0D1642 !important;
    box-shadow: 2px 2px 0 rgba(0, 0, 0, 0.1) !important;
}

/* Avatar - Sharp Squares */
.message-avatar {
    border-radius: 0 !important;
    width: 36px !important;
    height: 36px !important;
}

.user-avatar {
    background: #8B0000 !important;
    border: 2px solid #8B0000 !important;
}

.ai-avatar {
    background: #0D1642 !important;
    border: 2px solid #0D1642 !important;
}

/* Iteration Progress - Flat Sharp Red */
.iteration-indicator {
    padding: 10px 14px !important;
    background: #FFFFFF !important;
    border: 2px solid #8B0000 !important;
    border-left: 5px solid #8B0000 !important;
    border-radius: 0 !important;
    box-shadow: 2px 2px 0 rgba(139, 0, 0, 0.1) !important;
}

.iteration-indicator small {
    color: #8B0000 !important;
    font-weight: 600 !important;
}

.iteration-indicator .bi-gear-fill {
    color: #8B0000 !important;
}

/* Tool Execution - Flat Sharp Blue */
.tool-indicator {
    padding: 10px 14px !important;
    background: #FFFFFF !important;
    border: 2px solid #0D1642 !important;
    border-left: 5px solid #0D1642 !important;
    border-radius: 0 !important;
    box-shadow: 2px 2px 0 rgba(13, 22, 66, 0.1) !important;
}

.tool-indicator small {
    color: #0D1642 !important;
    font-weight: 600 !important;
}

.tool-indicator i {
    color: #0D1642 !important;
}

/* Tool Completed - Flat Sharp White */
.tool-completed {
    background: #0D1642 !important;
    border: 2px solid #0D1642 !important;
    border-left: 5px solid #FFFFFF !important;
}

.tool-completed small {
    color: #FFFFFF !important;
}

.tool-completed .bi-check-circle-fill {
    color: #FFFFFF !important;
}

/* Thinking Indicator - Flat Red */
.ai-thinking-indicator {
    padding: 8px 12px !important;
    background: #FFFFFF !important;
    border: 2px solid #8B0000 !important;
    border-radius: 0 !important;
}

.ai-thinking-indicator .thinking-dots span {
    background: #8B0000 !important;
    border-radius: 0 !important;
    width: 8px !important;
    height: 8px !important;
}

/* Spinner - Flat Sharp Style */
.spinner-border {
    border: 3px solid #FFFFFF !important;
    border-right-color: transparent !important;
    border-radius: 0 !important;
}

.spinner-border-sm {
    border-width: 2px !important;
}

.tool-indicator .spinner-border {
    border-color: #0D1642 !important;
    border-right-color: transparent !important;
}

.iteration-indicator .spinner-grow {
    background: #8B0000 !important;
    border-radius: 0 !important;
    width: 10px !important;
    height: 10px !important;
}

/* Input Area - Flat Sharp */
#ai-chatbot-input {
    border: 2px solid #0D1642 !important;
    border-radius: 0 !important;
    background: #FFFFFF !important;
}

#ai-chatbot-input:focus {
    border-color: #8B0000 !important;
    box-shadow: 0 0 0 2px rgba(139, 0, 0, 0.1) !important;
}

#ai-chatbot-send {
    background: #8B0000 !important;
    border: 2px solid #8B0000 !important;
    border-radius: 0 !important;
    color: #FFFFFF !important;
}

#ai-chatbot-send:hover {
    background: #0D1642 !important;
    border-color: #0D1642 !important;
}

/* Chart Container - Flat Sharp */
.chart-container {
    border: 2px solid #0D1642 !important;
    border-radius: 0 !important;
    background: #FFFFFF !important;
    box-shadow: 2px 2px 0 rgba(13, 22, 66, 0.1) !important;
}

/* Typing Cursor - Sharp */
.typing-cursor {
    color: #8B0000 !important;
}

/* Remove all gradient animations */
.iteration-indicator,
.tool-indicator,
.tool-completed,
.ai-thinking-indicator {
    background-image: none !important;
}

/* Sharp animations - no easing */
@keyframes slideInLeft {
    from {
        transform: translateX(-20px);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes fadeInSmooth {
    from {
        transform: translateY(0);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* Remove icon pulse - flat style */
.tool-indicator i,
.iteration-indicator i {
    animation: none !important;
}

/* Sharp checkmark animation */
@keyframes checkmarkPop {
    0% {
        transform: scale(0);
    }
    100% {
        transform: scale(1);
    }
}

/* Thinking dots - square pulse */
@keyframes thinkingPulse {
    0%, 100% {
        opacity: 0.3;
    }
    50% {
        opacity: 1;
    }
}

/* Progress bar - flat red */
.ai-progress-bar {
    height: 4px !important;
    background: #FFFFFF !important;
    border: 2px solid #0D1642 !important;
    border-radius: 0 !important;
}

.ai-progress-bar-fill {
    background: #8B0000 !important;
    background-image: none !important;
}

/* Scrollbar - flat sharp */
#ai-chatbot-messages::-webkit-scrollbar {
    width: 8px;
}

#ai-chatbot-messages::-webkit-scrollbar-track {
    background: #F5F5F5;
    border-left: 2px solid #0D1642;
}

#ai-chatbot-messages::-webkit-scrollbar-thumb {
    background: #8B0000;
    border-radius: 0;
}

#ai-chatbot-messages::-webkit-scrollbar-thumb:hover {
    background: #0D1642;
}

/* Header buttons - flat sharp */
.btn-sm {
    border-radius: 0 !important;
}

/* Message text - sharp formatting */
.message-text strong {
    color: #8B0000 !important;
}

.message-text code {
    background: #F5F5F5 !important;
    border: 1px solid #0D1642 !important;
    border-radius: 0 !important;
    color: #0D1642 !important;
}

/* Document download - flat sharp */
.document-download {
    border: 2px solid #0D1642 !important;
    border-radius: 0 !important;
    background: #FFFFFF !important;
}

.document-download:hover {
    background: #0D1642 !important;
    color: #FFFFFF !important;
}


/* ============================================================================
   AI CHATBOT HEADER & INPUT - FLAT SHARP STYLE
   ============================================================================ */

/* Chat Header - Flat Sharp Navy */
.ai-chat-header {
    background: #0D1642 !important;
    border-bottom: 1px solid #BDBDBD !important;
    border-radius: 0 !important;
    padding: 14px 18px !important;
    color: #FFFFFF !important;
}

.ai-chat-header strong {
    font-size: 16px !important;
    font-weight: 700 !important;
    letter-spacing: 0.5px !important;
    text-transform: uppercase !important;
}

.ai-chat-header .bi-robot {
    font-size: 20px !important;
    color: #FFFFFF !important;
}

/* Header Buttons - Flat Sharp */
.ai-chat-header .btn {
    border-radius: 0 !important;
    padding: 6px 10px !important;
    border: 2px solid transparent !important;
    transition: all 0.15s ease !important;
}

.ai-chat-header .btn-link {
    color: #FFFFFF !important;
    text-decoration: none !important;
}

.ai-chat-header .btn-link:hover {
    background: #8B0000 !important;
    border-color: #FFFFFF !important;
}

.ai-chat-header .btn-link {
    border-radius: 0 !important;
    opacity: 1 !important;
    transition: all 0.2s ease !important;
}

.ai-chat-header .btn-link i {
    font-size: 18px !important;
    color: #FFFFFF !important;
}

.ai-chat-header .btn-link:hover {
    background: #8B0000 !important;
    border: 2px solid #FFFFFF !important;
}

.ai-chat-header .btn-link:hover i {
    color: #FFFFFF !important;
}

/* Input Area - Flat Sharp */
.ai-chat-input {
    background: #F5F5F5 !important;
    padding: 14px !important;
    border-top: 1px solid #BDBDBD !important;
    border-radius: 0 !important;
}

.ai-chat-input .input-group {
    border-radius: 0 !important;
    box-shadow: 2px 2px 0 rgba(13, 22, 66, 0.15) !important;
}

/* Text Input Field - Flat Sharp */
.ai-chat-input #ai-chatbot-input {
    border: 2px solid #0D1642 !important;
    border-right: none !important;
    border-radius: 0 !important;
    background: #FFFFFF !important;
    padding: 12px 16px !important;
    font-size: 14px !important;
    color: #212121 !important;
    height: 48px !important;
}

.ai-chat-input #ai-chatbot-input:focus {
    border-color: #8B0000 !important;
    box-shadow: none !important;
    outline: none !important;
    background: #FFFFFF !important;
}

.ai-chat-input #ai-chatbot-input::placeholder {
    color: #9E9E9E !important;
    font-style: normal !important;
}

.ai-chat-input #ai-chatbot-input:disabled {
    background: #E0E0E0 !important;
    border-color: #9E9E9E !important;
    color: #757575 !important;
}

/* Send Button - Flat Sharp Red */
.ai-chat-input .btn-primary,
.ai-chat-input .btn {
    background: #8B0000 !important;
    border: 2px solid #8B0000 !important;
    border-radius: 0 !important;
    color: #FFFFFF !important;
    padding: 0 20px !important;
    height: 48px !important;
    min-width: 60px !important;
    font-weight: 700 !important;
    transition: all 0.15s ease !important;
}

.ai-chat-input .btn-primary:hover,
.ai-chat-input .btn:hover {
    background: #0D1642 !important;
    border-color: #0D1642 !important;
    transform: translateY(-1px) !important;
    box-shadow: 2px 3px 0 rgba(13, 22, 66, 0.2) !important;
}

.ai-chat-input .btn-primary:active,
.ai-chat-input .btn:active {
    background: #0D1642 !important;
    border-color: #0D1642 !important;
    transform: translateY(0) !important;
    box-shadow: none !important;
}

.ai-chat-input .btn-primary:disabled,
.ai-chat-input .btn:disabled {
    background: #9E9E9E !important;
    border-color: #9E9E9E !important;
    opacity: 0.6 !important;
    cursor: not-allowed !important;
}

.ai-chat-input .btn i {
    font-size: 18px !important;
    font-weight: bold !important;
}

/* Chat Window Container - Sharp */
.ai-chat-window {
    border-radius: 0 !important;
    box-shadow: 0 6px 20px rgba(13, 22, 66, 0.25) !important;
    border: 3px solid #0D1642 !important;
}

/* Messages Container - Sharp */
.ai-chat-messages {
    background: #FFFFFF !important;
    border-left: 3px solid #F5F5F5 !important;
    border-right: 3px solid #F5F5F5 !important;
}

/* Fullpage Mode - Sharp */
.ai-chat-window.fullpage-mode {
    border-radius: 0 !important;
    border: none !important;
}

.ai-chat-window.fullpage-mode .ai-chat-header {
    border-bottom: 5px solid #8B0000 !important;
}

/* Floating Chat Button - Sharp */
#ai-chatbot-toggle {
    border-radius: 0 !important;
    background: #8B0000 !important;
    border: 3px solid #0D1642 !important;
    box-shadow: 3px 3px 0 rgba(13, 22, 66, 0.3) !important;
    width: 60px !important;
    height: 60px !important;
}

#ai-chatbot-toggle:hover {
    background: #0D1642 !important;
    border-color: #8B0000 !important;
    transform: translateY(-2px) !important;
    box-shadow: 4px 4px 0 rgba(139, 0, 0, 0.3) !important;
}

#ai-chatbot-toggle i {
    font-size: 28px !important;
}

/* Chat Notification Badge - Sharp */
.chat-notification-badge {
    border-radius: 0 !important;
    background: #FFFFFF !important;
    color: #8B0000 !important;
    border: 2px solid #8B0000 !important;
    font-weight: 900 !important;
    padding: 2px 6px !important;
    min-width: 20px !important;
}

/* Typography in Chat */
.ai-chat-header,
.ai-chat-input {
    font-family: 'Inter', 'Roboto', sans-serif !important;
}

.ai-chat-input #ai-chatbot-input {
    font-family: 'Inter', 'Roboto', sans-serif !important;
    font-weight: 500 !important;
}

/* Remove all transitions from shapes */
.ai-chat-window,
.ai-chat-header,
.ai-chat-input,
#ai-chatbot-input {
    transition: none !important;
}

/* Sharp focus states */
.ai-chat-input #ai-chatbot-input:focus {
    border-left-width: 5px !important;
}

/* Button active states - sharp */
.ai-chat-header .btn:active {
    transform: translateY(1px) !important;
}


/* ============================================================================
   AI CHATBOT FLOATING BUTTON - NAVY BLUE
   ============================================================================ */

/* Floating Chat Button - Navy Blue Primary */
#ai-chatbot-toggle {
    background: #0D1642 !important;
    border: 3px solid #0D1642 !important;
    box-shadow: 3px 3px 0 rgba(139, 0, 0, 0.3) !important;
}

#ai-chatbot-toggle:hover {
    background: #8B0000 !important;
    border-color: #0D1642 !important;
    transform: translateY(-2px) !important;
    box-shadow: 4px 4px 0 rgba(13, 22, 66, 0.3) !important;
}

#ai-chatbot-toggle:active {
    transform: translateY(0) !important;
    box-shadow: 2px 2px 0 rgba(13, 22, 66, 0.2) !important;
}


/* ============================================================================
   AI CHATBOT - FIX TOGGLE ICON & THIN BORDERS
   ============================================================================ */

/* Toggle Button Icon - Dark Blue */
#ai-chatbot-toggle {
    background: #0D1642 !important;
    border: 2px solid #0D1642 !important;
    color: #FFFFFF !important;
}

#ai-chatbot-toggle i {
    color: #FFFFFF !important;
}

#ai-chatbot-toggle:hover {
    background: #8B0000 !important;
    border-color: #8B0000 !important;
}

/* Chatbox Window - Thinner Borders */
#ai-chatbot-window,
.ai-chat-window {
    border: 2px solid #0D1642 !important;
    box-shadow: 0 4px 12px rgba(13, 22, 66, 0.2) !important;
}

/* Header - Thinner Border */
.ai-chat-header {
    border-bottom: 3px solid #8B0000 !important;
}

/* Input Field - Thinner Border */
.ai-chat-input #ai-chatbot-input {
    border: 2px solid #0D1642 !important;
    border-right: none !important;
}

.ai-chat-input #ai-chatbot-input:focus {
    border-color: #8B0000 !important;
    border-left-width: 3px !important;
}

/* Send Button - Thinner Border */
.ai-chat-input .btn-primary,
.ai-chat-input .btn {
    border: 2px solid #8B0000 !important;
}

/* Indicators - Thinner Borders */
.iteration-indicator {
    border: 1px solid #8B0000 !important;
    border-left: 4px solid #8B0000 !important;
}

.tool-indicator {
    border: 1px solid #0D1642 !important;
    border-left: 4px solid #0D1642 !important;
}

.tool-completed {
    border: 1px solid #0D1642 !important;
    border-left: 4px solid #FFFFFF !important;
}

/* Message Bubbles - Thinner Borders */
.chat-message.user-message .message-bubble {
    border-left: 3px solid #FFFFFF !important;
}

.chat-message.assistant-message .message-bubble {
    border-left: 3px solid #0D1642 !important;
}

/* Avatar - Thinner Borders */
.message-avatar {
    border: 1px solid !important;
}

/* Chart Container - Thinner Border */
.chart-container {
    border: 1px solid #0D1642 !important;
}

/* Input Area - Thinner Top Border */
.ai-chat-input {
    border-top: 2px solid #0D1642 !important;
}


/* ============================================================================
   MEGA MENU STYLES
   ============================================================================ */

/* Mega dropdown container */
.mega-dropdown {
    position: static !important;
}

/* Mega menu styling */
.mega-menu {
    width: 100%;
    max-width: 800px;
    padding: 1rem 1.5rem;
    border: none;
    border-radius: 0.5rem;
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
    background-color: var(--color-white);
    border-top: 3px solid var(--color-navy-blue);
}

/* Column headers in mega menu */
.mega-menu .dropdown-header {
    font-weight: 600;
    font-size: 0.85rem;
    color: var(--color-navy-blue);
    padding: 0.5rem 0;
    margin-bottom: 0.5rem;
    border-bottom: 2px solid var(--color-light-gray);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Items in mega menu */
.mega-menu .dropdown-item {
    padding: 0.5rem 0.75rem;
    font-size: 0.875rem;
    color: var(--color-charcoal);
    border-radius: 0.25rem;
    margin-bottom: 0.125rem;
}

.mega-menu .dropdown-item:hover {
    background-color: var(--color-off-white);
    color: var(--color-navy-blue);
}

.mega-menu .dropdown-item.active {
    background-color: var(--color-navy-blue);
    color: var(--color-white);
}

.mega-menu .dropdown-item i {
    width: 1.25rem;
    text-align: center;
    color: var(--color-medium-gray);
}

.mega-menu .dropdown-item:hover i,
.mega-menu .dropdown-item.active i {
    color: inherit;
}

/* Navbar custom styling */
.navbar-custom {
    background-color: var(--color-white);
    border-bottom: 2px solid var(--color-light-gray);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    padding: 0.5rem 1rem;
}

.navbar-custom .nav-link {
    color: var(--color-charcoal);
    font-weight: 500;
    padding: 0.5rem 0.75rem;
    border-radius: 0.25rem;
    transition: all 0.2s ease;
}

.navbar-custom .nav-link:hover {
    color: var(--color-navy-blue);
    background-color: var(--color-off-white);
}

.navbar-custom .nav-link.active {
    color: var(--color-navy-blue);
    background-color: rgba(13, 22, 66, 0.1);
}

/* Standard dropdown styling */
.navbar-custom .dropdown-menu {
    border: none;
    border-radius: 0.5rem;
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
    border-top: 3px solid var(--color-navy-blue);
    padding: 0.5rem;
}

.navbar-custom .dropdown-item {
    border-radius: 0.25rem;
    padding: 0.5rem 0.75rem;
}

.navbar-custom .dropdown-item:hover {
    background-color: var(--color-off-white);
    color: var(--color-navy-blue);
}

.navbar-custom .dropdown-item.active {
    background-color: var(--color-navy-blue);
    color: var(--color-white);
}

/* Navbar logo */
.navbar-logo {
    height: 40px;
    width: auto;
}

/* Alert badge in navbar */
.navbar-custom .badge {
    font-size: 0.65rem;
    padding: 0.25rem 0.4rem;
}

/* Responsive mega menu */
@media (max-width: 991.98px) {
    .mega-menu {
        max-width: 100%;
        padding: 1rem;
    }
    
    .mega-menu .row {
        flex-direction: column;
    }
    
    .mega-menu .col-md-3,
    .mega-menu .col-md-4 {
        width: 100%;
        margin-bottom: 1rem;
        padding-bottom: 1rem;
        border-bottom: 1px solid var(--color-light-gray);
    }
    
    .mega-menu .col-md-3:last-child,
    .mega-menu .col-md-4:last-child {
        border-bottom: none;
        margin-bottom: 0;
        padding-bottom: 0;
    }
}
