/*
 * Drill-through modal: header, search/sort/export tools, formula box, and tables.
 */
.modal { display: none; position: fixed; inset: 0; background: rgba(0,0,0,0.6); z-index: 2000; justify-content: center; align-items: center; padding: 20px; }
.modal.active { display: flex; }
.modal-content { background: var(--bg-2); border-radius: 8px; max-width: 900px; width: 100%; max-height: 85vh; overflow: hidden; box-shadow: 0 20px 60px rgba(0,0,0,0.3); }
.modal-header { padding: 16px 20px; background: var(--ey-black); color: white; display: flex; justify-content: space-between; align-items: center; }
.modal-header h3 { font-size: 16px; display: flex; align-items: center; gap: 10px; }
.modal-header h3 i { color: var(--ey-yellow); }
.modal-close { background: none; border: none; color: white; font-size: 20px; cursor: pointer; padding: 4px 8px; }
.modal-close:hover { color: var(--ey-yellow); }
.modal-body { padding: 20px; overflow: auto; max-height: calc(85vh - 60px); position: relative; }
.modal-tools { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 16px; padding-bottom: 12px; border-bottom: 1px solid var(--border); }
.modal-tools input, .modal-tools select { flex: 1 1 180px; min-width: 130px; padding: 7px 10px; border: 1px solid var(--border); border-radius: 4px; background: var(--bg-3); color: var(--text-1); }
.modal-tools button { padding: 6px 10px; border: 1px solid var(--border); border-radius: 4px; background: var(--bg-3); color: var(--text-1); cursor: pointer; font-size: 11px; font-weight: 600; }
.modal-tools button:hover, .modal-tools button:focus { background: var(--ey-yellow); color: var(--ey-black); outline: none; }
.modal-tool-note { flex: 1 1 100%; font-size: 11px; color: var(--text-2); }
.modal-section { margin-bottom: 20px; }
.modal-section h4 { font-size: 13px; font-weight: 700; color: var(--text-2); margin-bottom: 10px; text-transform: uppercase; display: flex; align-items: center; gap: 8px; }
.modal-section h4 i { color: var(--ey-yellow); }
.modal-formula { background: var(--ey-black); color: var(--ey-yellow); padding: 12px 16px; border-radius: 6px; font-family: monospace; font-size: 13px; margin-bottom: 15px; }
.modal-table { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 12px; }
.modal-table th, .modal-table td { padding: 10px 12px; text-align: left; border-bottom: 1px solid var(--border); }
.modal-table th { background: var(--ey-black); color: var(--ey-yellow); font-weight: 600; text-transform: uppercase; font-size: 10px; position: sticky; top: 0; z-index: 20; letter-spacing: 0.02em; }
.modal-table tr:hover { background: var(--bg-3); }
.modal-filters { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 15px; }
.filter-tag { padding: 4px 10px; background: var(--ey-yellow-light); border-radius: 12px; font-size: 11px; font-weight: 600; color: var(--ey-black); }
