 /*
         * GLOBAL STYLES & RESET - EMERALD GREEN THEME
         */
         :root {
            --color-background: #F9F9F9;    /* Soft Off-White background */
            --color-card-bg: #FFFFFF;       /* Pure white for cards */
            --color-text-dark: #000;     /* Deep Charcoal for primary text */
            --color-text-muted: #000;    /* Soft Gray for secondary text */
            --color-accent: #000;        /* Primary Emerald Green accent */
            --color-accent-light: #fff;  /* Very light Mint for subtle accents/headers */
            --color-border: #282828;        /* Very light gray border */
            --font-family: 'arial-mt-std', Arial, Helvetica, sans-serif;


            --color-card: #FFFFFF;
            --spacing-unit: 1rem;
            --border-radius: 6px;
            --color-shadow: rgba(0, 0, 0, 0.08);
            --color-primary: #000;
            --color-positive: #198754; /* Green for positive trends */
	        --color-negative: #DC3545; /* Red for negative trends */
        }

        @font-face {
            font-family: 'arial_mt_stdlight';
            src: url('fonts/arialmtstd-light.eot');
            src: url('fonts/arialmtstd-light.eot?#iefix') format('embedded-opentype'),
              url('fonts/arialmtstd-light.woff2') format('woff2'),
              url('fonts/arialmtstd-light.woff') format('woff'),
              url('fonts/arialmtstd-light.ttf') format('truetype'),
              url('fonts/arialmtstd-light.svg#arial_mt_stdlight') format('svg');
            font-weight: normal;
            font-style: normal;
          }
        
        @font-face {
            font-family: 'arial-mt-std';
            src: url('fonts/Arial-MT-Std.ttf') format('truetype');
          }

        body {
            font-family: var(--font-family);
            background-color: rgba(255, 255, 255, 0.7);;
            color: var(--color-text-dark);
            margin: 0;
            padding: 20px;
        }

        #app-container {
            max-width: 1280px;
            /* margin: 0 auto; */
            display: flex;
            flex-direction: column;
            gap: 30px;
        }

        /*
         * ICON UTILITY CLASS
         * Ensures icons are correctly sized and aligned with text.
         */
        .icon {
            display: inline-block;
            vertical-align: middle;
            margin-right: 8px;
            stroke: currentColor; /* Inherit color from parent element */
            stroke-width: 2;
            fill: none;
        }
        
        .icon.lg { /* For Header Title */
            width: 26px;
            height: 26px;
            stroke-width: 2.5;
        }
        
        .icon.md { /* For Card and Group Titles */
            width: 20px;
            height: 20px;
        }
        
        .icon.xs { /* New size for period selection links */
            width: 16px; 
            height: 16px;
            margin-right: 5px;
        }

        /*
         * HEADER STYLES
         */
        header {
            padding-bottom: 20px;
            border-bottom: 2px solid var(--color-border);
        }

        h1 {
            font-size: 28px;
            font-weight: 700;
            color: var(--color-text-dark);
            margin: 0 0 5px 0;
        }

        .subtitle {
            font-size: 18px;
            color: var(--color-accent);
            margin: 0;
        }

        /*
         * CARD COMPONENT BASE
         */
        .card {
            background-color: var(--color-card-bg);
            padding: 30px;
            border-radius: 4px;
            box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1),
            0 4px 6px -4px rgba(0, 0, 0, 0.1),
            0 -6px 12px -4px rgba(0, 0, 0, 0.1);
        }


        /*
         * NEW PERIOD SELECTION STYLES
         */

         .selection-panel {
            background: var(--color-card);
            padding: calc(var(--spacing-unit) * 1.5);
            border-radius: var(--border-radius);
            box-shadow: 0 4px 12px var(--color-shadow);
            /* margin-bottom: calc(var(--spacing-unit) * 3); */
            display: flex;
            flex-direction: column;
            gap: calc(var(--spacing-unit) * 1.5);
            border: 1px solid rgba(0, 0, 0, 0.05);
        }

        .selection-panel h2 {
            font-size: 18px;
            margin-top: 0;
            margin-bottom: 20px;
            color: var(--color-accent);
            border-bottom: 1px solid var(--color-border);
            padding-bottom: 10px;
            display: flex; /* Use flex for icon alignment */
            align-items: center;
        }

        .quick-select-title {
            font-size: 18px;
            font-weight: 600;
            margin-bottom: 0.5rem;
            color: var(--color-primary);
        }
        
        .quick-links {
            display: flex;
            flex-wrap: wrap;
            row-gap: 12px;
            column-gap: 38px;
            max-width: 600px;

        }
        
        .quick-link {
            padding: 10px 36px 10px 16px;
            border-radius: 6px;
            background-color: var(--color-bg); /* Light background for default state */
            color: var(--color-text-dark);
            border: 1px solid #000;
            cursor: pointer;
            transition: background-color 0.2s, color 0.2s, box-shadow 0.2s;
            font-size: 16px;
            line-height: 132%;
            font-weight: 500;
            min-width: 250px;
            width: 80%;
        }

        @media (max-width: 375px) {
            .quick-link {
                min-width: 150px;
                width: auto;
                max-width: 305px;
    }
}
        
        /* .quick-link:hover {
            background-color: #EEEEEE;
        }
         */
        .quick-links a {
            text-decoration: none;
            color: inherit;
            display: inline-block;
        }
        
        .quick-links a:hover {
            text-decoration: none;
        }
        
        .quick-link.active {
            background-color: var(--color-accent);
            color: var(--color-accent-light); /* Dark text on Gold */
            border-color: var(--color-accent);
            /* box-shadow: 0 0 8px rgba(255, 179, 0, 0.5); */
            font-weight: 500;
        }
        
        .user-defined-period {
            display: flex;
            flex-direction: column;
            gap: 1rem;
            padding-top: 1rem;
            border-top: 1px solid #EEEEEE;
            box-sizing: border-box;
        }
        

        .date-inputs {
                display: flex;
                gap: 1rem;
                align-items: center;
                flex-wrap: wrap;
            }

        @media (max-width: 328px){

            .date-inputs {
                flex-wrap: nowrap;
            }
        }
        
        
        .date-inputs label {
            color: var(--color-text-muted);
            font-size: 0.9rem;
        }
        
        .date-inputs input[type="date"], .date-inputs input[type="text"] {
            padding: 10px 36px 10px 16px;
            border-radius: 6px;
            border: 1px solid #000;
            background-color: var(--color-card);
            color: var(--color-text-dark);
            line-height: 150%;
            flex-grow: 1; 
            /* max-width removed here for initial flexibility */
            cursor: pointer;
            font-weight: 500;
            font-size: 16px;
        }
        
        .submit-btn {
			padding: 10px 36px 10px 16px;
			border-radius: 6px;
			background-color: var(--color-primary);
			color: var(--color-card);
			font-weight: 500;
			cursor: pointer;
			transition: all 0.8s ease;
			font-size: 14px;
			line-height: 150%;
			min-width: 190px;
			display: inline-block;
			overflow: hidden;
			position: relative;
			text-align: left;
			border: 1px solid #000;
		}

		/* Use a parent container for the hover effects */
		.button-container {
			position: relative;
			display: inline-block;
		}

		.button-container::before {
			position: absolute;
			content: '';
			background-image: url('../right-arrow-white.svg');
			background-repeat: no-repeat;
			width: 20px;
			height: 20px;
			right: 12px;
			top: 50%;
			transform: translateY(-50%);
			z-index: 3;
			pointer-events: none;
			transition: all 0.8s ease;
		}

		.button-container::after {
			content: 'Submit';
			position: absolute;
			left: 16px;
			top: 50%;
			transform: translateY(100%);
			opacity: 0;
			transition: all 0.8s ease;
			white-space: nowrap;
			color: #000;
			z-index: 2;
			font-weight: 500;
			font-size: 14px;
		}

		.button-container:hover::before {
			background-image: url('../right-arrow-black.svg');
			width: 25px;
			height: 25px;
			right: 10px;
		}

		.button-container:hover::after {
			transform: translateY(-50%);
			opacity: 1;
		}

		.button-container:hover .submit-btn {
			background-color: rgb(174 174 174 / 30%);
			backdrop-filter: blur(12px);
			border: 1px solid #000;
			color: #000;
			color: transparent;
		}
        
        /* --- MOBILE RESPONSIVENESS FIX FOR DATE INPUTS --- */
        @media (max-width: 800px) {
            .submit-btn {
                margin-left: 50px;
            }
        }
        
        @media (max-width: 640px) {
            .date-inputs {
                /* Force items to stack vertically on small screens */
                flex-direction: column;
                align-items: stretch; 
                gap: 0.5rem; /* Reduce gap when stacking */
            }
        
            .date-inputs label {
                margin-top: 0.5rem; 
                align-self: flex-start;
                font-weight: 600; /* Make label slightly bolder for visibility */
            }
        
            .date-inputs input[type="date"], .date-inputs input[type="text"],
            .submit-btn,
            .quick-link {
                /* width: 100%;  */
                max-width: none;
                margin: 0; /* Ensure no external limit restricts width */
            }

            .submit-btn {
                width: 100%;
            }

            
        }
        
        /* Reintroduce desktop sizing constraints */
        @media (min-width: 641px) {
            .date-inputs input[type="date"], .date-inputs input[type="text"] {
                max-width: 150px; /* Limit input width on desktop */
            }
        }


        /*
         * PERIOD SELECTION STYLES
         */
        .period-selection-card h2 {
            font-size: 1.5rem;
            margin-top: 0;
            margin-bottom: 20px;
            color: var(--color-accent);
            border-bottom: 1px solid var(--color-border);
            padding-bottom: 10px;
            display: flex; /* Use flex for icon alignment */
            align-items: center;
        }
        
        /* Ensure the icon color matches the title color */
        .period-selection-card h2 .icon {
            color: var(--color-accent);
        }

        .quick-selects {
            display: flex;
            flex-wrap: wrap;
            gap: 10px;
            margin-bottom: 30px;
        }

        .period-link {
            text-decoration: none;
            color: var(--color-text-dark); 
            background-color: var(--color-accent-light);
            padding: 8px 15px;
            border-radius: 4px;
            font-size: 0.9rem;
            transition: all 0.2s ease-in-out;
            border: 1px solid #000;
            /* Added for icon alignment */
            display: flex; 
            align-items: center;
            justify-content: center;
        }

        .period-link:hover {
            background-color: var(--color-border);
            transform: translateY(-1px);
        }

        .period-link.active {
            background-color: var(--color-accent);
            color: white; /* White text on Emerald background */
            font-weight: 600;
            border-color: var(--color-accent);
        }
        
        /* Ensures icon color is white when the link is active */
        .period-link.active .icon {
            stroke: white;
        }

        .user-defined-period p {
            color: var(--color-text-muted);
            font-style: italic;
            margin-bottom: 15px;
            font-size: 0.9rem;
        }

        .date-controls {
            display: flex;
            flex-wrap: wrap;
            gap: 10px;
            align-items: center;
        }

        .date-controls input {
            padding: 10px 15px;
            border-radius: 8px;
            border: 1px solid var(--color-border);
            background-color: var(--color-card-bg);
            color: var(--color-text-dark);
            font-size: 1rem;
            flex-grow: 1;
            min-width: 150px;
            transition: border-color 0.2s;
        }
        
        .date-controls input:focus {
            border-color: var(--color-accent);
            outline: none;
        }

        .date-controls button {
            padding: 10px 20px;
            border: none;
            border-radius: 8px;
            background-color: var(--color-accent);
            color: white;
            font-weight: 700;
            cursor: pointer;
            transition: background-color 0.2s;
            /* box-shadow: 0 2px 4px rgba(0, 163, 145, 0.4); */
            display: flex; /* Enable flex for icon alignment */
            align-items: center;
            gap: 5px;
        }

        .date-controls button:hover {
            background-color: #00806D; 
        }

        /* Style the icon inside the button */
        .date-controls button .icon {
            stroke: white; /* Force icon stroke color to white */
            margin-right: 0;
        }

        /*
         * DATA TABLE STYLES (Grid Layout)
         */
        .data-display-card {
            padding: 0;
        }

        /* Define the grid for the table structure */
        .table-header, .data-row, .data-group-title {
            display: grid;
            grid-template-columns: 2fr 1fr 1fr;
            padding: 15px 30px;
            align-items: center;
            border-bottom: 1px solid var(--color-border);
        }

        /* Header specific styling */
        .table-header {
            background-color: #f0e9db;
            font-weight: 600;
            font-size: 16px;
            color: var(--color-text-dark);
            border-top-left-radius: 6px;
            border-top-right-radius: 6px;
            position: sticky;
            top: 0;
            z-index: 0;
            gap: 10px;
        }

        .table-header .period-column {
            text-align: right;
        }

        /* Row specific styling */
        .data-row {
            transition: background-color 0.2s;
            font-size: 16px;
        }

       /*  .data-row:hover {
            background-color: #FAFAFA;
        } */

        .data-row:last-of-type {
            border-bottom: none;
        }

        /* Content within rows */
        .metric-label {
            color: var(--color-text-dark);
        }
        
        /* Nested/indented metrics */
        .metric-label.indented {
            padding-left: 20px;
            color: var(--color-text-muted);
            font-size: 16px;
        }
        
        .data-value {
            text-align: right;
            font-weight: 500;
        }
        
        /* Highlight specific data values with the emerald accent */
        .data-value.highlight {
            color: var(--color-accent); 
            font-weight: 700;
        }

        /* Group title for section separation */
        .data-group-title {
            font-size: 1rem;
            font-weight: 600;
            /* background-color: #f0e9db; */
            color: var(--color-accent);
            padding-top: 20px;
            padding-bottom: 10px;
            border-top: 2px solid var(--color-accent);
            border-bottom: 1px solid var(--color-border);
            display: flex; /* Use flex for icon alignment */
            align-items: center;
        }
        
        /* Ensure the icon color matches the title color */
        .data-group-title .icon {
            color: var(--color-accent);
        }


       

        /* --- Card Footer --- */
