/* --- DO NOT DELETE: MASTER STYLESHEET --- */
/* static/style.css */
body { font-family: Arial, sans-serif; margin: 0; background: #f4f6f9; color: #333; display: flex; height: 100vh; overflow: hidden;}
.sidebar { width: 250px; background: #1a1a1a; color: white; display: flex; flex-direction: column; }
.sidebar-header { padding: 20px; font-weight: bold; font-size: 18px; border-bottom: 1px solid #333; }
.sidebar-nav { padding: 0; flex: 1; overflow-y: auto; }
.sidebar-nav::-webkit-scrollbar { width: 6px; }
.sidebar-nav::-webkit-scrollbar-track { background: #1a1a1a; }
.sidebar-nav::-webkit-scrollbar-thumb { background: #444; border-radius: 4px; }
.sidebar-nav::-webkit-scrollbar-thumb:hover { background: #666; }

.category-details { border-bottom: 1px solid #2a2a2a; }
.category-summary { display: flex; justify-content: space-between; align-items: center; padding: 15px 20px; font-size: 13px; font-weight: bold; text-transform: uppercase; color: #aaa; cursor: pointer; list-style: none; transition: background 0.2s, color 0.2s; }
.category-summary::-webkit-details-marker { display: none; }
.category-summary:hover { background: #222; color: #fff; }
.category-details[open] > .category-summary { color: #fff; background: #222; border-bottom: 1px solid #333; }
.category-details[open] .category-arrow { transform: rotate(180deg); }
.category-arrow { font-size: 10px; color: #666; transition: transform 0.2s ease; }
.category-content { padding: 10px 0; background: #151515; }

.nav-container { display: block; margin-bottom: 2px; padding: 0 10px; }
.nav-summary { display: flex; justify-content: space-between; align-items: center; color: #ccc; padding: 8px 12px; border-radius: 4px; font-size: 13px; font-weight: bold; cursor: pointer; user-select: none; list-style: none; transition: background 0.2s, color 0.2s; }
.nav-summary::-webkit-details-marker { display: none; }
.nav-summary:hover { background: #333; color: white; }
.nav-summary.active { background: #007BFF; color: white; }
.nav-container[open] .arrow-indicator { transform: rotate(180deg); color: #fff; }
.arrow-indicator { font-size: 10px; color: #666; transition: transform 0.2s ease; }
.sub-menu-tray { background: #111; border-radius: 4px; margin-top: 2px; padding: 4px 0; }
.sub-link { display: block; font-size: 12px !important; padding: 6px 15px !important; color: #777 !important; text-decoration: none; font-weight: normal !important; }
.sub-link:hover { color: #fff !important; background: #222 !important; }

/* Dynamic scroll variables moved to inline styles in main.py, base flex styles kept here */
.main-area { flex: 1; display: flex; flex-direction: column; height: 100vh; }
.topbar { background: white; padding: 15px 30px; display: flex; justify-content: space-between; align-items: center; box-shadow: 0 2px 5px rgba(0,0,0,0.05); flex-shrink: 0; z-index: 200; position: sticky; top: 0; }
.content-container { padding: 20px 30px; flex: 1; display: flex; flex-direction: column; width: 100%; box-sizing: border-box; }

.grid-scroll-container { overflow: auto; width: 100%; height: 100%; border-radius: 8px; box-shadow: 0 4px 15px rgba(0,0,0,0.05); background: white; }

.btn { padding: 8px 16px; border-radius: 5px; cursor: pointer; font-weight: bold; border: none; font-size: 13px; }
.btn-blue { background: #007BFF; color: white; }
.btn-green { background: #28a745; color: white; }
.btn-teal { background: #17a2b8; color: white; }
.btn-red { background: #dc3545; color: white; }
.btn-grey { background: #6c757d; color: white; font-size: 12px; padding: 6px 12px; border: 1px solid #bbb; }
.btn-grey:hover { background: #5a6268; color: white; }
.dropdown { position: relative; display: inline-block; }
.dropdown-content { display: none; position: absolute; background-color: #fff; min-width: 200px; box-shadow: 0px 8px 16px 0px rgba(0,0,0,0.15); z-index: 1000; border-radius: 5px; left: 0; border: 1px solid #ddd; overflow: hidden; margin-top: 2px; }
.dropdown-content button { color: #444; padding: 12px 15px; text-decoration: none; display: block; border: none; background: none; width: 100%; text-align: left; cursor: pointer; font-size: 13px; font-weight: bold; border-bottom: 1px solid #eee; transition: background 0.2s; white-space: nowrap; }
.dropdown-content button:hover { background-color: #f4f6f9; color: #007BFF; }
.dropdown-content button:last-child { border-bottom: none; }
.dropdown:hover .dropdown-content { display: block; }

table { width: 100%; border-collapse: collapse; margin-bottom: 20px; background: white; }
th, td { border-bottom: 1px solid #ddd; vertical-align: middle; font-size: 14px; }

.template-table { table-layout: fixed; width: 100%; box-shadow: 0 4px 15px rgba(0,0,0,0.05); border-radius: 8px; overflow: hidden; }
.template-table th, .template-table td { padding: 8px 15px; text-align: left; }

.production-table { table-layout: auto; width: max-content; min-width: 100%; border-collapse: separate; border-spacing: 0; }
.production-table th { position: sticky; top: 0; z-index: 150; background-color: #343a40 !important; color: white; white-space: normal; min-width: 60px; max-width: 120px; padding: 4px 8px; font-size: 11px; vertical-align: bottom; line-height: 1.3; border-bottom: 2px solid #222; border-right: 1px solid #444; }
.production-table td { border-right: 1px solid #eee; white-space: nowrap; padding: 4px 8px; font-size: 12px; }
.production-table tr.prod-divider-row td { background-color: #343a40 !important; height: 28px; border-bottom: 1px solid #222 !important; border-top: 1px solid #222 !important; border-right: none !important; }

.section-header { background-color: #343a40; color: white; font-weight: bold; text-transform: uppercase; font-size: 13px; transition: background-color 0.2s; }
.section-header:hover { background-color: #23272b; }
tr.sec-closed, tr.view-filtered, tr.search-filtered { display: none !important; }
tr[id^="sec-"] { scroll-margin-top: 80px; }
input[type="number"] { width: 120px; padding: 6px; background-color: #e9ecef; border: 1px solid #ccc; border-radius: 4px; font-weight: bold; transition: background-color 0.3s;}
input[type="number"]:focus { background-color: #fff; border-color: #007BFF; outline: none; box-shadow: 0 0 5px rgba(0,123,255,0.5); }
details { cursor: pointer; color: #666; font-size: 12px; }
details > summary { font-weight: bold; outline: none; margin-bottom: 5px; }
.help-guide { background: #f8f9fa; padding: 15px; border-left: 3px solid #007BFF; display: block; line-height: 1.4; border-radius: 0 4px 4px 0; }
.help-guide-code { background: #e9ecef; padding: 2px 4px; border-radius: 4px; font-family: Consolas, monospace; font-size: 11px; color: #d63384; word-break: break-all; }
.math-display-box { background: #ffffff; padding: 8px; border: 1px solid #dee2e6; border-radius: 4px; margin-top: 3px; text-align: center; overflow-x: auto; font-size: 14px; color: #333; }
.inline-edit-input { width: 100%; padding: 6px; margin-bottom: 8px; border: 1px solid #ccc; border-radius: 4px; box-sizing: border-box; font-size: 12px; font-family: Arial, sans-serif;}
textarea.inline-edit-input { font-family: Consolas, monospace; }
.inline-label { font-weight: bold; color: #555; text-transform: uppercase; font-size: 10px; margin-bottom: 3px; display: block; }
.modal { display: none; position: fixed; z-index: 1000; left: 0; top: 0; width: 100%; height: 100%; background-color: rgba(0,0,0,0.6); }

.modal-content { background-color: #fff; margin: 10px auto; padding: 10px 10px; border-radius: 8px; width: 80%; max-width: 600px; position: relative; max-height: 75vh; overflow-y: auto; }

.close-btn { position: absolute; top: 15px; right: 20px; font-size: 24px; font-weight: bold; color: #888; cursor: pointer; }
.modal-label { font-weight: bold; color: #555; text-transform: uppercase; font-size: 12px; margin-bottom: 5px; display: block; }

.edit-input { width: 100%; padding: 10px; margin-bottom: 10px; border: 1px solid #ccc; border-radius: 4px; box-sizing: border-box; }

/* --- OVERRIDE: Force autocomplete dropdowns to wrap text --- */
.autocomplete-items div,
.autocomplete-suggestion,
.suggestion-item,
[class*="autocomplete"] {
    white-space: normal !important;
    word-break: break-word !important;
    height: auto !important;
    line-height: 1.4 !important;
    padding-bottom: 8px !important;
}

/* Target the smaller grey path text specifically */
.autocomplete-items div small,
.autocomplete-suggestion small,
.suggestion-item small,
.suggestion-path,
[class*="autocomplete"] small {
    white-space: normal !important;
    overflow: visible !important;
    text-overflow: clip !important;
    display: block !important;
    margin-top: 4px !important;
    color: #666 !important;
}