﻿/**********************************************************************
 * MILO FINAL RECONCILED STYLESHEET (VERSION 4.0)                     *
 * DESCRIPTION: Reconciles modern styles with the legacy HTML structure. *
 **********************************************************************/

/* --- 1. THEME VARIABLES --- */
:root {
    --page-bg: #F8F9FA;
    --content-bg: #FFFFFF;
    --text-primary: #4A4A4A;
    --text-secondary: #999999;
    --border-color: #e0e0e0;
    --panel-header-bg: #F8F9FA;
    --link-color: #4A90E2;
    --link-hover-color: #357ABD;
    --button-bg: #f0f0f0;
    --button-border: #cccccc;
    --button-hover-bg: #e0e0e0;
    --primary-button-bg: #4A90E2;
    --primary-button-hover-bg: #357ABD;
    --table-cell-highlight-bg: #F8F9FA;
    --shadow-color: rgba(0,0,0,0.08);
}

body.dark-theme {
    --page-bg: #121212;
    --content-bg: #1E1E1E;
    --text-primary: #E0E0E0;
    --text-secondary: #888888;
    --border-color: #333333;
    --panel-header-bg: #2A2A2A;
    --link-color: #58A6FF;
    --link-hover-color: #80BFFF;
    --button-bg: #3A3A3A;
    --button-border: #555555;
    --button-hover-bg: #4A4A4A;
    --primary-button-bg: #58A6FF;
    --primary-button-hover-bg: #80BFFF;
    --table-cell-highlight-bg: #2A2A2A;
    --shadow-color: rgba(255,255,255,0.08);
}


/* --- 2. GLOBAL RESETS & DEFAULTS --- */
html {
	direction: ltr;
	box-sizing: border-box;
}
*, *:before, *:after {
	box-sizing: inherit;
}
html, body {
    overflow-x: hidden;
}
body {
    font-family: 'Montserrat', sans-serif;
    font-size: 14px;
    line-height: 1.6;
    color: var(--text-primary);
    background-color: var(--page-bg);
    margin: 0;
    transition: background-color 0.3s, color 0.3s;
}
img, iframe, video {
    max-width: 100%;
    height: auto;
}
a {
    color: var(--link-color);
    text-decoration: none;
}
a:hover {
    text-decoration: underline;
}

/* --- 3. MAIN PAGE LAYOUT --- */
.main-container {
    max-width: 1400px;
    margin: 0 auto;
    background-color: var(--content-bg);
    box-shadow: 0 2px 10px var(--shadow-color);
}
.pcC { /* Main content area */
	padding: 24px;
    background-color: var(--content-bg);
}
.footer {
	text-align: center;
	padding: 20px;
	font-size: 12px;
	color: var(--text-secondary);
}

/* --- 4. HEADER --- */
.pcT {
    padding: 0;
    background: var(--content-bg) !important;
    border-bottom: 1px solid var(--border-color);
}
.pcT > table {
    width: 100%;
    padding: 10px 24px;
}
.pcT > table td[style*="text-align:right"] {
    vertical-align: middle;
    text-align: right;
    white-space: nowrap;
}

/* --- 5. PANELS & HEADERS --- */
.dialog_view, .dv {
    background-color: var(--content-bg);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
    margin-bottom: 24px;
}
.dialog_header, .dh {
    padding: 12px 16px;
    background-color: var(--panel-header-bg);
    border-bottom: 1px solid var(--border-color);
}
.dialog_header_text, .dht {
    font-size: 16px;
    font-weight: 700;
    color: var(--text-primary);
    text-transform: uppercase;
}
.dialog_body, .dBody {
    padding: 16px;
}

/* --- 6. NAVIGATION (TOP MENU) --- */
.MLMmenuAlign {
    border-bottom: 1px solid var(--border-color);
    background-color: var(--content-bg);
    padding: 0 16px;
}
.MLMmC {
    color: var(--text-secondary);
    font-size: 14px;
    font-weight: 600;
    padding: 12px 8px;
}
.MLMmoC:hover, .MLMmoC:hover a, .MLMmoC {
	background-color: var(--panel-header-bg);
	color: var(--link-color);
}

/* --- 7. ALIGNMENT & ACTION BARS --- */
.pagination_row, .pr, .recordPanelButtonsAlignment, .rpbAlign, .search_area, .sa {
    display: flex !important;
    align-items: center !important;
    gap: 16px !important;
    width: 100% !important;
    padding: 8px 16px !important;
    background-color: var(--panel-header-bg) !important;
    border-top: 1px solid var(--border-color);
    border-bottom: 1px solid var(--border-color);
    height: auto !important;
    min-height: 50px;
}
.recordPanelButtonsAlignment, .rpbAlign {
    justify-content: flex-start !important;
}
.search_area > *:last-child, .sa > *:last-child {
    margin-left: auto !important;
}
.pagination_area, .pra {
    display: flex;
    align-items: center;
    gap: 8px;
}