.card-footer {
    text-align: center;
    margin-top: 12px; 
    font-size: 12px; /* 12px */
    color: var(--color-text-subtle);
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 30px;
    border-top: 1px solid var(--color-border);
}

.poweredby img {
    height: 10px;
}

        /*
         * RESPONSIVENESS (MOBILE FIRST)
         */
        @media (max-width: 768px) {
            /* ... (Responsiveness styles remain the same) ... */
            body {
                padding: 10px;
            }
            
            #app-container {
                gap: 20px;
            }

            h1 {
                font-size: 1.8rem;
            }
            
            .card {
                padding: 20px;
            }

            /* Adjust the quick select links to stack vertically for better tap targets */
            .quick-selects {
                flex-direction: column;
                gap: 5px;
            }
            .period-link {
                width: 100%;
                text-align: center;
                box-sizing: border-box;
            }
            
            /* Date controls stack on mobile */
            .date-controls {
                flex-direction: column;
            }
            .date-controls input, .date-controls button {
                width: 100%;
            }

            /* Main Table Grid Adjustment for small screens */
            .table-header, .data-row, .data-group-title {
                /* On small screens, shrink the metric label column slightly */
                grid-template-columns: 1.8fr 1fr 1fr;
                padding: 10px 15px;
            }
        }
        
        /* A more compact view for data on very small screens */
        @media (max-width: 480px) {
            .table-header, .data-row, .data-group-title {
                font-size: 16px;
            }
            
            .data-group-title {
                font-size: 16px;
            }
            
            .metric-label.indented {
                padding-left: 10px;
            }
        }
