/* Module 3.1: CSS namespaced to avoid affecting login and users. */
.chem-page{--teal:#0f8b8d;--navy:#142b3b;--line:#e2e9ed;--muted:#71818c;--red:#c34444;direction:rtl;color:#223542;max-width:1500px;margin:auto}
.chem-page *{box-sizing:border-box}.chem-page button,.chem-page input,.chem-page textarea,.chem-page select{font:inherit}.chem-page button{cursor:pointer}.chem-page button:disabled{opacity:.55;cursor:not-allowed}
.chem-heading{display:flex;align-items:start;justify-content:space-between;gap:20px;margin-bottom:24px}.chem-heading small{display:block;color:var(--teal);font-weight:bold;margin-bottom:8px}.chem-heading h1{font-size:24px;margin:0 0 9px}.chem-heading p{color:var(--muted);line-height:1.9;margin:0}
.chem-actions{display:flex;align-items:center;flex-wrap:wrap;gap:7px}.chem-btn{border:1px solid var(--line);border-radius:9px;background:white;color:#223542;padding:10px 13px;white-space:nowrap;font-weight:600}.chem-btn:hover:enabled{filter:brightness(.97)}.chem-btn.chem-primary{background:var(--teal);color:white;border-color:var(--teal)}.chem-btn.chem-dark{background:#1d3c50;color:white;border-color:#1d3c50}.chem-btn.chem-small{padding:7px 9px;font-size:11px}.chem-btn.chem-danger{border-color:#efd0d0;color:#b23d3d}
.chem-alert{border-radius:9px;padding:13px 16px;margin-bottom:14px;border:1px solid}.chem-error{background:#fff4f4;color:#a33;border-color:#eecaca}.chem-success{background:#e9f7ee;color:#176e49;border-color:#c0e2cc}
.chem-stats{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:14px;margin-bottom:22px}.chem-stat{background:white;border:1px solid var(--line);border-radius:14px;padding:18px;display:flex;align-items:center;justify-content:space-between;gap:10px}.chem-stat small{color:var(--muted);display:block;font-size:11px}.chem-stat strong{display:block;color:var(--navy);font-size:26px;margin-top:10px}.chem-stat span{background:#e7f5f4;color:var(--teal);border-radius:10px;padding:12px;font-size:20px}
.chem-panel{background:white;border:1px solid var(--line);border-radius:14px;overflow:hidden;box-shadow:0 8px 24px rgba(25,48,62,.06)}.chem-panel-header{display:flex;align-items:center;justify-content:space-between;gap:16px;padding:18px 20px;border-bottom:1px solid var(--line)}.chem-panel-header h2{font-size:14px;margin:0 0 8px}.chem-panel-header p{font-size:11px;color:var(--muted);margin:0}.chem-pill{display:inline-block;border-radius:7px;background:#edf3f5;color:#607784;padding:4px 7px;font-size:10px;margin-right:7px;font-weight:400}
.chem-filters{padding:15px 20px;display:grid;grid-template-columns:minmax(200px,1.5fr) repeat(3,minmax(120px,1fr)) auto;gap:10px;align-items:end}.chem-field{display:flex;min-width:0;flex-direction:column;gap:7px}.chem-field label{font-size:11px;font-weight:bold;color:#526571}.chem-field input,.chem-field select,.chem-field textarea{width:100%;min-width:0;border:1px solid #dbe4e9;border-radius:8px;background:white;color:#223542;outline:none;padding:10px 11px}.chem-field input:focus,.chem-field select:focus,.chem-field textarea:focus{border-color:var(--teal);box-shadow:0 0 0 3px #0f8b8d16}.chem-field .validation-message{font-size:10px;color:var(--red)}.chem-help{color:var(--muted);font-size:10px;line-height:1.9;margin:0;padding:0 20px 15px}
.chem-table-wrap{overflow:auto}.chem-table{border-collapse:collapse;width:100%;white-space:nowrap;text-align:right}.chem-table thead{background:#f8fafb}.chem-table th{padding:13px 16px;text-align:right;font-size:10px;color:#71818c;border-bottom:1px solid var(--line);border-top:1px solid var(--line)}.chem-table td{padding:13px 16px;font-size:12px;border-bottom:1px solid #edf1f3}.chem-table tr:hover{background:#fbfdfd}.chem-material{display:flex;gap:11px;align-items:center}.chem-material strong{display:block;font-size:12px;margin-bottom:6px}.chem-material small{color:var(--muted);font-size:10px;display:block;text-align:left;font-family:Consolas,monospace}.chem-icon{width:37px;height:37px;background:#edf5f6;color:#286e78;border-radius:10px;display:grid;place-items:center;font-size:18px}.chem-badge{display:inline-block;border-radius:20px;padding:6px 10px;font-size:10px;font-weight:bold}.chem-badge.active{color:#168257;background:#e8f6ef}.chem-badge.inactive{color:#b84747;background:#fff0f0}
.chem-empty{padding:35px 20px;text-align:center;color:var(--muted)}.chem-footer{display:flex;align-items:center;justify-content:space-between;gap:12px;padding:15px 20px;font-size:11px;color:var(--muted);border-top:1px solid var(--line)}.chem-footer b{background:var(--teal);color:white;padding:9px 12px;border-radius:7px}
.chem-overlay{position:fixed;inset:0;z-index:1000;background:rgba(16,36,50,.59);display:flex;align-items:center;justify-content:center;padding:20px}.chem-modal{background:white;width:min(950px,100%);max-height:94vh;overflow:auto;border-radius:16px;box-shadow:0 25px 80px #00111d40}.chem-modal-head{position:sticky;top:0;z-index:2;display:flex;justify-content:space-between;gap:15px;padding:20px 24px;border-bottom:1px solid var(--line);background:#fff}.chem-modal-head h2{font-size:17px;margin:0 0 8px}.chem-modal-head p{font-size:11px;color:var(--muted);margin:0}.chem-close{border:0;border-radius:8px;background:#f0f4f6;color:#627782;font-size:20px;width:34px;height:34px}.chem-modal-body{padding:22px 24px}.chem-modal-body h3{font-size:12px;margin:2px 0 16px;padding-right:9px;border-right:3px solid var(--teal)}.chem-modal-body .validation-summary-errors{color:var(--red);font-size:11px}
.chem-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:15px;margin-bottom:25px}.chem-wide{grid-column:1 / -1}.chem-check{display:flex;gap:9px;align-items:center}.chem-modal-foot{position:sticky;bottom:0;display:flex;gap:9px;justify-content:flex-end;padding:15px 24px;background:#fafcfc;border-top:1px solid var(--line)}.chem-details{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px}.chem-details>div{padding:13px;border:1px solid var(--line);border-radius:9px;background:#f8fafb}.chem-details label{color:var(--muted);font-size:10px}.chem-details p{white-space:pre-wrap;overflow-wrap:anywhere;margin:7px 0 0;font-size:12px;line-height:1.9}.chem-confirm{width:min(440px,100%);padding:25px;border-radius:14px;background:white}.chem-confirm h2{font-size:18px;margin:0 0 14px}.chem-confirm p{line-height:1.9;margin:0 0 20px}
@media(max-width:1150px){.chem-stats{grid-template-columns:repeat(2,minmax(0,1fr))}.chem-filters{grid-template-columns:repeat(2,minmax(0,1fr))}}
@media(max-width:760px){.chem-heading,.chem-panel-header,.chem-footer{flex-direction:column;align-items:stretch}.chem-filters{grid-template-columns:1fr}.chem-grid{grid-template-columns:repeat(2,minmax(0,1fr))}.chem-details{grid-template-columns:1fr}.chem-modal-head,.chem-modal-body,.chem-modal-foot{padding:16px}.chem-stat{padding:12px}.chem-stat span{display:none}}
@media(max-width:440px){.chem-grid{grid-template-columns:1fr}.chem-heading h1{font-size:21px}.chem-stat strong{font-size:22px}}