/* --- 8. MODERN BUTTON SYSTEM --- */
/* Hide old button parts */
.button-TL-white, .bTL, .button-T-white, .bT, .button-TR-white, .bTR,
.button-L-white, .bL, .button-R-white, .bR, .button-BL-white, .bBL,
.button-B-white, .bB, .button-BR-white, .bBR {
    display: none;
}
.button-white, .bC {
    display: inline-block;
    width: auto;
    background: none !important;
    border: none !important;
    padding: 0 !important;
    margin: 0;
    vertical-align: middle;
}
a.button_link, .button-white a.button_link, .bC a.button_link {
    display: inline-block;
    background-color: var(--button-bg);
    border: 1px solid var(--button-border);
    border-radius: 4px;
    padding: 8px 16px;
    margin-right: 8px;
    color: var(--text-primary) !important;
    font-weight: 600;
    font-size: 14px;
    text-decoration: none;
    white-space: nowrap;
    cursor: pointer;
    transition: background-color 0.2s ease;
}
a.button_link:hover, .button-white a.button_link:hover, .bC a.button_link:hover {
    background-color: var(--button-hover-bg);
    border-color: var(--button-border);
    text-decoration: none;
}
.primary-button a.button_link {
    background-color: var(--primary-button-bg) !important;
    border-color: var(--primary-button-bg) !important;
    color: white !important;
}
.primary-button a.button_link:hover {
    background-color: var(--primary-button-hover-bg) !important;
    border-color: var(--primary-button-hover-bg) !important;
}


/* --- 9. DATA TABLES --- */
.tre table {
    width: 100%;
    border-collapse: collapse;
}
.header_cell, .thc {
    background-color: var(--content-bg);
    font-weight: 700;
    text-transform: uppercase;
    font-size: 11px;
    letter-spacing: 0.5px;
    color: var(--text-secondary);
    padding: 12px 10px;
    text-align: left;
    border: 1px solid var(--border-color);
    border-bottom-width: 2px;
}
.table_cell, .ttc {
    padding: 12px 10px;
    border: 1px solid var(--border-color);
    vertical-align: top;
}
.table_cell_highlighted, .ttch {
    background-color: var(--table-cell-highlight-bg);
}

/* --- 10. FORMS & INPUTS --- */
.Search_Input, .si, .Filter_Input, .fili, .Pagination_Input, .pri, .field_input, .fi, textarea {
    padding: 8px 10px;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    font-size: 14px;
    background-color: var(--content-bg);
    color: var(--text-primary);
}
.Search_Input:focus, .si:focus, .Filter_Input:focus, .fili:focus, .Pagination_Input:focus, .pri:focus, .field_input:focus, .fi:focus, textarea:focus {
    outline: none;
    border-color: var(--link-color);
    box-shadow: 0 0 0 2px rgba(74, 144, 226, 0.2);
}
.field_label, .fl, .field_label_on_side, .fls {
    font-weight: 600;
    padding-right: 10px;
}

/* --- 11. IFRAME STYLING --- */
.pcC iframe {
    width: 100%;
    height: 75vh; 
    display: block;
    border: none;
}

/* --- 12. THEME SWITCHER --- */
.theme-switcher {
    display: flex;
    align-items: center;
    cursor: pointer;
    background: var(--button-bg);
    padding: 5px;
    border-radius: 20px;
    border: 1px solid var(--border-color);
}
.theme-icon {
    font-size: 18px; /* Adjust size as needed */
    padding: 0 5px;
    color: var(--text-secondary);
}
/* Style for a simple toggle switch */
#theme-toggle-checkbox {
    display: none;
}

/* --- 13. RESPONSIVE & MOBILE STYLES --- */
@media screen and (max-width: 768px) {
    .main-container { box-shadow: none; }
    .pcC { padding: 16px; }
    .tableRowsEdge, .tre {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
}
@media screen and (max-width: 480px) {
    body { font-size: 15px; }
    .pcC { padding: 10px; }
    .pcT > table {
        flex-direction: column;
        gap: 10px;
    }
    .floating-action-button {
		position: fixed;
    	bottom: 20px;
    	right: 20px;
    	width: 56px;
    	height: 56px;
    	background-color: #50E3C2;
    	border-radius: 50%;
    	box-shadow: 0 2px 5px rgba(0,0,0,0.2);
    	display: flex;
    	justify-content: center;
    	align-items: center;
    	color: white;
    	font-size: 28px;
    	text-decoration: none;
    	z-index: 1000;
	}
}