/* jQuery UI Datepicker Custom Styling */
.ui-datepicker {
    background: var(--color-card) !important;
    border: 1px solid #E0E0E0 !important;
    border-radius: var(--border-radius) !important;
    box-shadow: 0 4px 12px var(--color-shadow) !important;
    padding: 10px !important;
    font-family: 'Inter', sans-serif !important;
    width: 300px !important;
}

.ui-datepicker-header {
    background: var(--color-primary) !important;
    color: white !important;
    border: none !important;
    border-radius: 4px !important;
    padding: 8px 0 !important;
    position: relative !important;
}

.ui-datepicker-prev, .ui-datepicker-next {
    cursor: pointer !important;
    color: white !important;
    position: absolute !important;
    top: 50% !important;
    transform: translateY(-50%) !important;
    background: none !important;
    border: none !important;
}

.ui-datepicker-prev {
    left: 10px !important;
}

.ui-datepicker-next {
    right: 10px !important;
}

.ui-datepicker-prev span, .ui-datepicker-next span {
    display: none !important;
}

.ui-datepicker-prev:before {
    content: "<" !important;
    color: white !important;
    font-size: 18px !important;
    font-weight: bold !important;
}

.ui-datepicker-next:after {
    content: ">" !important;
    color: white !important;
    font-size: 18px !important;
    font-weight: bold !important;
}

.ui-datepicker-title {
    color: white !important;
    font-weight: 600 !important;
    font-size: 1rem !important;
    margin: 0 !important;
}

.ui-datepicker-calendar {
    width: 100% !important;
    border-collapse: collapse !important;
    margin-top: 10px !important;
}

.ui-datepicker-calendar th {
    background: var(--color-bg) !important;
    color: var(--color-text-dark) !important;
    font-weight: 600 !important;
    padding: 8px 0 !important;
    border: none !important;
    font-size: 0.9rem !important;
}

.ui-datepicker-calendar td {
    border: 1px solid #F0F0F0 !important;
    text-align: center !important;
    padding: 0 !important;
}

.ui-datepicker-calendar td a {
    background: transparent !important;
    color: var(--color-text-dark) !important;
    text-align: center !important;
    padding: 8px 0 !important;
    display: block !important;
    text-decoration: none !important;
    border: none !important;
    font-weight: 500 !important;
    transition: all 0.2s ease !important;
}

.ui-datepicker-calendar td a:hover {
    background: var(--color-accent) !important;
    color: var(--color-primary) !important;
    font-weight: 700 !important;
}

.ui-datepicker-calendar .ui-state-active {
    background: var(--color-primary) !important;
    color: white !important;
    font-weight: 700 !important;
}

.ui-datepicker-calendar .ui-state-default {
    border: none !important;
}

.ui-datepicker-calendar .ui-state-hover {
    background: var(--color-accent) !important;
    color: var(--color-primary) !important;
}

/* Today's date */
.ui-datepicker-calendar .ui-datepicker-today a {
    background: var(--color-bg) !important;
    color: var(--color-primary) !important;
    font-weight: 700 !important;
}

/* Other month days */
.ui-datepicker-calendar .ui-datepicker-other-month a {
    color: var(--color-text-muted) !important;
    opacity: 0.6 !important;
}

/* Date input fields */
.datepicker {
    border-radius: 6px !important;
    background-color: var(--color-card) !important;
    color: var(--color-text-dark) !important;
    font-weight: 500 !important;
    font-family: 'Inter', sans-serif !important;
    font-size: 0.9rem !important;
}

/* jQuery UI Datepicker Header Dropdown Styling */
.ui-datepicker .ui-datepicker-title select {
    background: white !important;
    color: var(--color-text-dark) !important;
    border: 1px solid #CCCCCC !important;
    border-radius: 4px !important;
    padding: 4px 8px !important;
    font-family: 'Inter', sans-serif !important;
    font-size: 0.9rem !important;
    font-weight: 500 !important;
    margin: 0 2px !important;
    height: 32px !important;
    appearance: menulist !important;
    -webkit-appearance: menulist !important;
    -moz-appearance: menulist !important;
}

.ui-datepicker .ui-datepicker-title select:hover {
    border-color: var(--color-primary) !important;
}

.ui-datepicker .ui-datepicker-title select:focus {
    outline: none !important;
    border-color: var(--color-accent) !important;
    box-shadow: 0 0 0 2px rgba(255, 179, 0, 0.2) !important;
}

/* Month dropdown */
.ui-datepicker .ui-datepicker-title .ui-datepicker-month {
    width: auto !important;
    min-width: 80px !important;
}

/* Year dropdown */
.ui-datepicker .ui-datepicker-title .ui-datepicker-year {
    width: auto !important;
    min-width: 70px !important;
}

/* Ensure the header layout is proper */
.ui-datepicker .ui-datepicker-title {
    display: flex !important;
    justify-content: center !important;
    align-items: center !important;
    gap: 8px !important;
    line-height: 1 !important;
}

/* Fix the navigation buttons positioning */
.ui-datepicker-prev, .ui-datepicker-next {
    top: 50% !important;
    transform: translateY(-50%) !important;
    margin-top: 0 !important;
}